Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,7 +26,7 @@ def terminate():
|
|
| 26 |
OLLAMA_SERVICE_THREAD.join()
|
| 27 |
process = None
|
| 28 |
OLLAMA_SERVICE_THREAD = None
|
| 29 |
-
|
| 30 |
|
| 31 |
# Uncomment and modify the model to what you want locally
|
| 32 |
# model = "moondream"
|
|
@@ -145,7 +145,7 @@ def main(message: str, history: list, model: str, temperature: float, max_new_to
|
|
| 145 |
else:
|
| 146 |
if not process:
|
| 147 |
launch()
|
| 148 |
-
|
| 149 |
message,
|
| 150 |
history,
|
| 151 |
model,
|
|
@@ -155,7 +155,6 @@ def main(message: str, history: list, model: str, temperature: float, max_new_to
|
|
| 155 |
top_k,
|
| 156 |
penalty
|
| 157 |
)
|
| 158 |
-
yield answer
|
| 159 |
|
| 160 |
|
| 161 |
chatbot = gr.Chatbot(height=600, placeholder=DESCRIPTION)
|
|
|
|
| 26 |
OLLAMA_SERVICE_THREAD.join()
|
| 27 |
process = None
|
| 28 |
OLLAMA_SERVICE_THREAD = None
|
| 29 |
+
print("Ollama service stopped.")
|
| 30 |
|
| 31 |
# Uncomment and modify the model to what you want locally
|
| 32 |
# model = "moondream"
|
|
|
|
| 145 |
else:
|
| 146 |
if not process:
|
| 147 |
launch()
|
| 148 |
+
stream_chat(
|
| 149 |
message,
|
| 150 |
history,
|
| 151 |
model,
|
|
|
|
| 155 |
top_k,
|
| 156 |
penalty
|
| 157 |
)
|
|
|
|
| 158 |
|
| 159 |
|
| 160 |
chatbot = gr.Chatbot(height=600, placeholder=DESCRIPTION)
|