Spaces:
Paused
Paused
Update app_celery.py
Browse files- app_celery.py +13 -18
app_celery.py
CHANGED
@@ -26,16 +26,11 @@ import moviepy.editor as mp
|
|
26 |
import requests
|
27 |
import json
|
28 |
import pickle
|
29 |
-
from dotenv import load_dotenv
|
30 |
from celery import Celery
|
31 |
# from gevent import monkey
|
32 |
# monkey.patch_all()
|
33 |
|
34 |
|
35 |
-
# Load environment variables from .env file
|
36 |
-
load_dotenv()
|
37 |
-
|
38 |
-
|
39 |
|
40 |
class AnimationConfig:
|
41 |
def __init__(self, driven_audio_path, source_image_path, result_folder,pose_style,expression_scale,enhancer,still,preprocess,ref_pose_video_path, image_hardcoded):
|
@@ -268,19 +263,19 @@ def save_uploaded_file(file, filename,TEMP_DIR):
|
|
268 |
file.save(file_path)
|
269 |
return file_path
|
270 |
|
271 |
-
client = OpenAI(api_key=os.getenv('OPENAI_API_KEY'))
|
272 |
-
|
273 |
-
def openai_chat_avatar(text_prompt):
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
|
285 |
def ryzedb_chat_avatar(question):
|
286 |
url = "https://inference.dev.ryzeai.ai/chat/stream"
|
|
|
26 |
import requests
|
27 |
import json
|
28 |
import pickle
|
|
|
29 |
from celery import Celery
|
30 |
# from gevent import monkey
|
31 |
# monkey.patch_all()
|
32 |
|
33 |
|
|
|
|
|
|
|
|
|
34 |
|
35 |
class AnimationConfig:
|
36 |
def __init__(self, driven_audio_path, source_image_path, result_folder,pose_style,expression_scale,enhancer,still,preprocess,ref_pose_video_path, image_hardcoded):
|
|
|
263 |
file.save(file_path)
|
264 |
return file_path
|
265 |
|
266 |
+
# client = OpenAI(api_key=os.getenv('OPENAI_API_KEY'))
|
267 |
+
|
268 |
+
# def openai_chat_avatar(text_prompt):
|
269 |
+
# response = client.chat.completions.create(
|
270 |
+
# model="gpt-4o-mini",
|
271 |
+
# messages=[{"role": "system", "content": "Answer using the minimum words you can ever use."},
|
272 |
+
# {"role": "user", "content": f"Hi! I need help with something. Can you assist me with the following: {text_prompt}"},
|
273 |
+
# ],
|
274 |
+
# max_tokens = len(text_prompt) + 300 # Use the length of the input text
|
275 |
+
# # temperature=0.3,
|
276 |
+
# # stop=["Translate:", "Text:"]
|
277 |
+
# )
|
278 |
+
# return response
|
279 |
|
280 |
def ryzedb_chat_avatar(question):
|
281 |
url = "https://inference.dev.ryzeai.ai/chat/stream"
|