Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
# -*- coding: utf-8 -*-
|
| 2 |
"""RobotsMali_ASR_Demo.ipynb - Script FINAL
|
| 3 |
-
|
| 4 |
"""
|
| 5 |
import gradio as gr
|
| 6 |
import time
|
|
@@ -17,7 +17,7 @@ import nemo.collections.nlp as nemo_nlp
|
|
| 17 |
# ----------------------------------------------------------------------
|
| 18 |
# CONSTANTES DE CONFIGURATION
|
| 19 |
# ----------------------------------------------------------------------
|
| 20 |
-
# Liste de modèles
|
| 21 |
ROBOTSMALI_MODELS = [
|
| 22 |
"RobotsMali/soloba-ctc-0.6b-v0",
|
| 23 |
"RobotsMali/soloni-114m-tdt-ctc-v1",
|
|
@@ -198,7 +198,6 @@ def transcribe_audio(model_name: str, audio_path: str):
|
|
| 198 |
yield f"❌ Erreur critique lors du chargement : {str(e)}"
|
| 199 |
|
| 200 |
except Exception as e:
|
| 201 |
-
# L'erreur de progression étant corrigée, cette ligne gère les autres erreurs
|
| 202 |
yield f"❌ Erreur générale lors de la transcription complète : {e}"
|
| 203 |
|
| 204 |
finally:
|
|
@@ -216,6 +215,7 @@ INITIAL_DESCRIPTION = "Sélectionnez un modèle ASR de RobotsMali, puis enregist
|
|
| 216 |
if ROBOTSMALI_MODELS:
|
| 217 |
default_model = ROBOTSMALI_MODELS[0]
|
| 218 |
try:
|
|
|
|
| 219 |
load_pipeline(default_model)
|
| 220 |
default_model_short_name = default_model.split('/')[-1]
|
| 221 |
INITIAL_DESCRIPTION = (
|
|
|
|
| 1 |
# -*- coding: utf-8 -*-
|
| 2 |
"""RobotsMali_ASR_Demo.ipynb - Script FINAL
|
| 3 |
+
Intégrant toutes les corrections, sans découpage, avec barre de progression Gradio (syntaxe corrigée) et post-correction.
|
| 4 |
"""
|
| 5 |
import gradio as gr
|
| 6 |
import time
|
|
|
|
| 17 |
# ----------------------------------------------------------------------
|
| 18 |
# CONSTANTES DE CONFIGURATION
|
| 19 |
# ----------------------------------------------------------------------
|
| 20 |
+
# Liste de modèles vérifiée (conforme à RobotsMali sur HF)
|
| 21 |
ROBOTSMALI_MODELS = [
|
| 22 |
"RobotsMali/soloba-ctc-0.6b-v0",
|
| 23 |
"RobotsMali/soloni-114m-tdt-ctc-v1",
|
|
|
|
| 198 |
yield f"❌ Erreur critique lors du chargement : {str(e)}"
|
| 199 |
|
| 200 |
except Exception as e:
|
|
|
|
| 201 |
yield f"❌ Erreur générale lors de la transcription complète : {e}"
|
| 202 |
|
| 203 |
finally:
|
|
|
|
| 215 |
if ROBOTSMALI_MODELS:
|
| 216 |
default_model = ROBOTSMALI_MODELS[0]
|
| 217 |
try:
|
| 218 |
+
# Tente de charger le modèle par défaut au démarrage
|
| 219 |
load_pipeline(default_model)
|
| 220 |
default_model_short_name = default_model.split('/')[-1]
|
| 221 |
INITIAL_DESCRIPTION = (
|