Spaces:
Sleeping
Sleeping
change transcription
Browse files
app.py
CHANGED
@@ -23,10 +23,9 @@ def transcribe_audio(audio_path):
|
|
23 |
if audio_path is None:
|
24 |
return "Aucun fichier audio fourni."
|
25 |
|
26 |
-
# Effectuer la transcription
|
27 |
result = transcriber(
|
28 |
audio_path,
|
29 |
-
generate_kwargs={"language": "wo"}, # Spécifier la langue dans generate_kwargs
|
30 |
return_timestamps=False
|
31 |
)
|
32 |
|
@@ -34,6 +33,10 @@ def transcribe_audio(audio_path):
|
|
34 |
return result.get("text", "Erreur: Transcription vide")
|
35 |
return result
|
36 |
|
|
|
|
|
|
|
|
|
37 |
except Exception as e:
|
38 |
return f"Erreur lors de la transcription: {str(e)}"
|
39 |
|
|
|
23 |
if audio_path is None:
|
24 |
return "Aucun fichier audio fourni."
|
25 |
|
26 |
+
# Effectuer la transcription sans spécifier la langue
|
27 |
result = transcriber(
|
28 |
audio_path,
|
|
|
29 |
return_timestamps=False
|
30 |
)
|
31 |
|
|
|
33 |
return result.get("text", "Erreur: Transcription vide")
|
34 |
return result
|
35 |
|
36 |
+
if isinstance(result, dict):
|
37 |
+
return result.get("text", "Erreur: Transcription vide")
|
38 |
+
return result
|
39 |
+
|
40 |
except Exception as e:
|
41 |
return f"Erreur lors de la transcription: {str(e)}"
|
42 |
|