Spaces:
Running
Running
Update app.py
Browse files
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
|
34 |
-
output
|
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="
|
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()
|