Lingalingeswaran commited on
Commit
89c4c21
·
verified ·
1 Parent(s): 9a52f08

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +31 -0
README.md CHANGED
@@ -78,3 +78,34 @@ The following hyperparameters were used during training:
78
  - Pytorch 2.5.1+cu121
79
  - Datasets 3.2.0
80
  - Tokenizers 0.21.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  - Pytorch 2.5.1+cu121
79
  - Datasets 3.2.0
80
  - Tokenizers 0.21.0
81
+
82
+
83
+ ## Example Usage
84
+
85
+ Here is an example of how to use the model for Sinhala speech recognition with Gradio:
86
+
87
+ ```python
88
+ import gradio as gr
89
+ from transformers import pipeline
90
+
91
+ # Initialize the pipeline with the specified model
92
+ pipe = pipeline(model="Lingalingeswaran/whisper-small-sinhala")
93
+
94
+ def transcribe(audio):
95
+ # Transcribe the audio file to text
96
+ text = pipe(audio)["text"]
97
+ return text
98
+
99
+ # Create the Gradio interface
100
+
101
+ iface = gr.Interface(
102
+ fn=transcribe,
103
+ inputs=gr.Audio(sources=["microphone", "upload"], type="filepath"),
104
+ outputs="text",
105
+ title="Whisper Small Sinhala",
106
+ description="Realtime demo for Sinhala speech recognition using a fine-tuned Whisper small model.",
107
+ )
108
+
109
+ # Launch the interface
110
+ if __name__ == "__main__":
111
+ iface.launch()