Update app.py
Browse files
app.py
CHANGED
@@ -350,18 +350,17 @@ def generate_video():
|
|
350 |
|
351 |
if chat_model_used == 'ryzedb':
|
352 |
start_time_ryze = time.time()
|
353 |
-
start_time_ryze = time.time()
|
354 |
-
response = ryzedb_chat_avatar(text_prompt, app_id)
|
355 |
text_prompt = ryzedb_chat_avatar(text_prompt, app_id)
|
356 |
print("Response from inference",text_prompt)
|
357 |
-
text_prompt = extract_content(response)
|
358 |
# text_prompt = extract_content(response)
|
359 |
-
text_prompt = text_prompt.replace('\n', ' ').replace('\\n', ' ').strip()
|
360 |
# text_prompt = text_prompt.replace('\n', ' ').replace('\\n', ' ').strip()
|
361 |
-
if "No information available" in text_prompt:
|
362 |
if "No information available" in text_prompt:
|
363 |
text_prompt = re.sub(r'\\+', '', text_prompt)
|
364 |
-
|
|
|
|
|
|
|
|
|
365 |
|
366 |
# events = response.split('\r\n\r\n')
|
367 |
# content = None
|
|
|
350 |
|
351 |
if chat_model_used == 'ryzedb':
|
352 |
start_time_ryze = time.time()
|
|
|
|
|
353 |
text_prompt = ryzedb_chat_avatar(text_prompt, app_id)
|
354 |
print("Response from inference",text_prompt)
|
|
|
355 |
# text_prompt = extract_content(response)
|
|
|
356 |
# text_prompt = text_prompt.replace('\n', ' ').replace('\\n', ' ').strip()
|
|
|
357 |
if "No information available" in text_prompt:
|
358 |
text_prompt = re.sub(r'\\+', '', text_prompt)
|
359 |
+
|
360 |
+
response = openai_chat_avatar(text_prompt)
|
361 |
+
text_prompt = response.choices[0].message.content.strip()
|
362 |
+
app.config['text_prompt'] = text_prompt
|
363 |
+
print('Final output text prompt using ryzedb: ',text_prompt)
|
364 |
|
365 |
# events = response.split('\r\n\r\n')
|
366 |
# content = None
|