KWK25 commited on
Commit
e556e2e
·
verified ·
1 Parent(s): e6b3eea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -11
app.py CHANGED
@@ -1,11 +1,29 @@
1
- import html
2
- <html>
3
- <body style="background-color:#e9658d; margin:0; display:flex; justify-content:center; align-items:center; height:100vh;">
4
- <div></div>
5
- <iframe
6
- src="https://kwk2025-kpop-song-hunters.hf.space"
7
- frameborder="0"
8
- width="1500"
9
- height="900"
10
- ></iframe>
11
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ with gr.Blocks() as demo:
4
+ with gr.Tab("Chat"):
5
+ chatbot = gr.Chatbot()
6
+ msg = gr.Textbox(label="Your message")
7
+ clear = gr.Button("Clear Chat")
8
+
9
+ def respond(message, history):
10
+ history = history + [(message, f"Echo: {message}")]
11
+ return "", history
12
+
13
+ msg.submit(respond, [msg, chatbot], [msg, chatbot])
14
+ clear.click(lambda: None, None, chatbot, queue=False)
15
+
16
+ with gr.Tab("History"):
17
+ history_box = gr.Textbox(label="Conversation History", lines=10)
18
+
19
+ def show_history(chat_history):
20
+ # Convert history to readable text
21
+ return "\n".join([f"User: {u}\nBot: {b}" for u, b in chat_history if u])
22
+
23
+ chatbot.change(show_history, chatbot, history_box)
24
+
25
+ with gr.Tab("Settings"):
26
+ theme_choice = gr.Radio(["Light", "Dark"], label="Theme")
27
+ lang_choice = gr.Dropdown(["English", "Spanish", "French"], label="Language")
28
+
29
+ demo.launch()