ldhldh commited on
Commit
27520ac
Β·
1 Parent(s): 97e2ae6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
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('GrClient_url2'))
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(