pablocst commited on
Commit
cadc650
1 Parent(s): 672530f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -26,10 +26,12 @@ choices = os.popen('tesseract --list-langs').read().split('\n')[1:-1]
26
 
27
 
28
  # 翻译模型选择
29
- def model_choice(src='trans_src', trg='trans_trg'):
30
  # https://huggingface.co/Helsinki-NLP/opus-mt-tc-big-pt-en
31
  # https://huggingface.co/Helsinki-NLP/opus-mt-tc-big-en-pt
32
- model_name = f"Helsinki-NLP/opus-mt-tc-big-{src}-{trg}" # 模型名称
 
 
33
 
34
  tokenizer = MarianTokenizer.from_pretrained(model_name) # 分词器
35
  model = MarianMTModel.from_pretrained(model_name) # 模型
@@ -177,6 +179,4 @@ def main():
177
 
178
 
179
  if __name__ == '__main__':
180
- main()
181
-
182
- #unicamp-dl/translation-pt-en-t5
 
26
 
27
 
28
  # 翻译模型选择
29
+ def model_choice(src, trg):
30
  # https://huggingface.co/Helsinki-NLP/opus-mt-tc-big-pt-en
31
  # https://huggingface.co/Helsinki-NLP/opus-mt-tc-big-en-pt
32
+ # https://huggingface.co/unicamp-dl/translation-pt-en-t5
33
+ # https://huggingface.co/unicamp-dl/translation-en-pt-t5
34
+ model_name = f"unicamp-dl/translation-{src}-{trg}-t5" # 模型名称
35
 
36
  tokenizer = MarianTokenizer.from_pretrained(model_name) # 分词器
37
  model = MarianMTModel.from_pretrained(model_name) # 模型
 
179
 
180
 
181
  if __name__ == '__main__':
182
+ main()