Nexchan commited on
Commit
ed4f022
·
verified ·
1 Parent(s): 59cf2b9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -12
app.py CHANGED
@@ -58,18 +58,15 @@ def api_chat(chat_history: List[Dict[str, str]]):
58
 
59
  # Mengatur antarmuka Gradio
60
  with gr.Blocks() as demo:
61
- with gr.Row():
62
- with gr.Column():
63
- chatbot = gr.Chatbot()
64
- msg = gr.Textbox(interactive=True)
65
- with gr.Row():
66
- clear = gr.ClearButton([msg, chatbot])
67
- send_btn = gr.Button("Send", variant='primary')
68
- msg.submit(fn=chat_mem, inputs=[msg, chatbot], outputs=[msg, chatbot])
69
- send_btn.click(fn=chat_mem, inputs=[msg, chatbot], outputs=[msg, chatbot])
70
-
71
- # Menambahkan endpoint API untuk api_chat
72
- demo.add_api_route("/api/chat", api_chat, methods=["POST"])
73
 
74
 
75
  if __name__ == "__main__":
 
58
 
59
  # Mengatur antarmuka Gradio
60
  with gr.Blocks() as demo:
61
+ with gr.Row():
62
+ with gr.Column():
63
+ chatbot = gr.Chatbot()
64
+ msg = gr.Textbox(interactive=True, )
65
+ with gr.Row():
66
+ clear = gr.ClearButton([msg, chatbot], icon="https://img.icons8.com/?size=100&id=Xnx8cxDef16O&format=png&color=000000")
67
+ send_btn = gr.Button("Send", variant='primary', icon="https://img.icons8.com/?size=100&id=g8ltXTwIfJ1n&format=png&color=000000")
68
+ msg.submit(fn=chat_mem, inputs=[msg, chatbot], outputs=[msg, chatbot])
69
+ send_btn.click(fn=chat_mem, inputs=[msg, chatbot], outputs=[msg, chatbot])
 
 
 
70
 
71
 
72
  if __name__ == "__main__":