Spanicin commited on
Commit
a28766f
·
verified ·
1 Parent(s): 5c89b55

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -289,10 +289,15 @@ def generate_video():
289
  print('preprocess selected: ',preprocess)
290
  ref_pose_video = request.files.get('ref_pose', None)
291
 
292
- response = openai_chat_avatar(text_prompt)
293
- text_prompt = response.choices[0].message.content.strip()
294
- app.config['text_prompt'] = text_prompt
295
- print('Final output text prompt using openai: ',text_prompt)
 
 
 
 
 
296
 
297
  source_image_path = save_uploaded_file(source_image, 'source_image.png',TEMP_DIR)
298
  print(source_image_path)
 
289
  print('preprocess selected: ',preprocess)
290
  ref_pose_video = request.files.get('ref_pose', None)
291
 
292
+ if chat_model_used == 'openai':
293
+ response = openai_chat_avatar(text_prompt)
294
+ text_prompt = response.choices[0].message.content.strip()
295
+ app.config['text_prompt'] = text_prompt
296
+ print('Final output text prompt using openai: ',text_prompt)
297
+
298
+ else:
299
+ app.config['text_prompt'] = text_prompt
300
+ print('Final output text prompt using openai: ',text_prompt)
301
 
302
  source_image_path = save_uploaded_file(source_image, 'source_image.png',TEMP_DIR)
303
  print(source_image_path)