vilarin commited on
Commit
f01a45c
1 Parent(s): 29c0142

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -68,13 +68,18 @@ def stream_chat(message: str, history: list, temperature: float, context_window:
68
  response = client.chat(
69
  model="gemma2",
70
  messages=conversation,
71
- stream=True
 
 
 
 
 
72
  )
73
 
74
- message = ""
75
  for chunk in response:
76
- message += chunk["message"]["content"]
77
- yield "", message
78
 
79
 
80
 
 
68
  response = client.chat(
69
  model="gemma2",
70
  messages=conversation,
71
+ stream=True,
72
+ temperature=temperature,
73
+ top_k=top_k,
74
+ top_p=top_p,
75
+ num_ctx=context_window,
76
+ repeat_penalty=penalty,
77
  )
78
 
79
+ buffer = ""
80
  for chunk in response:
81
+ buffer += chunk["message"]["content"]
82
+ yield buffer
83
 
84
 
85