Hazzzardous commited on
Commit
588129f
1 Parent(s): d903d0d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
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\nBot: ")
16
- r = model.forward(number=100,stopStrings=["User: "])
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
- ctx, state = model.loadContext(newctx="User: ")
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