Liu Hong Yuan Tom
commited on
Commit
•
fc9a27f
1
Parent(s):
e54f8ed
Update app.py
Browse files
app.py
CHANGED
@@ -186,7 +186,8 @@ def bot(
|
|
186 |
response = model.generate_content(
|
187 |
messages,
|
188 |
stream=True,
|
189 |
-
generation_config=generation_config
|
|
|
190 |
|
191 |
# streaming effect
|
192 |
chatbot[-1][1] = ""
|
@@ -198,8 +199,8 @@ def bot(
|
|
198 |
print(f"chunk.text: {chunk.text}")
|
199 |
|
200 |
try:
|
201 |
-
for i in range(0, len(chunk.text)
|
202 |
-
section = chunk.text[i:i +
|
203 |
chatbot[-1][1] += section
|
204 |
time.sleep(0.01)
|
205 |
yield chatbot
|
|
|
186 |
response = model.generate_content(
|
187 |
messages,
|
188 |
stream=True,
|
189 |
+
generation_config=generation_config
|
190 |
+
)
|
191 |
|
192 |
# streaming effect
|
193 |
chatbot[-1][1] = ""
|
|
|
199 |
print(f"chunk.text: {chunk.text}")
|
200 |
|
201 |
try:
|
202 |
+
for i in range(0, len(chunk.text)):
|
203 |
+
section = chunk.text[i:i + 1]
|
204 |
chatbot[-1][1] += section
|
205 |
time.sleep(0.01)
|
206 |
yield chatbot
|