Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ from aiogoogletrans import Translator
|
|
8 |
import requests, os, re, asyncio
|
9 |
|
10 |
loop = asyncio.get_event_loop()
|
11 |
-
gradio_client = GrClient(os.environ.get('
|
12 |
translator = Translator()
|
13 |
# Monkey patch
|
14 |
def get_types(cls_set: List[Type], component: str):
|
@@ -56,6 +56,7 @@ def chat(x):
|
|
56 |
result = str(result)
|
57 |
output = result[len(x)-4:]
|
58 |
output = re.sub('νν','γ
γ
', output)
|
|
|
59 |
output = output.split('<|endoftext|>')[0]
|
60 |
output = output.split('\n')[0]
|
61 |
output = re.sub('[=+#/\:@*\"β»γγβ|\\\<\>\(\)\[\]`\'β¦γ\β\β\βΒ·]', ' ', output)
|
@@ -76,7 +77,8 @@ with gr.Blocks() as demo:
|
|
76 |
inputs="text",
|
77 |
outputs="text",
|
78 |
description="chat",
|
79 |
-
examples= [[f"\nfriend: λλ κΏμ΄ λμΌ? \n\n### \nyou: "],[f"\nyou: λλ λ¬΄μ¨ μμ κ°μ₯ μ’μν΄? \nfriend: κΈμ λλ? \n\n### \nyou: "]]
|
|
|
80 |
)
|
81 |
|
82 |
bb = gr.Interface(
|
|
|
8 |
import requests, os, re, asyncio
|
9 |
|
10 |
loop = asyncio.get_event_loop()
|
11 |
+
gradio_client = GrClient(os.environ.get('GrClient_url'))
|
12 |
translator = Translator()
|
13 |
# Monkey patch
|
14 |
def get_types(cls_set: List[Type], component: str):
|
|
|
56 |
result = str(result)
|
57 |
output = result[len(x)-4:]
|
58 |
output = re.sub('νν','γ
γ
', output)
|
59 |
+
output = output.split('λ')[0]
|
60 |
output = output.split('<|endoftext|>')[0]
|
61 |
output = output.split('\n')[0]
|
62 |
output = re.sub('[=+#/\:@*\"β»γγβ|\\\<\>\(\)\[\]`\'β¦γ\β\β\βΒ·]', ' ', output)
|
|
|
77 |
inputs="text",
|
78 |
outputs="text",
|
79 |
description="chat",
|
80 |
+
#examples= [[f"\nfriend: λλ κΏμ΄ λμΌ? \n\n### \nyou: "],[f"\nyou: λλ λ¬΄μ¨ μμ κ°μ₯ μ’μν΄? \nfriend: κΈμ λλ? \n\n### \nyou: "]]
|
81 |
+
examples= [[f"\nHuman: λλ κΏμ΄ λμΌ? \n\n### \nAssistant: "],[f"\nAssistant: λλ λ¬΄μ¨ μμ κ°μ₯ μ’μν΄? \nHuman: κΈμ λλ? \n\n### \nAssistant: "]]
|
82 |
)
|
83 |
|
84 |
bb = gr.Interface(
|