Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -116,7 +116,6 @@ def stream_chat(message: str, history: list, model: str, temperature: float, max
|
|
116 |
model=model,
|
117 |
messages=conversation,
|
118 |
keep_alive="60s",
|
119 |
-
stream=True,
|
120 |
options={
|
121 |
'num_predict': max_new_tokens,
|
122 |
'temperature': temperature,
|
@@ -127,10 +126,8 @@ def stream_chat(message: str, history: list, model: str, temperature: float, max
|
|
127 |
},
|
128 |
)
|
129 |
|
130 |
-
terminate()
|
131 |
-
|
132 |
print(response)
|
133 |
-
|
134 |
|
135 |
|
136 |
|
@@ -156,10 +153,8 @@ def main(message: str, history: list, model: str, temperature: float, max_new_to
|
|
156 |
penalty
|
157 |
)
|
158 |
|
159 |
-
|
160 |
-
|
161 |
-
buffer += chunk
|
162 |
-
yield buffer
|
163 |
|
164 |
|
165 |
|
|
|
116 |
model=model,
|
117 |
messages=conversation,
|
118 |
keep_alive="60s",
|
|
|
119 |
options={
|
120 |
'num_predict': max_new_tokens,
|
121 |
'temperature': temperature,
|
|
|
126 |
},
|
127 |
)
|
128 |
|
|
|
|
|
129 |
print(response)
|
130 |
+
return response['message']['content']
|
131 |
|
132 |
|
133 |
|
|
|
153 |
penalty
|
154 |
)
|
155 |
|
156 |
+
terminate()
|
157 |
+
yield response
|
|
|
|
|
158 |
|
159 |
|
160 |
|