Spaces:
Sleeping
Sleeping
Hazzzardous
commited on
Commit
·
f27b8ce
1
Parent(s):
b74218d
Update app.py
Browse files
app.py
CHANGED
@@ -14,8 +14,10 @@ def predict(input, history=None):
|
|
14 |
model.setState(history)
|
15 |
model.loadContext(newctx=f"{input}\n\nBot: ")
|
16 |
r = model.forward(number=100,stopStrings=["User: "])
|
|
|
|
|
17 |
|
18 |
-
return
|
19 |
|
20 |
with gr.Blocks() as demo:
|
21 |
chatbot = gr.Chatbot()
|
|
|
14 |
model.setState(history)
|
15 |
model.loadContext(newctx=f"{input}\n\nBot: ")
|
16 |
r = model.forward(number=100,stopStrings=["User: "])
|
17 |
+
rr = r["output"].split("<|endoftext|>")
|
18 |
+
rr = [(rr[i], rr[i+1]) for i in range(0, len(rr)-1, 2)] # convert to tuples of list
|
19 |
|
20 |
+
return rr, r["state"]
|
21 |
|
22 |
with gr.Blocks() as demo:
|
23 |
chatbot = gr.Chatbot()
|