mrcuddle commited on
Commit
6d59193
·
verified ·
1 Parent(s): 34b0985

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -10
app.py CHANGED
@@ -53,16 +53,21 @@ def chatbot(message, history):
53
  return history, ""
54
 
55
  # Create the Gradio interface
56
- iface = gr.Interface(
57
- fn=chatbot,
58
- inputs=["text", "state"],
59
- outputs=["chatbot", "state"],
60
- state=[],
61
- allow_flagging="never",
62
- title="Dark-Hermes3-Llama3.2-3B Chatbot",
63
- description="A chatbot interface powered by the Dark-Hermes3-Llama3.2-3B model. Ask me anything!"
64
- )
 
 
 
 
 
65
 
66
  # Launch the interface
67
  if __name__ == "__main__":
68
- iface.launch()
 
53
  return history, ""
54
 
55
  # Create the Gradio interface
56
+ with gr.Blocks() as demo:
57
+ gr.Markdown("## Dark-Hermes3-Llama3.2-3B Chatbot")
58
+ gr.Markdown("A chatbot interface powered by the Dark-Hermes3-Llama3.2-3B model. Ask me anything!")
59
+
60
+ chatbot_component = gr.Chatbot([], elem_id="chatbot")
61
+ state = gr.State([])
62
+
63
+ with gr.Row():
64
+ txt = gr.Textbox(
65
+ show_label=False,
66
+ placeholder="Type your message here...",
67
+ ).style(container=False)
68
+
69
+ txt.submit(chatbot, [txt, state], [chatbot_component, state])
70
 
71
  # Launch the interface
72
  if __name__ == "__main__":
73
+ demo.launch()