Spaces:
Runtime error
Runtime error
yuxj
commited on
Commit
·
87d6d9f
1
Parent(s):
adf1507
添加日志输出
Browse files
app.py
CHANGED
@@ -5,10 +5,10 @@ translator = pipeline("translation", model = "penpen/novel-zh-en", max_time = 7)
|
|
5 |
classifier = pipeline ("text-classification", model = 'bhadresh-savani/bert-base-uncased-emotion', top_k = 1)
|
6 |
|
7 |
def on_click(chines_text):
|
8 |
-
text = translator(chines_text)[0]["translation_text"]
|
9 |
-
result = text, classifier(text)
|
10 |
print('input: ', chines_text)
|
|
|
11 |
print('translate: ', text)
|
|
|
12 |
print('classify: ', result)
|
13 |
print('----------------------------')
|
14 |
return result
|
|
|
5 |
classifier = pipeline ("text-classification", model = 'bhadresh-savani/bert-base-uncased-emotion', top_k = 1)
|
6 |
|
7 |
def on_click(chines_text):
|
|
|
|
|
8 |
print('input: ', chines_text)
|
9 |
+
text = translator(chines_text)[0]["translation_text"]
|
10 |
print('translate: ', text)
|
11 |
+
result = text, classifier(text)
|
12 |
print('classify: ', result)
|
13 |
print('----------------------------')
|
14 |
return result
|