zouhairk commited on
Commit
485f9b6
·
1 Parent(s): 3ef50c0

traduction

Browse files
app.py CHANGED
@@ -6,19 +6,27 @@ import os
6
  from huggingface_hub import InferenceClient, login
7
  import logging
8
 
9
- app = Flask(__name__)
 
10
 
11
-
12
 
13
- processor = AutoProcessor.from_pretrained("facebook/seamless-m4t-v2-large" )
14
- model = SeamlessM4Tv2Model.from_pretrained("facebook/seamless-m4t-v2-large")
 
 
15
 
16
- # Charger le processor et le modèle avec affichage des logs
17
  logging.debug("Début du chargement du processor et du modèle...")
18
- processor = AutoProcessor.from_pretrained("facebook/seamless-m4t-v2-large")
19
- logging.debug("Processor chargé avec succès : %s", processor)
20
- model = SeamlessM4Tv2Model.from_pretrained("facebook/seamless-m4t-v2-large")
21
- logging.debug("Modèle chargé avec succès : %s", model)
 
 
 
 
 
22
 
23
  UPLOAD_FOLDER = "audio_files"
24
  os.makedirs(UPLOAD_FOLDER, exist_ok=True)
 
6
  from huggingface_hub import InferenceClient, login
7
  import logging
8
 
9
+ # Configurer les logs de debug
10
+ logging.basicConfig(level=logging.DEBUG)
11
 
12
+ app = Flask(__name__)
13
 
14
+ # Définir et créer le dossier de cache pour Hugging Face
15
+ HUGGINGFACE_CACHE_DIR = "./huggingface_cache"
16
+ os.makedirs(HUGGINGFACE_CACHE_DIR, exist_ok=True)
17
+ logging.debug("Dossier de cache Hugging Face : %s", HUGGINGFACE_CACHE_DIR)
18
 
19
+ # Charger le processor et le modèle en utilisant le cache
20
  logging.debug("Début du chargement du processor et du modèle...")
21
+ processor = AutoProcessor.from_pretrained(
22
+ "facebook/seamless-m4t-v2-large", cache_dir=HUGGINGFACE_CACHE_DIR
23
+ )
24
+ logging.debug("Processor chargé avec succès et mis en cache : %s", processor)
25
+ model = SeamlessM4Tv2Model.from_pretrained(
26
+ "facebook/seamless-m4t-v2-large", cache_dir=HUGGINGFACE_CACHE_DIR
27
+ )
28
+ logging.debug("Modèle chargé avec succès et mis en cache : %s", model)
29
+
30
 
31
  UPLOAD_FOLDER = "audio_files"
32
  os.makedirs(UPLOAD_FOLDER, exist_ok=True)
huggingface_cache/.locks/models--facebook--seamless-m4t-v2-large/7472c1ede2bb52298c22c063a0ad071c420e1e97.lock ADDED
File without changes
huggingface_cache/models--facebook--seamless-m4t-v2-large/.no_exist/5f8cc790b19fc3f67a61c105133b20b34e3dcb76/processor_config.json ADDED
File without changes
huggingface_cache/models--facebook--seamless-m4t-v2-large/blobs/7472c1ede2bb52298c22c063a0ad071c420e1e97 ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "feature_extractor_type": "SeamlessM4TFeatureExtractor",
3
+ "feature_size": 80,
4
+ "language_code": [
5
+ "__afr__",
6
+ "__amh__",
7
+ "__arb__",
8
+ "__ary__",
9
+ "__arz__",
10
+ "__asm__",
11
+ "__azj__",
12
+ "__bel__",
13
+ "__ben__",
14
+ "__bos__",
15
+ "__bul__",
16
+ "__cat__",
17
+ "__ceb__",
18
+ "__ces__",
19
+ "__ckb__",
20
+ "__cmn__",
21
+ "__cmn_Hant__",
22
+ "__cym__",
23
+ "__dan__",
24
+ "__deu__",
25
+ "__ell__",
26
+ "__eng__",
27
+ "__est__",
28
+ "__eus__",
29
+ "__fin__",
30
+ "__fra__",
31
+ "__fuv__",
32
+ "__gaz__",
33
+ "__gle__",
34
+ "__glg__",
35
+ "__guj__",
36
+ "__heb__",
37
+ "__hin__",
38
+ "__hrv__",
39
+ "__hun__",
40
+ "__hye__",
41
+ "__ibo__",
42
+ "__ind__",
43
+ "__isl__",
44
+ "__ita__",
45
+ "__jav__",
46
+ "__jpn__",
47
+ "__kan__",
48
+ "__kat__",
49
+ "__kaz__",
50
+ "__khk__",
51
+ "__khm__",
52
+ "__kir__",
53
+ "__kor__",
54
+ "__lao__",
55
+ "__lit__",
56
+ "__lug__",
57
+ "__luo__",
58
+ "__lvs__",
59
+ "__mai__",
60
+ "__mal__",
61
+ "__mar__",
62
+ "__mkd__",
63
+ "__mlt__",
64
+ "__mni__",
65
+ "__mya__",
66
+ "__nld__",
67
+ "__nno__",
68
+ "__nob__",
69
+ "__npi__",
70
+ "__nya__",
71
+ "__ory__",
72
+ "__pan__",
73
+ "__pbt__",
74
+ "__pes__",
75
+ "__pol__",
76
+ "__por__",
77
+ "__ron__",
78
+ "__rus__",
79
+ "__sat__",
80
+ "__slk__",
81
+ "__slv__",
82
+ "__sna__",
83
+ "__snd__",
84
+ "__som__",
85
+ "__spa__",
86
+ "__srp__",
87
+ "__swe__",
88
+ "__swh__",
89
+ "__tam__",
90
+ "__tel__",
91
+ "__tgk__",
92
+ "__tgl__",
93
+ "__tha__",
94
+ "__tur__",
95
+ "__ukr__",
96
+ "__urd__",
97
+ "__uzn__",
98
+ "__vie__",
99
+ "__yor__",
100
+ "__yue__",
101
+ "__zlm__",
102
+ "__zul__"
103
+ ],
104
+ "num_mel_bins": 80,
105
+ "padding_side": "right",
106
+ "padding_value": 0.0,
107
+ "processor_class": "SeamlessM4TProcessor",
108
+ "return_attention_mask": true,
109
+ "sampling_rate": 16000,
110
+ "stride": 2
111
+ }
huggingface_cache/models--facebook--seamless-m4t-v2-large/refs/main ADDED
@@ -0,0 +1 @@
 
 
1
+ 5f8cc790b19fc3f67a61c105133b20b34e3dcb76
huggingface_cache/models--facebook--seamless-m4t-v2-large/snapshots/5f8cc790b19fc3f67a61c105133b20b34e3dcb76/preprocessor_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ ../../blobs/7472c1ede2bb52298c22c063a0ad071c420e1e97