Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ OLLAMA_SERVICE_THREAD.start()
|
|
18 |
|
19 |
print("Giving ollama serve a moment")
|
20 |
time.sleep(10)
|
21 |
-
subprocess.run("~/ollama pull gemma2
|
22 |
|
23 |
|
24 |
import copy
|
@@ -81,7 +81,7 @@ def stream_chat(message: str, history: list, temperature: float, context_window:
|
|
81 |
|
82 |
llm = gemma2()
|
83 |
|
84 |
-
resp = llm.
|
85 |
messages = messages,
|
86 |
chat_history = conversation,
|
87 |
top_p=top_p,
|
@@ -90,9 +90,7 @@ def stream_chat(message: str, history: list, temperature: float, context_window:
|
|
90 |
context_window=context_window,
|
91 |
)
|
92 |
|
93 |
-
|
94 |
-
for r in resp:
|
95 |
-
yield r.delta
|
96 |
|
97 |
|
98 |
chatbot = gr.Chatbot(height=600)
|
|
|
18 |
|
19 |
print("Giving ollama serve a moment")
|
20 |
time.sleep(10)
|
21 |
+
subprocess.run("~/ollama pull gemma2", shell=True)
|
22 |
|
23 |
|
24 |
import copy
|
|
|
81 |
|
82 |
llm = gemma2()
|
83 |
|
84 |
+
resp = llm.chat(
|
85 |
messages = messages,
|
86 |
chat_history = conversation,
|
87 |
top_p=top_p,
|
|
|
90 |
context_window=context_window,
|
91 |
)
|
92 |
|
93 |
+
return resp
|
|
|
|
|
94 |
|
95 |
|
96 |
chatbot = gr.Chatbot(height=600)
|