JunchuanYu commited on
Commit
3e33805
1 Parent(s): 68c3660

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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=True)
18
- res = gf.correct(sentence) # Gramformer correct
19
- return extract_str(res) # Return first value in res array
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")