KingNish commited on
Commit
6877ba2
1 Parent(s): 8d7d352

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -123,9 +123,9 @@ def respond(message, history):
123
  response = client_gemma.chat_completion(func_caller, max_tokens=200)
124
  response = str(response)
125
  try:
126
- response = response[int(response.find("{")):(int(response.rfind("}"))+1)]
127
  except:
128
- print("A error occured")
129
  response = response.replace("\\n", "")
130
  response = response.replace("\\'", "'")
131
  response = response.replace('\\"', '"')
 
123
  response = client_gemma.chat_completion(func_caller, max_tokens=200)
124
  response = str(response)
125
  try:
126
+ response = response[int(response.find("{")):int(response.rindex("</"))]
127
  except:
128
+ response = response[int(response.find("{")):(int(response.rfind("}"))+1)]
129
  response = response.replace("\\n", "")
130
  response = response.replace("\\'", "'")
131
  response = response.replace('\\"', '"')