Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,13 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
from huggingface.transliteration import AutomaticSpeechRecognitionModel
|
3 |
|
4 |
+
# Charger le modèle
|
5 |
+
model = AutomaticSpeechRecognitionModel.from_pretrained("models/Akashpb13/Kabyle_xlsr")
|
6 |
+
|
7 |
+
# Définir la fonction de traitement
|
8 |
+
def process_audio(audio_file):
|
9 |
+
output = model(audio_file)
|
10 |
+
return output.text
|
11 |
+
|
12 |
+
# Lancer l'interface Gradio
|
13 |
+
gr.launch(process_audio, inputs=[gr.Audio(label="Fichier audio")], outputs=[gr.outputs.Text(label="Texte reconnu")])
|