Spanicin commited on
Commit
2b9bd47
·
verified ·
1 Parent(s): b8b3af8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -362,18 +362,18 @@ def generate_video():
362
  content = None
363
  for event in events:
364
  # Split each event block by "\r\n" to get the lines
365
- lines = event.split('\r\n')
366
- if len(lines) > 1 and lines[0] == 'event: data':
367
- # Extract the JSON part from the second line and parse it
368
- json_data = lines[1].replace('data: ', '')
369
- try:
370
- data = json.loads(json_data)
371
- text_prompt = data.get('content')
372
- app.config['text_prompt'] = text_prompt
373
- print('Final output text prompt using ryzedb: ',text_prompt)
374
- break # Exit the loop once content is found
375
- except json.JSONDecodeError:
376
- continue
377
 
378
  else:
379
  response = openai_chat_avatar(text_prompt)
 
362
  content = None
363
  for event in events:
364
  # Split each event block by "\r\n" to get the lines
365
+ lines = event.split('\r\n')
366
+ if len(lines) > 1 and lines[0] == 'event: data':
367
+ # Extract the JSON part from the second line and parse it
368
+ json_data = lines[1].replace('data: ', '')
369
+ try:
370
+ data = json.loads(json_data)
371
+ text_prompt = data.get('content')
372
+ app.config['text_prompt'] = text_prompt
373
+ print('Final output text prompt using ryzedb: ',text_prompt)
374
+ break # Exit the loop once content is found
375
+ except json.JSONDecodeError:
376
+ continue
377
 
378
  else:
379
  response = openai_chat_avatar(text_prompt)