Add application file
Browse files
app.py
CHANGED
@@ -7,9 +7,9 @@ translator = pipeline("translation", model=os.path.join(os.getcwd(),"test-ml-tra
|
|
7 |
def en2zh(EnNames):
|
8 |
pres=[]
|
9 |
for name in EnNames:
|
10 |
-
pre = translator(name.replace('_',' '), )[0]["translation_text"]
|
11 |
pres.append(pre)
|
12 |
-
|
13 |
return pres
|
14 |
|
15 |
interface = gr.Interface(fn=en2zh, inputs="list", outputs="label")
|
|
|
7 |
def en2zh(EnNames):
|
8 |
pres=[]
|
9 |
for name in EnNames:
|
10 |
+
pre = translator(str(name).replace('_',' '), )[0]["translation_text"]
|
11 |
pres.append(pre)
|
12 |
+
print(name,pre)
|
13 |
return pres
|
14 |
|
15 |
interface = gr.Interface(fn=en2zh, inputs="list", outputs="label")
|