Demosthene-OR
commited on
Commit
•
b11246e
1
Parent(s):
3951193
Update main_dl.py
Browse files- main_dl.py +4 -4
main_dl.py
CHANGED
@@ -254,10 +254,10 @@ async def trad_rnn(lang_tgt:str,
|
|
254 |
|
255 |
if (lang_tgt=='en'):
|
256 |
translation_model = rnn_fr_en
|
257 |
-
return
|
258 |
else:
|
259 |
translation_model = rnn_en_fr
|
260 |
-
return
|
261 |
|
262 |
@api.get('/small_vocab/transformer', name="Traduction par Transformer")
|
263 |
async def trad_transformer(lang_tgt:str,
|
@@ -266,10 +266,10 @@ async def trad_transformer(lang_tgt:str,
|
|
266 |
|
267 |
if (lang_tgt=='en'):
|
268 |
translation_model = transformer_fr_en
|
269 |
-
return
|
270 |
else:
|
271 |
translation_model = transformer_en_fr
|
272 |
-
return
|
273 |
|
274 |
@api.get('/small_vocab/plot_model', name="Affiche le modèle")
|
275 |
def affiche_modele(lang_tgt:str,
|
|
|
254 |
|
255 |
if (lang_tgt=='en'):
|
256 |
translation_model = rnn_fr_en
|
257 |
+
return decode_sequence_rnn(texte, "fr", "en")
|
258 |
else:
|
259 |
translation_model = rnn_en_fr
|
260 |
+
return decode_sequence_rnn(texte, "en", "fr")
|
261 |
|
262 |
@api.get('/small_vocab/transformer', name="Traduction par Transformer")
|
263 |
async def trad_transformer(lang_tgt:str,
|
|
|
266 |
|
267 |
if (lang_tgt=='en'):
|
268 |
translation_model = transformer_fr_en
|
269 |
+
return decode_sequence_tranf(texte, "fr", "en")
|
270 |
else:
|
271 |
translation_model = transformer_en_fr
|
272 |
+
return decode_sequence_tranf(texte, "en", "fr")
|
273 |
|
274 |
@api.get('/small_vocab/plot_model', name="Affiche le modèle")
|
275 |
def affiche_modele(lang_tgt:str,
|