hash-map commited on
Commit
7409ee4
·
verified ·
1 Parent(s): 2c9a851

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -3,8 +3,8 @@ from rag import respond_rag_huggingface as response_hf
3
 
4
  history = []
5
 
6
- def respond(message, chat_history, temperature=0.5, max_tokens=512 ):
7
- response = response_hf(message, temperature=temperature,num_predict=max_tokens)
8
  chat_history.append((message, response))
9
  return "", chat_history
10
 
@@ -12,13 +12,12 @@ with gr.Blocks() as demo:
12
  gr.Markdown("# Game of Thrones Q&A bot")
13
 
14
  chatbot = gr.Chatbot()
15
- msg = gr.Textbox(label="Tell me something about 7 kingdoms")
16
 
17
- temp = gr.Slider(0.0, 1.0, value=0.5, label="Temperature")
18
- max_tokens = gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens")
19
 
20
  clear = gr.Button("Clear")
21
 
22
- msg.submit(respond, [msg, chatbot, temp, max_tokens], [msg, chatbot])
23
  clear.click(lambda: ([], ""), None, [chatbot, msg])
24
  demo.launch()
 
3
 
4
  history = []
5
 
6
+ def respond(message):
7
+ response = response_hf(message)
8
  chat_history.append((message, response))
9
  return "", chat_history
10
 
 
12
  gr.Markdown("# Game of Thrones Q&A bot")
13
 
14
  chatbot = gr.Chatbot()
15
+ msg = gr.Textbox(label="write something about game of thrones here...")
16
 
17
+
 
18
 
19
  clear = gr.Button("Clear")
20
 
21
+ msg.submit(respond, [msg], [msg, chatbot])
22
  clear.click(lambda: ([], ""), None, [chatbot, msg])
23
  demo.launch()