Spaces:
Sleeping
Sleeping
Commit
·
40f8efa
1
Parent(s):
ae7a4b0
droit pour les fichiers
Browse files
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
|
@@ -2,6 +2,7 @@ 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'):
|
|
@@ -12,6 +13,8 @@ class Translator:
|
|
| 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 |
|
|
|
|
| 2 |
import os
|
| 3 |
import torch
|
| 4 |
import zipfile
|
| 5 |
+
import shutil
|
| 6 |
|
| 7 |
class Translator:
|
| 8 |
def __init__(self, isFon:bool, device='cuda' if torch.cuda.is_available() else 'cpu'):
|
|
|
|
| 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 |
|