ldhldh commited on
Commit
e846f7d
1 Parent(s): 9fa326c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -3,12 +3,12 @@ from gradio_client import Client as GrClient
3
  import inspect
4
  from gradio import routes
5
  from typing import List, Type
6
- from google_trans_new import google_translator
7
 
8
  import requests, os
9
 
10
  gradio_client = GrClient(os.environ.get('GrClient_url'))
11
- translator = google_translator()
12
  # Monkey patch
13
  def get_types(cls_set: List[Type], component: str):
14
  docset = []
@@ -30,7 +30,7 @@ routes.get_types = get_types
30
 
31
  # App code
32
  def mbti(x):
33
- t = translator.translate(x, lang_src='ko', lang_dest='en')
34
  str_trans = re.sub('[-=+,#/\?:^.@*\"※~ㆍ!』‘|\(\)\[\]`\'…》\”\“\’·]', '', t)
35
  result = gradio_client.predict(
36
  str_trans, # str representing input in 'User input' Textbox component
 
3
  import inspect
4
  from gradio import routes
5
  from typing import List, Type
6
+ from googletrans import Translator
7
 
8
  import requests, os
9
 
10
  gradio_client = GrClient(os.environ.get('GrClient_url'))
11
+ translator = Translator()
12
  # Monkey patch
13
  def get_types(cls_set: List[Type], component: str):
14
  docset = []
 
30
 
31
  # App code
32
  def mbti(x):
33
+ t = translator.translate(x, src='ko', dest='en')
34
  str_trans = re.sub('[-=+,#/\?:^.@*\"※~ㆍ!』‘|\(\)\[\]`\'…》\”\“\’·]', '', t)
35
  result = gradio_client.predict(
36
  str_trans, # str representing input in 'User input' Textbox component