powerwarez commited on
Commit
d85d065
โ€ข
1 Parent(s): 671a344

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -8
app.py CHANGED
@@ -1,13 +1,15 @@
 
1
  import gradio as gr
2
  from api_fn import request_hyper
3
 
 
 
 
 
 
 
 
4
 
5
- with gr.Blocks() as bloom:
6
- gr.Markdown("# ๋ธ”๋ฃธ์˜ ์งˆ๋ฌธ ๋ถ„๋ฅ˜")
7
- input_text = gr.Textbox(label="์งˆ๋ฌธ ์ž…๋ ฅ", placeholder="์งˆ๋ฌธ์„ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”. ๋ธ”๋ฃธ์˜ ์งˆ๋ฌธ ๋ถ„๋ฅ˜์— ๋”ฐ๋ผ AI๊ฐ€ ์ž…๋ ฅ๋œ ์งˆ๋ฌธ์˜ ์ˆ˜์ค€์„ ๋ถ„์„ํ•ด์ค๋‹ˆ๋‹ค.")
8
- send_btn = gr.Button("๋‹ต๋ณ€ ๋ณด๋‚ด๊ธฐ")
9
- ai_textbox = gr.Textbox(label="AI์˜ ๋ถ„์„")
10
 
11
- send_btn.click(request_hyper, inputs=input_text, outputs=ai_textbox)
12
-
13
- bloom.launch()
 
1
+ import time
2
  import gradio as gr
3
  from api_fn import request_hyper
4
 
5
+ def echo(message, history):
6
+ result = request_hyper(message)
7
+ msg_text = ""
8
+ for msg in result:
9
+ msg_text += msg
10
+ yield "AI : " + msg_text
11
+ time.sleep(0.1)
12
 
 
 
 
 
 
13
 
14
+ demo = gr.ChatInterface(echo).queue()
15
+ demo.launch()