Update app.py
Browse files
app.py
CHANGED
@@ -1,19 +1,30 @@
|
|
1 |
import gradio as gr
|
2 |
-
from generate
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
with gr.Blocks() as demo:
|
9 |
-
gr.Markdown(
|
|
|
10 |
with gr.Row():
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
16 |
|
17 |
-
|
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()
|