Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -301,9 +301,9 @@ def generate_video():
|
|
301 |
text_prompt = request.form['text_prompt']
|
302 |
|
303 |
print('Input text prompt: ',text_prompt)
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
|
308 |
voice_cloning = request.form.get('voice_cloning', 'no')
|
309 |
target_language = request.form.get('target_language', 'original_text')
|
@@ -324,8 +324,8 @@ def generate_video():
|
|
324 |
# # response = await translate_text_async(text_prompt, target_language)
|
325 |
# text_prompt = response.choices[0].message.content.strip()
|
326 |
|
327 |
-
|
328 |
-
|
329 |
app.config['text_prompt'] = text_prompt
|
330 |
print('Final text prompt: ',text_prompt)
|
331 |
|
|
|
301 |
text_prompt = request.form['text_prompt']
|
302 |
|
303 |
print('Input text prompt: ',text_prompt)
|
304 |
+
text_prompt = text_prompt.strip()
|
305 |
+
if not text_prompt:
|
306 |
+
return jsonify({'error': 'Input text prompt cannot be blank'}), 400
|
307 |
|
308 |
voice_cloning = request.form.get('voice_cloning', 'no')
|
309 |
target_language = request.form.get('target_language', 'original_text')
|
|
|
324 |
# # response = await translate_text_async(text_prompt, target_language)
|
325 |
# text_prompt = response.choices[0].message.content.strip()
|
326 |
|
327 |
+
response = chat_avatar(text_prompt)
|
328 |
+
text_prompt = response.choices[0].message.content.strip()
|
329 |
app.config['text_prompt'] = text_prompt
|
330 |
print('Final text prompt: ',text_prompt)
|
331 |
|