Spaces:
Sleeping
Sleeping
Hazzzardous
commited on
Commit
•
588129f
1
Parent(s):
d903d0d
Update app.py
Browse files
app.py
CHANGED
@@ -12,16 +12,15 @@ import gradio as gr
|
|
12 |
|
13 |
def predict(input, history=None):
|
14 |
model.setState(history)
|
15 |
-
model.loadContext(newctx=f"{input}\n\
|
16 |
-
r = model.forward(number=100,stopStrings=["
|
17 |
rr = [(input,r["output"])]
|
18 |
-
return rr, r["state"]
|
19 |
|
20 |
with gr.Blocks() as demo:
|
21 |
chatbot = gr.Chatbot()
|
22 |
state = model.emptyState
|
23 |
-
|
24 |
-
state = gr.State(state)
|
25 |
with gr.Row():
|
26 |
txt = gr.Textbox(show_label=False, placeholder="Enter text and press enter").style(container=False)
|
27 |
|
|
|
12 |
|
13 |
def predict(input, history=None):
|
14 |
model.setState(history)
|
15 |
+
model.loadContext(newctx=f"Prompt: {input}\n\nExpert Long Detailed Response: ")
|
16 |
+
r = model.forward(number=100,stopStrings=["\n\nPrompt"])
|
17 |
rr = [(input,r["output"])]
|
18 |
+
return [*history[0],*rr], [[*history[0],*rr],r["state"]]
|
19 |
|
20 |
with gr.Blocks() as demo:
|
21 |
chatbot = gr.Chatbot()
|
22 |
state = model.emptyState
|
23 |
+
state = gr.State([[],state])
|
|
|
24 |
with gr.Row():
|
25 |
txt = gr.Textbox(show_label=False, placeholder="Enter text and press enter").style(container=False)
|
26 |
|