ldhldh commited on
Commit
a0df09c
Β·
1 Parent(s): 9ea6af9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -3,11 +3,11 @@ 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
  import requests, os
8
 
9
  gradio_client = GrClient(os.environ.get('GrClient_url'))
10
- translator = google_translator()
11
  # Monkey patch
12
  def get_types(cls_set: List[Type], component: str):
13
  docset = []
@@ -29,7 +29,7 @@ routes.get_types = get_types
29
 
30
  # App code
31
  def mbti(x):
32
- t = translator.translate(x, lang_src='ko', lang_tgt='en')
33
  str_trans = re.sub('[-=+,#/\?:^.@*\"β€»~ㆍ!γ€β€˜|\(\)\[\]`\'…》\”\β€œ\’·]', '', t)
34
  result = gradio_client.predict(
35
  x, # 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
  import requests, os
8
 
9
  gradio_client = GrClient(os.environ.get('GrClient_url'))
10
+ translator = Translator()
11
  # Monkey patch
12
  def get_types(cls_set: List[Type], component: str):
13
  docset = []
 
29
 
30
  # App code
31
  def mbti(x):
32
+ t = translator.translate(x, src='ko', dest='en')
33
  str_trans = re.sub('[-=+,#/\?:^.@*\"β€»~ㆍ!γ€β€˜|\(\)\[\]`\'…》\”\β€œ\’·]', '', t)
34
  result = gradio_client.predict(
35
  x, # str representing input in 'User input' Textbox component