Downloads · 30 days
41
32% of all-time downloads
Lingalingeswaran/whisper-lang-id
whisper-lang-id is a audio classification model from Lingalingeswaran. Use it for the audio classification task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
41
32% of all-time downloads
All-time downloads
129
Public
Parameters
8.3M
33.2 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors33.2 MB · 100%
From the Hugging Face model README
This model is a fine-tuned version of openai/whisper-tiny on mozilla-foundation/common_voice_11_0 dataset
More information needed
More information needed
Mozilla foundation/common_voice_11.0
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss | Accuracy | F1 |
|---|---|---|---|---|---|
| No log | 1.0 | 175 | 0.0148 | 0.995 | 0.9950 |
Here is an example of how to use the model for Language Idenfication with Gradio:
import torch
from transformers import pipeline
import gradio as gr
# Use a pipeline as a high-level helper
pipe = pipeline("audio-classification", model="Lingalingeswaran/whisper-lang-id")
def identify_language(audio_file):
"""Identifies the language of an audio file."""
try:
result = pipe(audio_file)
predicted_label = result[0]['label']
score = result[0]['score']
if predicted_label == "LABEL_0":
predicted_label = "Tamil"
elif predicted_label == "LABEL_1":
predicted_label = "English"
else:
predicted_label = predicted_label
return f"Predicted Language: {predicted_label}, Score: {score:.4f}"
except Exception as e:
return f"Error during language identification: {e}"
# Gradio interface
def create_gradio_interface():
with gr.Blocks() as demo:
gr.Markdown("### Language Identification from Audio File")
gr.Markdown("Upload an audio file or use your microphone to detect the language spoken.")
# Corrected the sources argument
audio_input = gr.Audio(sources=["microphone", "upload"], type="filepath", label="Record or Upload Audio")
result_output = gr.Textbox(label="Language Identification Result", interactive=False)
# Submit button
submit_btn = gr.Button("Submit")
submit_btn.click(identify_language, inputs=audio_input, outputs=result_output)
# Clear button
clear_btn = gr.Button("Clear")
clear_btn.click(lambda: (None, None), outputs=[audio_input, result_output]) # Clear audio and result
demo.launch()
# Run the Gradio interface
create_gradio_interface()