dqnguyen commited on
Commit
0e10a46
1 Parent(s): 543657e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -51,8 +51,8 @@ dict_map = {
51
  "ỤY": "UỴ",
52
  }
53
 
54
- tokenizer_vi2en = AutoTokenizer.from_pretrained("vinai/vinai-translate-vi2en", src_lang="vi_VN")
55
- model_vi2en = AutoModelForSeq2SeqLM.from_pretrained("vinai/vinai-translate-vi2en")
56
 
57
  def translate_vi2en(vi_text: str) -> str:
58
  for i, j in dict_map.items():
@@ -74,8 +74,8 @@ def translate_vi2en(vi_text: str) -> str:
74
  en_text = " ".join(en_text)
75
  return en_text
76
 
77
- tokenizer_en2vi = AutoTokenizer.from_pretrained("vinai/vinai-translate-en2vi", src_lang="en_XX")
78
- model_en2vi = AutoModelForSeq2SeqLM.from_pretrained("vinai/vinai-translate-en2vi")
79
 
80
  def translate_en2vi(en_text: str) -> str:
81
  input_ids = tokenizer_en2vi(en_text, return_tensors="pt").input_ids
 
51
  "ỤY": "UỴ",
52
  }
53
 
54
+ tokenizer_vi2en = AutoTokenizer.from_pretrained("vinai/vinai-translate-vi2en-v2", src_lang="vi_VN")
55
+ model_vi2en = AutoModelForSeq2SeqLM.from_pretrained("vinai/vinai-translate-vi2en-v2")
56
 
57
  def translate_vi2en(vi_text: str) -> str:
58
  for i, j in dict_map.items():
 
74
  en_text = " ".join(en_text)
75
  return en_text
76
 
77
+ tokenizer_en2vi = AutoTokenizer.from_pretrained("vinai/vinai-translate-en2vi-v2", src_lang="en_XX")
78
+ model_en2vi = AutoModelForSeq2SeqLM.from_pretrained("vinai/vinai-translate-en2vi-v2")
79
 
80
  def translate_en2vi(en_text: str) -> str:
81
  input_ids = tokenizer_en2vi(en_text, return_tensors="pt").input_ids