HemanM commited on
Commit
1cb13b6
·
verified ·
1 Parent(s): b28676e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -11
app.py CHANGED
@@ -1,19 +1,30 @@
1
  import gradio as gr
2
- from generate.py import generate_response
3
 
4
- def chat_with_evo(user_input):
5
- response = generate_response(user_input)
6
- return response
 
 
 
 
 
 
7
 
8
  with gr.Blocks() as demo:
9
- gr.Markdown("## 🤖 EvoDecoder Chatbot (Lightweight Conversational AI)")
 
10
  with gr.Row():
11
- with gr.Column(scale=4):
12
- user_input = gr.Textbox(label="Ask Evo anything...", placeholder="Type your question here...")
13
- submit_btn = gr.Button("Submit")
14
- with gr.Column(scale=6):
15
- response_output = gr.Textbox(label="Evo's Response")
 
 
 
 
16
 
17
- submit_btn.click(fn=chat_with_evo, inputs=user_input, outputs=response_output)
18
 
19
  demo.launch()
 
1
  import gradio as gr
2
+ from generate import generate_response
3
 
4
+ description = """
5
+ ### 🤖 EvoDecoder Chatbot
6
+ Powered by a lightweight, GPT-style evolved Transformer (EvoDecoder) trained from scratch.
7
+
8
+ - Trained on dialogue data
9
+ - Uses 6 decoder blocks (512-dim, 8 heads)
10
+ - Fine-tuned to respond to real prompts
11
+
12
+ """
13
 
14
  with gr.Blocks() as demo:
15
+ gr.Markdown(description)
16
+ chatbot = gr.Chatbot(height=400)
17
  with gr.Row():
18
+ user_input = gr.Textbox(placeholder="Type a message...", scale=4)
19
+ send_btn = gr.Button("Send", scale=1)
20
+
21
+ history = []
22
+
23
+ def respond(message):
24
+ response = generate_response(message)
25
+ history.append((message, response))
26
+ return history, ""
27
 
28
+ send_btn.click(fn=respond, inputs=user_input, outputs=[chatbot, user_input])
29
 
30
  demo.launch()