ldhldh commited on
Commit
d79f686
โ€ข
1 Parent(s): 3c15e33

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -7,7 +7,7 @@ from aiogoogletrans import Translator
7
 
8
  import requests, os, re, asyncio
9
 
10
- count = 0
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" + str(count) +"๋ฒˆ์งธ ์‘๋‹ต\n" + f"{x}")
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",