KingNish commited on
Commit
d382aa7
1 Parent(s): cbcbb46

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -30,8 +30,8 @@ def models(text, model="Mixtral 8x7B"):
30
  output = ""
31
  for response in stream:
32
  if "Phi" in model:
33
- if not response.token.text == "<|assistant|>":
34
- output += response.token.text
35
  else:
36
  if not response.token.text == "</s>":
37
  output += response.token.text
@@ -40,5 +40,5 @@ def models(text, model="Mixtral 8x7B"):
40
  description="""# Chat GO
41
  ### Inspired from Google Go"""
42
 
43
- demo = gr.Interface(description=description,fn=models, inputs=["text", gr.Dropdown([ 'Mixtral 8x7B','Nous Hermes Mixtral 8x7B DPO','StarChat2 15b','Mistral 7B v0.3','Phi 3 mini', ], value="Mistral 7B v0.3", label="Select Model") ], outputs="text", live=True, batch=True, max_batch_size=1000)
44
  demo.launch()
 
30
  output = ""
31
  for response in stream:
32
  if "Phi" in model:
33
+ if output.endswith("<|assistant|>"):
34
+ output = output(-13)
35
  else:
36
  if not response.token.text == "</s>":
37
  output += response.token.text
 
40
  description="""# Chat GO
41
  ### Inspired from Google Go"""
42
 
43
+ demo = gr.Interface(description=description,fn=models, inputs=["text", gr.Dropdown([ 'Mixtral 8x7B','Nous Hermes Mixtral 8x7B DPO','StarChat2 15b','Mistral 7B v0.3','Phi 3 mini', ], value="Phi 3 mini", label="Select Model") ], outputs="text", live=True, batch=True, max_batch_size=1000)
44
  demo.launch()