Spanicin commited on
Commit
3b13078
·
verified ·
1 Parent(s): 842cb96

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -168,8 +168,7 @@ def openai_chat_avatar(text_prompt):
168
  {"role": "system", "content": "Summarize the following text accurately and concisely. Avoid any hallucination and provide only the key points in a clear, concise manner."},
169
  {"role": "user", "content": f"Please summarize the following paragraph: {text_prompt}"},
170
  ],
171
- max_tokens = 500, # Limit the response to a reasonable length for a summary
172
- temperature=0.3,
173
  )
174
  return response
175
 
@@ -345,7 +344,8 @@ def generate_video():
345
  if "No information available" in text_prompt:
346
  text_prompt = re.sub(r'\\+', '', text_prompt)
347
 
348
- text_prompt = openai_chat_avatar(text_prompt)
 
349
  app.config['text_prompt'] = text_prompt
350
  print('Final output text prompt using ryzedb: ',text_prompt)
351
  # events = response.split('\r\n\r\n')
 
168
  {"role": "system", "content": "Summarize the following text accurately and concisely. Avoid any hallucination and provide only the key points in a clear, concise manner."},
169
  {"role": "user", "content": f"Please summarize the following paragraph: {text_prompt}"},
170
  ],
171
+ max_tokens = len(text_prompt) + 300, # Limit the response to a reasonable length for a summary
 
172
  )
173
  return response
174
 
 
344
  if "No information available" in text_prompt:
345
  text_prompt = re.sub(r'\\+', '', text_prompt)
346
 
347
+ response = openai_chat_avatar(text_prompt)
348
+ text_prompt = response.choices[0].message.content.strip()
349
  app.config['text_prompt'] = text_prompt
350
  print('Final output text prompt using ryzedb: ',text_prompt)
351
  # events = response.split('\r\n\r\n')