5m4ck3r commited on
Commit
7386373
·
verified ·
1 Parent(s): 25b55c8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -15
app.py CHANGED
@@ -353,20 +353,20 @@ with gr.Blocks() as demo:
353
  generate_qna_button.click(search_question, inputs=text_input_qna, outputs=text_output_qna)
354
 
355
  with gr.Tab("Chat"):
356
- gr.Markdown("# Chat Section")
357
- chat_display = gr.Chatbot(label="Chat", type="messages")
358
- with gr.Row():
359
- with gr.Column(scale=1):
360
- chat_box = gr.Textbox(
361
- label="Type your message here...",
362
- placeholder="Start typing...",
363
- interactive=True,
364
- )
365
- with gr.Column(scale=1):
366
- system_message = gr.Textbox(value="You are a friendly Chatbot.", label="System message")
367
- max_tokens = gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens")
368
- temperature = gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature")
369
- top_p = gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-p (nucleus sampling)")
370
- chat_box.submit(respond, inputs=[chat_box, system_message, max_tokens, temperature, top_p])#, outputs=[chat_display, chat_box])
371
 
372
  demo.launch()
 
353
  generate_qna_button.click(search_question, inputs=text_input_qna, outputs=text_output_qna)
354
 
355
  with gr.Tab("Chat"):
356
+ demo = gr.ChatInterface(
357
+ respond,
358
+ additional_inputs=[
359
+ gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
360
+ gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
361
+ gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
362
+ gr.Slider(
363
+ minimum=0.1,
364
+ maximum=1.0,
365
+ value=0.95,
366
+ step=0.05,
367
+ label="Top-p (nucleus sampling)",
368
+ ),
369
+ ],
370
+ )
371
 
372
  demo.launch()