mbarnig commited on
Commit
3588a89
β€’
1 Parent(s): 154ea2f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -8
app.py CHANGED
@@ -38,22 +38,24 @@ def iwwersetz(source_text, model, direc):
38
  if model == "NLLB":
39
  translator = pipeline("translation", model=model_checkpoint_nllb)
40
  if direc == "en -> lb":
41
- # translation = translator("en", "lb", source_text)
42
- translation = source_text
43
  else:
44
- # translation = translator("lb", "en", source_text)
45
- translation = source_text
46
  elif model == "MarianNMT":
47
  if direc == "en -> lb":
48
  translator = pipeline("translation", model=model_checkpoint_marian_en)
49
- translation = source_text
 
50
  else:
51
  translator = pipeline("translation", model=model_checkpoint_marian_lb)
52
- translation = source_text
 
53
  elif model == "T5-mt5":
54
  translator = pipeline("translation", model=model_checkpoint_t5-mt5)
55
- translation = source_text
56
- translation = source_text
57
  else:
58
  translation = "Please select a Translation Model !"
59
  return translation
 
38
  if model == "NLLB":
39
  translator = pipeline("translation", model=model_checkpoint_nllb)
40
  if direc == "en -> lb":
41
+ translation = translator("en", "lb", source_text)
42
+ # translation = source_text
43
  else:
44
+ translation = translator("lb", "en", source_text)
45
+ # translation = source_text
46
  elif model == "MarianNMT":
47
  if direc == "en -> lb":
48
  translator = pipeline("translation", model=model_checkpoint_marian_en)
49
+ # translation = source_text
50
+ translation = translator(source_text)
51
  else:
52
  translator = pipeline("translation", model=model_checkpoint_marian_lb)
53
+ # translation = source_text
54
+ translation = translator(source_text)
55
  elif model == "T5-mt5":
56
  translator = pipeline("translation", model=model_checkpoint_t5-mt5)
57
+ # translation = source_text
58
+ translation = translator(source_text)
59
  else:
60
  translation = "Please select a Translation Model !"
61
  return translation