vilarin commited on
Commit
320fa57
·
verified ·
1 Parent(s): 33028cc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -120,7 +120,9 @@ async def stream_chat(message: str, history: list, model: str, temperature: floa
120
  if not process:
121
  launch()
122
  print("Giving ollama serve a moment")
123
- time.sleep(10)
 
 
124
  async for part in await client.chat(
125
  model=model,
126
  stream=True,
@@ -135,8 +137,6 @@ async def stream_chat(message: str, history: list, model: str, temperature: floa
135
  'low_vram': True,
136
  },
137
  ):
138
-
139
- buffer = ""
140
  buffer += part['message']['content']
141
  yield buffer
142
 
 
120
  if not process:
121
  launch()
122
  print("Giving ollama serve a moment")
123
+ time.sleep(10)
124
+
125
+ buffer = ""
126
  async for part in await client.chat(
127
  model=model,
128
  stream=True,
 
137
  'low_vram': True,
138
  },
139
  ):
 
 
140
  buffer += part['message']['content']
141
  yield buffer
142