Update app.py
Browse files
app.py
CHANGED
@@ -314,13 +314,13 @@ def openai_chat_avatar(text_prompt):
|
|
314 |
)
|
315 |
return response
|
316 |
|
317 |
-
def ryzedb_chat_avatar(question):
|
318 |
url = "https://inference.dev.ryzeai.ai/chat/stream"
|
319 |
question = question + ". Summarize your answer using the minimum words you can ever use."
|
320 |
payload = json.dumps({
|
321 |
"input": {
|
322 |
"chat_history": [],
|
323 |
-
"app_id":
|
324 |
"question": question
|
325 |
},
|
326 |
"config": {}
|
@@ -393,10 +393,13 @@ def generate_video():
|
|
393 |
preprocess = request.form.get('preprocess', 'crop')
|
394 |
print('preprocess selected: ',preprocess)
|
395 |
ref_pose_video = request.files.get('ref_pose', None)
|
|
|
|
|
|
|
396 |
|
397 |
|
398 |
if chat_model_used == 'ryzedb':
|
399 |
-
response = ryzedb_chat_avatar(text_prompt)
|
400 |
events = response.split('\r\n\r\n')
|
401 |
content = None
|
402 |
for event in events:
|
|
|
314 |
)
|
315 |
return response
|
316 |
|
317 |
+
def ryzedb_chat_avatar(question, app_id):
|
318 |
url = "https://inference.dev.ryzeai.ai/chat/stream"
|
319 |
question = question + ". Summarize your answer using the minimum words you can ever use."
|
320 |
payload = json.dumps({
|
321 |
"input": {
|
322 |
"chat_history": [],
|
323 |
+
"app_id": app_id,
|
324 |
"question": question
|
325 |
},
|
326 |
"config": {}
|
|
|
393 |
preprocess = request.form.get('preprocess', 'crop')
|
394 |
print('preprocess selected: ',preprocess)
|
395 |
ref_pose_video = request.files.get('ref_pose', None)
|
396 |
+
app_id = request.form['app_id']
|
397 |
+
if not app_id:
|
398 |
+
return jsonify({'error': 'App ID cannot be blank'}), 400
|
399 |
|
400 |
|
401 |
if chat_model_used == 'ryzedb':
|
402 |
+
response = ryzedb_chat_avatar(text_prompt, app_id)
|
403 |
events = response.split('\r\n\r\n')
|
404 |
content = None
|
405 |
for event in events:
|