oza75 commited on
Commit
21a09fc
·
1 Parent(s): 930ab49

first commit

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -21,7 +21,8 @@ else:
21
  logger.info("Using CPU for inference.")
22
 
23
  # Load the translation pipeline with the specified model and detected device
24
- model_checkpoint = "oza75/bm-nllb-1.3B"
 
25
  translator = pipeline("translation", model=model_checkpoint, device=device, max_length=512)
26
  logger.info("Translation pipeline initialized successfully.")
27
 
@@ -30,7 +31,7 @@ SOURCE_LANG_OPTIONS = {
30
  "French": "fra_Latn",
31
  "English": "eng_Latn",
32
  "Bambara": "bam_Latn",
33
- "Bambara With Error": "bam_Error"
34
  }
35
 
36
  TARGET_LANG_OPTIONS = {
@@ -93,6 +94,7 @@ def build_interface():
93
  "any issues, please check your inputs."
94
  ),
95
  examples=[
 
96
  ["Thomas Sankara, né le 21 décembre 1949 à Yako (Haute-Volta) et mort assassiné le 15 octobre 1987 à Ouagadougou (Burkina Faso), est un homme d'État voltaïque, chef de l’État de la république de 'Haute-Volta', rebaptisée Burkina Faso, de 1983 à 1987.", "French", "Bambara"],
97
  ["Good morning", "English", "Bambara"],
98
  ["- Ɔridinatɛri ye minɛn ye min bɛ se ka porogaramu - A bɛ se ka kunnafoniw mara - A bɛ se ka kunnafoniw sɔrɔ - A bɛ se ka kunnafoniw baara", "Bambara", "French"],
 
21
  logger.info("Using CPU for inference.")
22
 
23
  # Load the translation pipeline with the specified model and detected device
24
+ # model_checkpoint = "oza75/bm-nllb-1.3B"
25
+ model_checkpoint = "oza75/nllb-600M-mt-french-bambara"
26
  translator = pipeline("translation", model=model_checkpoint, device=device, max_length=512)
27
  logger.info("Translation pipeline initialized successfully.")
28
 
 
31
  "French": "fra_Latn",
32
  "English": "eng_Latn",
33
  "Bambara": "bam_Latn",
34
+ # "Bambara With Error": "bam_Error"
35
  }
36
 
37
  TARGET_LANG_OPTIONS = {
 
94
  "any issues, please check your inputs."
95
  ),
96
  examples=[
97
+ ["Le Burkina Faso, « patrie des (personnes) intègres » ou « patrie de l'intégrité », anciennement république de Haute-Volta, est un pays d'Afrique de l'Ouest. Sans accès à la mer, il est entouré de six pays : le Niger à l'est-nord-est, le Bénin à l'est-sud-est, le Togo au sud-est, le Ghana au sud, la Côte d'Ivoire au sud-ouest et le Mali au nord-ouest.", "French", "Bambara"],
98
  ["Thomas Sankara, né le 21 décembre 1949 à Yako (Haute-Volta) et mort assassiné le 15 octobre 1987 à Ouagadougou (Burkina Faso), est un homme d'État voltaïque, chef de l’État de la république de 'Haute-Volta', rebaptisée Burkina Faso, de 1983 à 1987.", "French", "Bambara"],
99
  ["Good morning", "English", "Bambara"],
100
  ["- Ɔridinatɛri ye minɛn ye min bɛ se ka porogaramu - A bɛ se ka kunnafoniw mara - A bɛ se ka kunnafoniw sɔrɔ - A bɛ se ka kunnafoniw baara", "Bambara", "French"],