Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -28,13 +28,11 @@ def models(text, model="Mixtral 8x7B"):
|
|
28 |
stream = client.text_generation(
|
29 |
formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
|
30 |
output = ""
|
31 |
-
for response in stream:
|
32 |
-
if "Phi" in model:
|
33 |
-
output = output[:-13]
|
34 |
-
yield output
|
35 |
-
|
36 |
if not response.token.text == "</s>":
|
37 |
output += response.token.text
|
|
|
|
|
38 |
return output
|
39 |
|
40 |
description="""# Chat GO
|
|
|
28 |
stream = client.text_generation(
|
29 |
formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
|
30 |
output = ""
|
31 |
+
for response in stream:
|
|
|
|
|
|
|
|
|
32 |
if not response.token.text == "</s>":
|
33 |
output += response.token.text
|
34 |
+
if output.endswith("<end_of_utterance>"):
|
35 |
+
output = output[:-13]
|
36 |
return output
|
37 |
|
38 |
description="""# Chat GO
|