mbarnig commited on
Commit
f57d6cb
1 Parent(s): 135bc5c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -3,10 +3,10 @@ import torch
3
  from huggingface_hub import hf_hub_download
4
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
5
 
6
- translator_nllb = pipeline("translation", model="facebook/nllb-200-distilled-600M")
7
- # translator_marion_en = pipeline("translation", model="mbarnig/MarianNMT-tatoeba-en-lb")
8
- translator_marion_lb = pipeline("translation", model="mbarnig/MarianNMT-tatoeba-lb-en")
9
- translate_t5_mt5 = pipeline("translation", model="mbarnig/T5-mt5-tatoeba-en-lb")
10
 
11
  my_title = "🇬🇧 Mir iwwersetzen vun an op Lëtzebuergesch ! 🇫🇷"
12
  my_description = "English-Luxembourgish machine translation (MT) demo based on 3 open-source transformer models: Facebook-NLLB, Microsoft-MarianNMT & Google-T5/mt5."
@@ -36,7 +36,8 @@ my_output = gr.Textbox(lines=5, label="Translation")
36
 
37
  def iwwersetz(source_text, model, direc):
38
  if model == "NLLB":
39
- if direc == "en -> lb":
 
40
  # translation = translator("en", "lb", source_text)
41
  translation = source_text
42
  else:
 
3
  from huggingface_hub import hf_hub_download
4
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
5
 
6
+ model_checkpoint_nllb = "facebook/nllb-200-distilled-600M"
7
+ model_checkpoint_marion_en = "mbarnig/MarianNMT-tatoeba-en-lb"
8
+ model_checkpoint_marion_lb = "mbarnig/MarianNMT-tatoeba-lb-en"
9
+ model_checkpoint_t5_mt5 = "mbarnig/T5-mt5-tatoeba-en-lb"
10
 
11
  my_title = "🇬🇧 Mir iwwersetzen vun an op Lëtzebuergesch ! 🇫🇷"
12
  my_description = "English-Luxembourgish machine translation (MT) demo based on 3 open-source transformer models: Facebook-NLLB, Microsoft-MarianNMT & Google-T5/mt5."
 
36
 
37
  def iwwersetz(source_text, model, direc):
38
  if model == "NLLB":
39
+ translator = pipeline("translation", model=model_checkpoint)
40
+ if direc == "en -> lb":
41
  # translation = translator("en", "lb", source_text)
42
  translation = source_text
43
  else: