Spanicin commited on
Commit
d5f5c5c
·
verified ·
1 Parent(s): 054cada

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
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": "6f1966fc77894dde8ce361f4714d1a1b",
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: