Spaces:
Sleeping
Sleeping
Commit
·
828d66c
1
Parent(s):
aa59070
fixing bin files
Browse files
translations/__pycache__/urls.cpython-310.pyc
CHANGED
Binary files a/translations/__pycache__/urls.cpython-310.pyc and b/translations/__pycache__/urls.cpython-310.pyc differ
|
|
translations/urls.py
CHANGED
@@ -8,6 +8,6 @@ urlpatterns = [
|
|
8 |
# path('UserTranslations/', TranslationListViewSet.as_view(), name="translations"),
|
9 |
# path('TextToDeafSign/', TextToDeafSignViewSet.as_view(), name="text_to_deaf_sign"),
|
10 |
# path('AudioToDeafSign/', AudioToDeafSignViewSet.as_view(), name="audio_to_deaf_sign"),
|
11 |
-
path('
|
12 |
-
path('
|
13 |
]
|
|
|
8 |
# path('UserTranslations/', TranslationListViewSet.as_view(), name="translations"),
|
9 |
# path('TextToDeafSign/', TextToDeafSignViewSet.as_view(), name="text_to_deaf_sign"),
|
10 |
# path('AudioToDeafSign/', AudioToDeafSignViewSet.as_view(), name="audio_to_deaf_sign"),
|
11 |
+
path('FongbeToFrText/', FongbeToFrancaisText.as_view(), name="fongbe_to_french_text"),
|
12 |
+
path('AudioToText/', AudioToText.as_view(), name="audio_to_text")
|
13 |
]
|
utils/__pycache__/utils_function.cpython-310.pyc
CHANGED
Binary files a/utils/__pycache__/utils_function.cpython-310.pyc and b/utils/__pycache__/utils_function.cpython-310.pyc differ
|
|
utils/utils_function.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
from fairseq.models.transformer import TransformerModel
|
2 |
import os
|
3 |
import torch
|
|
|
4 |
|
5 |
class Translator:
|
6 |
def __init__(self, isFon:bool, device='cuda' if torch.cuda.is_available() else 'cpu'):
|
@@ -8,6 +9,15 @@ class Translator:
|
|
8 |
# Charger le modèle pré-entraîné avec Fairseq
|
9 |
inner = "fon_fr" if isFon else "fr_fon"
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
self.model = TransformerModel.from_pretrained(
|
12 |
'./utils/checkpoints/fon_fr',
|
13 |
checkpoint_file='checkpoint_best.pt',
|
|
|
1 |
from fairseq.models.transformer import TransformerModel
|
2 |
import os
|
3 |
import torch
|
4 |
+
import zipfile
|
5 |
|
6 |
class Translator:
|
7 |
def __init__(self, isFon:bool, device='cuda' if torch.cuda.is_available() else 'cpu'):
|
|
|
9 |
# Charger le modèle pré-entraîné avec Fairseq
|
10 |
inner = "fon_fr" if isFon else "fr_fon"
|
11 |
|
12 |
+
if not os.path.exists('utils/data_prepared/'):
|
13 |
+
print("Not existed")
|
14 |
+
|
15 |
+
with zipfile.ZipFile('utils/data_prepared.zip', 'r') as zip_ref:
|
16 |
+
zip_ref.extractall('utils/')
|
17 |
+
|
18 |
+
else:
|
19 |
+
print("Existed")
|
20 |
+
|
21 |
self.model = TransformerModel.from_pretrained(
|
22 |
'./utils/checkpoints/fon_fr',
|
23 |
checkpoint_file='checkpoint_best.pt',
|