BenBranyon commited on
Commit
1ea2d65
1 Parent(s): bd0065f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -20,6 +20,7 @@ def query(payload):
20
  data = json.loads(response.content.decode("utf-8"))
21
  generated_text = data[0]['generated_text']
22
  cleaned_text = re.sub(r'<|system|>.*?<|assistant|>', '', generated_text, flags=re.DOTALL)
 
23
  return cleaned_text
24
  except:
25
  return response
 
20
  data = json.loads(response.content.decode("utf-8"))
21
  generated_text = data[0]['generated_text']
22
  cleaned_text = re.sub(r'<|system|>.*?<|assistant|>', '', generated_text, flags=re.DOTALL)
23
+ cleaned_text = re.sub(r'\|\|\/s\|user\|\/s\|\|', '', cleaned_text)
24
  return cleaned_text
25
  except:
26
  return response