anzart commited on
Commit
8ecfae5
1 Parent(s): 41d19d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -1,3 +1,13 @@
1
  import gradio as gr
 
2
 
3
- gr.load("models/Akashpb13/Kabyle_xlsr").launch()
 
 
 
 
 
 
 
 
 
 
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")])