Instructions to use cazzz307/models-row70-71-indicvoice-ic-63500-mt5small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cazzz307/models-row70-71-indicvoice-ic-63500-mt5small with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cazzz307/models-row70-71-indicvoice-ic-63500-mt5small")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("cazzz307/models-row70-71-indicvoice-ic-63500-mt5small") model = AutoModelForSeq2SeqLM.from_pretrained("cazzz307/models-row70-71-indicvoice-ic-63500-mt5small") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use cazzz307/models-row70-71-indicvoice-ic-63500-mt5small with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cazzz307/models-row70-71-indicvoice-ic-63500-mt5small" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cazzz307/models-row70-71-indicvoice-ic-63500-mt5small", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/cazzz307/models-row70-71-indicvoice-ic-63500-mt5small
- SGLang
How to use cazzz307/models-row70-71-indicvoice-ic-63500-mt5small with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "cazzz307/models-row70-71-indicvoice-ic-63500-mt5small" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cazzz307/models-row70-71-indicvoice-ic-63500-mt5small", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "cazzz307/models-row70-71-indicvoice-ic-63500-mt5small" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cazzz307/models-row70-71-indicvoice-ic-63500-mt5small", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use cazzz307/models-row70-71-indicvoice-ic-63500-mt5small with Docker Model Runner:
docker model run hf.co/cazzz307/models-row70-71-indicvoice-ic-63500-mt5small
models-row70-71-indicvoice-ic-63500-mt5small
This is a fine-tuned mT5 Small model trained on Indic ASR data using Hugging Face Transformers. The goal of this model is to correct post-ASR transcription errors in Indic languages.
Fine-tuning large multilingual models like mT5 on domain-specific datasets like ASR outputs allows improved performance, especially in noisy or low-resource environments. These models are powerful at generalizing across varied languages and dialects when backed by high-quality finetuning datasets.
π Datasets Used
- Indicvoice
π§ Transcription Models
- Indic Conformer (IC)
βοΈ Training Info
- Trained over a period of 6 months
- Used A100 GPUs
- Developed as part of a research collaboration with IIT Bombay
- Focused on improving transcription accuracy of ASR systems in Indic languages
π Usage
import pandas as pd
from datasets import Dataset
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
import torch
def load_model_and_tokenizer(model_path, tokenizer_path):
print("Loading model and tokenizer...")
model = AutoModelForSeq2SeqLM.from_pretrained(model_path).to(device)
tokenizer = AutoTokenizer.from_pretrained(tokenizer_path)
return model, tokenizer
def run_inference(input_csv_path, output_csv_path, model, tokenizer):
print(f"Loading data from {input_csv_path}...")
data_df = pd.read_csv(input_csv_path, header=None)
data_df.columns = ['Hypothesis', 'Corrected Hypothesis']
dataset = Dataset.from_pandas(data_df.rename(columns={'Hypothesis': 'input', 'Corrected Hypothesis': 'target'}))
predictions = []
print("Running inference...")
for item in dataset:
input_text = item['input']
input_ids = tokenizer(input_text, return_tensors="pt", padding=True, truncation=True).input_ids.to(device)
outputs = model.generate(input_ids, max_length=512)
decoded_output = tokenizer.decode(outputs[0], skip_special_tokens=True)
predictions.append(decoded_output)
data_df['Predictions'] = predictions
data_df.to_csv(output_csv_path, index=False)
print(f"Predictions saved to {output_csv_path}")
# Usage
model_path = "cazzz307/models-row70-71-indicvoice-ic-63500-mt5small" # Hugging Face model path
tokenizer_path = "cazzz307/models-row70-71-indicvoice-ic-63500-mt5small" # Same as model path (adjust if tokenizer is separate)
device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
model, tokenizer = load_model_and_tokenizer(model_path, tokenizer_path)
input_csv = "your_input.csv" # Replace with your input file path
output_csv = "predictions.csv" # Replace with your desired output file path
run_inference(input_csv, output_csv, model, tokenizer)
Note: Adjust the tokenizer_path if your tokenizer files are in a separate location or subdirectory.
- Downloads last month
- -
Model tree for cazzz307/models-row70-71-indicvoice-ic-63500-mt5small
Base model
google/mt5-small