Spaces:
Sleeping
Sleeping
Commit
·
c2b9868
1
Parent(s):
d29c54a
translate french to fongbe
Browse files- translations/__pycache__/urls.cpython-310.pyc +0 -0
- translations/urls.py +2 -2
- utils/__pycache__/utils_function.cpython-310.pyc +0 -0
- utils/data_prepared.zip +0 -3
- utils/{data_prepared → datas/data_prepared_fon_fr}/dict.fon.txt +0 -0
- utils/{data_prepared → datas/data_prepared_fon_fr}/dict.fr.txt +0 -0
- utils/{data_prepared → datas/data_prepared_fon_fr}/preprocess.log +0 -0
- utils/datas/data_prepared_fr_fon/dict.fon.txt +0 -0
- utils/datas/data_prepared_fr_fon/dict.fr.txt +0 -0
- utils/datas/data_prepared_fr_fon/preprocess.log +14 -0
- utils/utils_function.py +5 -19
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 |
-
|
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('translateTexte/', 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/data_prepared.zip
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:d5ff3aaa11b1d91c77f0278fe853719f6c26d4add6876e1ada409698ee2fab6e
|
3 |
-
size 2529127
|
|
|
|
|
|
|
|
utils/{data_prepared → datas/data_prepared_fon_fr}/dict.fon.txt
RENAMED
File without changes
|
utils/{data_prepared → datas/data_prepared_fon_fr}/dict.fr.txt
RENAMED
File without changes
|
utils/{data_prepared → datas/data_prepared_fon_fr}/preprocess.log
RENAMED
File without changes
|
utils/datas/data_prepared_fr_fon/dict.fon.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
utils/datas/data_prepared_fr_fon/dict.fr.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
utils/datas/data_prepared_fr_fon/preprocess.log
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Namespace(no_progress_bar=False, log_interval=100, log_format=None, log_file=None, aim_repo=None, aim_run_hash=None, tensorboard_logdir=None, wandb_project=None, azureml_logging=False, seed=1, cpu=False, tpu=False, bf16=False, memory_efficient_bf16=False, fp16=False, memory_efficient_fp16=False, fp16_no_flatten_grads=False, fp16_init_scale=128, fp16_scale_window=None, fp16_scale_tolerance=0.0, on_cpu_convert_precision=False, min_loss_scale=0.0001, threshold_loss_scale=None, amp=False, amp_batch_retries=2, amp_init_scale=128, amp_scale_window=None, user_dir=None, empty_cache_freq=0, all_gather_list_size=16384, model_parallel_size=1, quantization_config_path=None, profile=False, reset_logging=False, suppress_crashes=False, use_plasma_view=False, plasma_path='/tmp/plasma', criterion='cross_entropy', tokenizer=None, bpe=None, optimizer=None, lr_scheduler='fixed', scoring='bleu', task='translation', source_lang='fr', target_lang='fon', trainpref='data_prepared/train', validpref='data_prepared/validation', testpref='data_prepared/test', align_suffix=None, destdir='data-bin/frfon.tokenized.fr-fon', thresholdtgt=0, thresholdsrc=0, tgtdict=None, srcdict=None, nwordstgt=-1, nwordssrc=-1, alignfile=None, dataset_impl='mmap', joined_dictionary=False, only_source=False, padding_factor=8, workers=20, dict_only=False)
|
2 |
+
[fr] Dictionary: 16904 types
|
3 |
+
[fr] data_prepared/train.fr: 95161 sents, 562746 tokens, 0.0% replaced (by <unk>)
|
4 |
+
[fr] Dictionary: 16904 types
|
5 |
+
[fr] data_prepared/validation.fr: 20392 sents, 120545 tokens, 0.424% replaced (by <unk>)
|
6 |
+
[fr] Dictionary: 16904 types
|
7 |
+
[fr] data_prepared/test.fr: 20392 sents, 120961 tokens, 0.455% replaced (by <unk>)
|
8 |
+
[fon] Dictionary: 17976 types
|
9 |
+
[fon] data_prepared/train.fon: 95161 sents, 453730 tokens, 0.0% replaced (by <unk>)
|
10 |
+
[fon] Dictionary: 17976 types
|
11 |
+
[fon] data_prepared/validation.fon: 20392 sents, 97120 tokens, 0.901% replaced (by <unk>)
|
12 |
+
[fon] Dictionary: 17976 types
|
13 |
+
[fon] data_prepared/test.fon: 20392 sents, 96750 tokens, 0.943% replaced (by <unk>)
|
14 |
+
Wrote preprocessed data to data-bin/frfon.tokenized.fr-fon
|
utils/utils_function.py
CHANGED
@@ -10,28 +10,14 @@ class Translator:
|
|
10 |
# Charger le modèle pré-entraîné avec Fairseq
|
11 |
inner = "fon_fr" if isFon else "fr_fon"
|
12 |
|
13 |
-
# if not os.path.exists('utils/data_prepared/'):
|
14 |
-
# print("Not existed")
|
15 |
-
|
16 |
-
# shutil.chmod('utils/', 0o777)
|
17 |
-
|
18 |
-
# with zipfile.ZipFile('utils/data_prepared.zip', 'r') as zip_ref:
|
19 |
-
# zip_ref.extractall('utils/')
|
20 |
-
|
21 |
-
# else:
|
22 |
-
# print("Existed")
|
23 |
-
|
24 |
self.model = TransformerModel.from_pretrained(
|
25 |
-
'./utils/checkpoints/
|
26 |
-
checkpoint_file='checkpoint_best.pt',
|
27 |
-
data_name_or_path='utils/
|
28 |
-
source_lang='fon',
|
29 |
-
target_lang='fr'
|
30 |
)
|
31 |
|
32 |
-
print("#########################")
|
33 |
-
print(type(self.model))
|
34 |
-
print("#########################")
|
35 |
# Définir le périphérique sur lequel exécuter le modèle (par défaut sur 'cuda' si disponible)
|
36 |
self.model.to(device)
|
37 |
|
|
|
10 |
# Charger le modèle pré-entraîné avec Fairseq
|
11 |
inner = "fon_fr" if isFon else "fr_fon"
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
self.model = TransformerModel.from_pretrained(
|
14 |
+
f'./utils/checkpoints/{inner}',
|
15 |
+
checkpoint_file = 'checkpoint_best.pt',
|
16 |
+
data_name_or_path = f'utils/datas/data_prepared_{inner}/',
|
17 |
+
source_lang='fon' if isFon else 'fr',
|
18 |
+
target_lang='fr' if isFon else 'fon'
|
19 |
)
|
20 |
|
|
|
|
|
|
|
21 |
# Définir le périphérique sur lequel exécuter le modèle (par défaut sur 'cuda' si disponible)
|
22 |
self.model.to(device)
|
23 |
|