YchKhan commited on
Commit
4897612
1 Parent(s): a525c7d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -8
app.py CHANGED
@@ -430,17 +430,12 @@ def gpt_answer(api_key, query, model="gpt-3.5-turbo-1106", system_prompt="Use th
430
  return chat_completion.choices[0].message.content
431
 
432
 
433
- def add_line_breaks(input_string, line_length=60):
434
  lines = []
435
-
436
  for i in range(0, len(input_string), line_length):
437
  line = input_string[i:i+line_length]
438
- if '\n' not in line:
439
- lines.append(line)
440
- else:
441
- lines.append(line.split('\n', 1)[0])
442
- lines.append('')
443
-
444
  return '\n'.join(lines)
445
 
446
  def ask_df(df, api_key, model, ui_session_id):
 
430
  return chat_completion.choices[0].message.content
431
 
432
 
433
+ def add_line_breaks(input_string, line_length=100):
434
  lines = []
435
+ input_string=input_string.split("\n---\n[Sources]")[0]
436
  for i in range(0, len(input_string), line_length):
437
  line = input_string[i:i+line_length]
438
+ lines.append(line)
 
 
 
 
 
439
  return '\n'.join(lines)
440
 
441
  def ask_df(df, api_key, model, ui_session_id):