Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -23,13 +23,18 @@ with gr.Blocks() as demo:
|
|
23 |
return "", history + [[user_message, None]]
|
24 |
|
25 |
def bot(history):
|
|
|
26 |
stream = llm(prompt = f"Jesteś AI assystentem. Odpowiadaj po polski. <user>: {history}. <assistant>:", **params)
|
27 |
history[-1][1] = ""
|
|
|
28 |
for character in stream:
|
29 |
history[-1][1] += character
|
|
|
30 |
time.sleep(0.005)
|
31 |
yield history
|
32 |
|
|
|
|
|
33 |
msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
|
34 |
bot, chatbot, chatbot
|
35 |
)
|
|
|
23 |
return "", history + [[user_message, None]]
|
24 |
|
25 |
def bot(history):
|
26 |
+
print(history)
|
27 |
stream = llm(prompt = f"Jesteś AI assystentem. Odpowiadaj po polski. <user>: {history}. <assistant>:", **params)
|
28 |
history[-1][1] = ""
|
29 |
+
answer_save = ""
|
30 |
for character in stream:
|
31 |
history[-1][1] += character
|
32 |
+
answer_save += character
|
33 |
time.sleep(0.005)
|
34 |
yield history
|
35 |
|
36 |
+
print(answer_save)
|
37 |
+
|
38 |
msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
|
39 |
bot, chatbot, chatbot
|
40 |
)
|