Downloads · 30 days
32
2% of all-time downloads
amitpant7/Nepali-Automatic-Speech-Recognition
Nepali-Automatic-Speech-Recognition is a machine learning model from amitpant7. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Hey there! If you’re looking to transcribe Nepali audio into text, you’ve come to the right place. I’ve fine-tuned the Whisper small model specifically for Nepali speech recognition. Below, you’ll find all the details…
Downloads · 30 days
32
2% of all-time downloads
All-time downloads
1.5K
Public
Parameters
242M
2.9 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors967 MB · 100%
From the Hugging Face model README
Hey there! If you’re looking to transcribe Nepali audio into text, you’ve come to the right place. I’ve fine-tuned the Whisper small model specifically for Nepali speech recognition. Below, you’ll find all the details you need to get started, including where to find the datasets and notebooks!
Using this model is pretty straightforward! Here’s a quick guide to get you up and running:
Before we dive in, make sure you have the necessary libraries installed. Open your terminal or notebook and run:
!pip install torch transformers yt-dlp
To get started with transcribing audio, you’ll need to load the Whisper model using the Hugging Face transformers library. Here’s how:
from transformers import pipeline
# Load the Whisper model for automatic speech recognition
pipe = pipeline("automatic-speech-recognition", model="amitpant7/Nepali-Automatic-Speech-Recognition")
If you have an audio file ready, you can transcribe it easily. Just point to your audio file (like audio.mp3) and run the following:
# Run inference on an audio file
result = pipe('audio.mp3')
print(result['text']) # This will print the transcribed text
Want to transcribe audio from a YouTube video? No problem! Use the following code to download the audio and transcribe it:
import yt_dlp
def download_youtube_audio(youtube_url, output_path="audio"):
ydl_opts = {
'format': 'bestaudio/best',
'outtmpl': output_path,
'postprocessors': [{
'key': 'FFmpegExtractAudio',
'preferredcodec': 'mp3',
'preferredquality': '192',
}],
}
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
ydl.download([youtube_url])
return output_path
# Replace with the actual YouTube URL
youtube_url = "https://www.youtube.com/watch?v=H-ExNmHo2xI&pp=ygURYWJvdXQgeWFtYSBidWRkaGE%3D"
audio_file = download_youtube_audio(youtube_url)
# Now, run inference on the downloaded audio
result = pipe(audio_file)
print(result['text'])