AI Assistant commited on
Commit
e14cf3f
·
1 Parent(s): 97de31f

Fix: improve error handling and update dependencies for stability

Browse files
Files changed (3) hide show
  1. __pycache__/app.cpython-312.pyc +0 -0
  2. app.py +14 -9
  3. requirements.txt +18 -18
__pycache__/app.cpython-312.pyc ADDED
Binary file (22.8 kB). View file
 
app.py CHANGED
@@ -1,12 +1,17 @@
1
- import os, shlex, subprocess, tempfile, traceback, glob, gc, shutil
2
- import torch
3
- from huggingface_hub import snapshot_download
4
- from nemo.collections import asr as nemo_asr
5
- from nemo.collections.asr.models import EncDecCTCModel, EncDecRNNTModel
6
- import gradio as gr
7
- import time
8
- import psutil
9
- import humanize
 
 
 
 
 
10
 
11
  # Configuration
12
  DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
 
1
+ try:
2
+ import os, shlex, subprocess, tempfile, traceback, glob, gc, shutil
3
+ import torch
4
+ from huggingface_hub import snapshot_download
5
+ from nemo.collections import asr as nemo_asr
6
+ from nemo.collections.asr.models import EncDecCTCModel, EncDecRNNTModel
7
+ import gradio as gr
8
+ import time
9
+ import psutil
10
+ import humanize
11
+ except Exception as e:
12
+ print("❌ Erreur critique lors de l'importation des dépendances :")
13
+ print(traceback.format_exc())
14
+ raise e
15
 
16
  # Configuration
17
  DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
requirements.txt CHANGED
@@ -1,18 +1,18 @@
1
- # Build tools
2
- Cython
3
- packaging
4
- setuptools
5
- wheel
6
-
7
- # Core dependencies
8
- numpy<2.0.0
9
- torch>=2.0.0
10
- huggingface_hub==0.20.0 # Version qui contient encore HfFolder
11
- nemo_toolkit[asr]==1.23.0
12
- gradio==4.44.1
13
- psutil
14
- humanize
15
-
16
- # Fix: compatibilité pyarrow / datasets avec nemo_toolkit
17
- pyarrow<14.0.0
18
- datasets<2.14.0
 
1
+ # Build tools
2
+ Cython
3
+ packaging
4
+ setuptools
5
+ wheel
6
+
7
+ # Core dependencies
8
+ numpy<2.0.0
9
+ torch>=2.0.0
10
+ huggingface_hub>=0.23.0
11
+ nemo_toolkit[asr]==1.23.0
12
+ gradio>=4.44.1
13
+ psutil
14
+ humanize
15
+
16
+ # Fix: compatibilité pyarrow / datasets avec nemo_toolkit
17
+ pyarrow<14.0.0
18
+ datasets<2.14.0