fehmikaya commited on
Commit
e29aa4c
·
verified ·
1 Parent(s): bbfa6b5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -64,11 +64,11 @@ def handle_query(query):
64
  try:
65
  data=json.loads(response.content.decode("utf-8"))
66
  result=data[0]['generated_text']
67
- last_comma_index = result.rfind('assistant<|end_header_id|>')
68
 
69
  # If a comma is found, slice the string from the last comma onwards
70
  if last_comma_index != -1:
71
- result = result[last_comma_index + 26:].strip()
72
 
73
  return result
74
  except:
 
64
  try:
65
  data=json.loads(response.content.decode("utf-8"))
66
  result=data[0]['generated_text']
67
+ last_comma_index = result.rfind('|eot_id|>assistant')
68
 
69
  # If a comma is found, slice the string from the last comma onwards
70
  if last_comma_index != -1:
71
+ result = result[last_comma_index + 18:].strip()
72
 
73
  return result
74
  except: