Spaces:
Sleeping
Sleeping
ww commited on
Commit ·
d56deb0
1
Parent(s): d62961b
stream
Browse files
app.py
CHANGED
|
@@ -15,8 +15,12 @@ def generate_response(
|
|
| 15 |
temperature,
|
| 16 |
top_p,
|
| 17 |
):
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
|
| 22 |
def respond(
|
|
|
|
| 15 |
temperature,
|
| 16 |
top_p,
|
| 17 |
):
|
| 18 |
+
stream = client.text_generation(message,stream=True, max_new_tokens=256)
|
| 19 |
+
output = ""
|
| 20 |
+
for response in stream:
|
| 21 |
+
output += response.token.text
|
| 22 |
+
yield output
|
| 23 |
+
return output
|
| 24 |
|
| 25 |
|
| 26 |
def respond(
|