Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -92,10 +92,11 @@ def chat_document(file, question):
|
|
| 92 |
Question: {question}
|
| 93 |
Answer:"""
|
| 94 |
|
| 95 |
-
stream = client.text_generation(message, max_new_tokens=
|
| 96 |
output = ""
|
| 97 |
for response in stream:
|
| 98 |
-
|
|
|
|
| 99 |
return output
|
| 100 |
|
| 101 |
|
|
|
|
| 92 |
Question: {question}
|
| 93 |
Answer:"""
|
| 94 |
|
| 95 |
+
stream = client.text_generation(message, max_new_tokens=2048, stream=True, details=True, return_full_text=False)
|
| 96 |
output = ""
|
| 97 |
for response in stream:
|
| 98 |
+
if not response.token.text == "</s>":
|
| 99 |
+
output += response.token.text
|
| 100 |
return output
|
| 101 |
|
| 102 |
|