ProximileAdmin commited on
Commit
0eead1b
·
verified ·
1 Parent(s): ee6aa29

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -28
app.py CHANGED
@@ -306,34 +306,27 @@ sampling_params = {
306
  # Initialize LLM
307
  llm = LLM(max_model_len=8096)
308
 
309
- def build_demo():
310
- """Build the Gradio interface."""
311
- with gr.Blocks() as demo:
312
- gr.Markdown(f"<h2>{NAME_OF_SERVICE}</h2>")
313
- chat_state = gr.State([])
314
- chatbot = gr.Chatbot(label="Chat with the arXiv Paper Search Assistant")
315
- user_input = gr.Textbox(
316
- lines=1,
317
- placeholder="Type your message here...",
318
- )
319
-
320
- user_input.submit(
321
- fn=user_conversation,
322
- inputs=[user_input, chatbot, chat_state],
323
- outputs=[user_input, chatbot, chat_state],
324
- queue=False
325
- )
326
-
327
- send_button = gr.Button("Send")
328
- send_button.click(
329
- fn=user_conversation,
330
- inputs=[user_input, chatbot, chat_state],
331
- outputs=[user_input, chatbot, chat_state],
332
- queue=False
333
- )
334
 
335
- return demo
 
 
 
 
 
336
 
337
- if __name__ == "__main__":
338
- demo = build_demo()
 
 
 
 
 
339
  demo.launch()
 
306
  # Initialize LLM
307
  llm = LLM(max_model_len=8096)
308
 
309
+ with gr.Blocks() as demo:
310
+ gr.Markdown(f"<h2>{NAME_OF_SERVICE}</h2>")
311
+ chat_state = gr.State([])
312
+ chatbot = gr.Chatbot(label="Chat with the arXiv Paper Search Assistant")
313
+ user_input = gr.Textbox(
314
+ lines=1,
315
+ placeholder="Type your message here...",
316
+ )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
317
 
318
+ user_input.submit(
319
+ fn=user_conversation,
320
+ inputs=[user_input, chatbot, chat_state],
321
+ outputs=[user_input, chatbot, chat_state],
322
+ queue=False
323
+ )
324
 
325
+ send_button = gr.Button("Send")
326
+ send_button.click(
327
+ fn=user_conversation,
328
+ inputs=[user_input, chatbot, chat_state],
329
+ outputs=[user_input, chatbot, chat_state],
330
+ queue=False
331
+ )
332
  demo.launch()