vilarin commited on
Commit
052b81c
1 Parent(s): 81d8d51

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
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:27b", shell=True)
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.stream_chat(
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)