Spaces:
Runtime error
Runtime error
JunchuanYu
commited on
Commit
•
3e33805
1
Parent(s):
68c3660
Update app.py
Browse files
app.py
CHANGED
@@ -14,9 +14,9 @@ def extract_str(text):
|
|
14 |
return text[start+2:end]
|
15 |
|
16 |
def gramacorrect(sentence):
|
17 |
-
gf = Gramformer(models=1, use_gpu=
|
18 |
-
res = gf.correct(sentence)
|
19 |
-
return extract_str(res)
|
20 |
|
21 |
def translate_zh(from_text):
|
22 |
translation_pipeline = pipeline("translation", model="Helsinki-NLP/opus-mt-en-zh")
|
|
|
14 |
return text[start+2:end]
|
15 |
|
16 |
def gramacorrect(sentence):
|
17 |
+
gf = Gramformer(models=1, use_gpu=False)
|
18 |
+
res = gf.correct(sentence)
|
19 |
+
return extract_str(res)
|
20 |
|
21 |
def translate_zh(from_text):
|
22 |
translation_pipeline = pipeline("translation", model="Helsinki-NLP/opus-mt-en-zh")
|