Athspi commited on
Commit
cd0a212
·
verified ·
1 Parent(s): 1e0f1bc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -2
app.py CHANGED
@@ -1,9 +1,19 @@
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
- # Load the Whisper model from Hugging Face
5
  model_name = "Subhaka/whisper-small-Sinhala-Fine_Tune"
6
- transcriber = pipeline("automatic-speech-recognition", model=model_name)
 
 
 
 
 
 
 
 
 
 
7
 
8
  # Define a transcription function
9
  def transcribe_audio(audio_file):
 
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
+ # Specify the correct model name and adjust the loading configuration
5
  model_name = "Subhaka/whisper-small-Sinhala-Fine_Tune"
6
+
7
+ # Define the pipeline with `use_safetensors=True`
8
+ def load_pipeline():
9
+ return pipeline(
10
+ "automatic-speech-recognition",
11
+ model=model_name,
12
+ use_safetensors=True, # Ensure compatibility with safetensors
13
+ )
14
+
15
+ # Load the model pipeline
16
+ transcriber = load_pipeline()
17
 
18
  # Define a transcription function
19
  def transcribe_audio(audio_file):