Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ from aiogoogletrans import Translator
|
|
7 |
|
8 |
import requests, os, re, asyncio
|
9 |
|
10 |
-
|
11 |
loop = asyncio.get_event_loop()
|
12 |
gradio_client = GrClient(os.environ.get('GrClient_url'))
|
13 |
translator = Translator()
|
@@ -46,8 +46,7 @@ def mbti(x):
|
|
46 |
def chat(x):
|
47 |
x = f"[***๋๋ Assistant์
๋๋ค. ์๋์๊ฒ ๋ค์ํ ์ง๋ฌธ์ ํ๋ฉฐ ๋ํ๋ฅผ ์ด๋๊ณ ์์ต๋๋ค. Human์๊ฒ ๊ธ์ ์ ์ด๊ณ , ๊ณต๊ฐํ๋ฉฐ, ์ต๋ํ ๊ธธ๊ฒ ๋๋ตํด์ฃผ์ธ์***] {x}"
|
48 |
x = x.replace('friend','Human').replace('you','Assistant')
|
49 |
-
print("\n" +
|
50 |
-
count+=1
|
51 |
result = gradio_client.predict(
|
52 |
x,
|
53 |
# str representing input in 'User input' Textbox component
|
@@ -76,6 +75,7 @@ def yn(x):
|
|
76 |
return result
|
77 |
|
78 |
with gr.Blocks() as demo:
|
|
|
79 |
aa = gr.Interface(
|
80 |
fn=chat,
|
81 |
inputs="text",
|
|
|
7 |
|
8 |
import requests, os, re, asyncio
|
9 |
|
10 |
+
|
11 |
loop = asyncio.get_event_loop()
|
12 |
gradio_client = GrClient(os.environ.get('GrClient_url'))
|
13 |
translator = Translator()
|
|
|
46 |
def chat(x):
|
47 |
x = f"[***๋๋ Assistant์
๋๋ค. ์๋์๊ฒ ๋ค์ํ ์ง๋ฌธ์ ํ๋ฉฐ ๋ํ๋ฅผ ์ด๋๊ณ ์์ต๋๋ค. Human์๊ฒ ๊ธ์ ์ ์ด๊ณ , ๊ณต๊ฐํ๋ฉฐ, ์ต๋ํ ๊ธธ๊ฒ ๋๋ตํด์ฃผ์ธ์***] {x}"
|
48 |
x = x.replace('friend','Human').replace('you','Assistant')
|
49 |
+
print("\n" + f"{x}")
|
|
|
50 |
result = gradio_client.predict(
|
51 |
x,
|
52 |
# str representing input in 'User input' Textbox component
|
|
|
75 |
return result
|
76 |
|
77 |
with gr.Blocks() as demo:
|
78 |
+
count = 0
|
79 |
aa = gr.Interface(
|
80 |
fn=chat,
|
81 |
inputs="text",
|