Spaces:
Sleeping
Sleeping
powerwarez
commited on
Commit
โข
d85d065
1
Parent(s):
671a344
Update app.py
Browse files
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 |
-
|
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()
|
|