hima-asr

Prahaladha/hima-asr

作者
Prahaladha
任务
语音识别
下载量
440
点赞数
9
趋势分
8
许可证
other
收录时间
2026/11/6

license: other license_name: apache-2.0-and-gemma license_link: https://huggingface.co/Prahaladha/hima-asr/blob/main/NOTICE language: [as, bn, gu, hi, kn, ml, mr, or, pa, ta, te, en] pipeline_tag: automatic-speech-recognition library_name: transformers base_model: [Qwen/Qwen3-ASR-1.7B, google/gemma-3-270m] tags: [speech, asr, speech-recognition, speech-to-decision, end-of-turn, emotion-recognition, audio-classification, indic, india, multilingual, code-switching] model-index:

  • name: Hima-ASR results:
    • task: {type: automatic-speech-recognition, name: Speech recognition} dataset: {type: google/fleurs, name: FLEURS (12 languages), split: test} metrics: [{type: wer, value: 12.7, name: WER (average of 12 languages)}]
    • task: {type: automatic-speech-recognition, name: Speech recognition} dataset: {type: ai4bharat/Kathbath, name: Kathbath (Hindi), split: test} metrics: [{type: wer, value: 3.4, name: WER}]
    • task: {type: automatic-speech-recognition, name: Speech recognition} dataset: {type: ai4bharat/Lahaja, name: Lahaja (Hindi), split: test} metrics: [{type: wer, value: 8.8, name: WER}]

Hima-ASR

Speech to text, and speech to decisions, in one open model.

Hima-ASR is a compact 0.46B model for 11 Indian languages and English. It writes down what was said, and its decision head answers questions about how it was said: the speaker's tone and emotion, what a caller wants, what they're talking about, how urgent it is, which language it is and who is speaking. You ask in plain English, and the answers come from the audio itself.

Speech to textAssamese, Bengali, Gujarati, Hindi, Kannada, Malayalam, Marathi, Odia, Punjabi, Tamil, Telugu, English
Speech to decisionsany question you write in plain English, answered with a probability for every option
One calltranscript and decisions together from a single listen, under half a second per clip on a laptop GPU
Size0.46B ASR (920 MB) + 17.5M decision head
Runs onGPU, CPU (ONNX Runtime) and Mac (MLX), with 8-bit and 4-bit versions
Input16 kHz mono audio, 1 to 30 seconds per clip

Quick start

pip install "transformers>=5.13" torch torchaudio soundfile safetensors huggingface_hub

Speech to text

import torch
from transformers import AutoModel

model = AutoModel.from_pretrained("Prahaladha/hima-asr", trust_remote_code=True, dtype=torch.float32)
model = model.to("cuda").eval()                                     # or leave on CPU

print(model.transcribe("call.wav", language="hi"))                 # one file -> one string
print(model.transcribe(["a.wav", "b.wav"], language="ta"))          # list -> list
print(model.transcribe("call.wav"))                                 # the model detects the language
print(model.transcribe("call.wav", language="hi", style="mixed"))   # English words in Latin letters
ArgumentValuesDefault
languageas bn en gu hi kn ml mr or pa ta te, or NoneNone (detected)
stylenative (own script), mixed (English words in Latin letters)native
batch_sizeclips decoded together16

Trimmed or full piece table. The default (main) uses a piece table trimmed to the 63,335 pieces Hima writes: 0.46B parameters, the same transcripts, a bit faster. The original full table (262,144 pieces, 0.59B) is on the full-vocab branch:

model = AutoModel.from_pretrained("Prahaladha/hima-asr", revision="full-vocab", trust_remote_code=True, dtype=torch.float32)

Speech to text and decisions, in one call

import sys
from huggingface_hub import snapshot_download
sys.path.insert(0, snapshot_download("Prahaladha/hima-asr", allow_patterns=["decide/*"]) + "/decide")
from decide import Hima

hima = Hima("both")          # "asr" = transcripts only, "decide" = decisions only, "both" = both from one listen

result = hima.run("call.wav", [
    {"q": "How does the speaker sound?", "options": ["calm", "polite", "angry", "confused", "rushed", "cheerful"]},
    {"q": "What is the caller doing?", "options": ["will pay", "already paid", "cannot pay now", "call me later", "wrong person"]},
    {"q": "Does the speaker ask to talk to a human?", "type": "yesno"},
    {"q": "How urgent is it?", "type": "scale", "options": ["not urgent", "somewhat urgent", "very urgent"]},
], language="hi")

result["text"]               # the transcript
result["decisions"]          # one {option: probability} per question

The audio encoder runs once per clip, and the writer and the decision head both read its output. run also takes a list of clips, and picks CUDA, then a Mac GPU, then CPU on its own.

Fast versions: ONNX and MLX

Hima-ASR also ships ready-made for CPUs (ONNX Runtime) and Apple Silicon GPUs (MLX), in full precision and quantized, each in its own repo. They need no PyTorch: just numpy, the runtime and tokenizers. Each one includes the decision head too: model.run(clip) gives the transcript and the decisions from one listen, and model.decide(clip, questions) answers your own questions.

Runs onVersionRepoSizeSpeed (times realtime)
CPUPyTorchthis repo920 MB████░░░░░░░░░░░░░░░░ 16x
CPUONNX fp32hima-asr-ONNX1.8 GB███████░░░░░░░░░░░░░ 25x
CPUONNX int8hima-asr-ONNX487 MB██████████░░░░░░░░░░ 35x
CPUONNX q4hima-asr-ONNX360 MB█████████░░░░░░░░░░░ 31x
Mac GPUPyTorchthis repo920 MB██████░░░░░░░░░░░░░░ 21x
Mac GPUMLX fp16hima-asr-mlx1.0 GB█████████████████░░░ 63x
Mac GPUMLX 8-bithima-asr-mlx-8bit536 MB████████████████████ 73x
Mac GPUMLX 4-bithima-asr-mlx-4bit379 MB████████████████████ 73x

Measured on a MacBook Pro (M4 Pro).

CPU, with ONNX Runtime

pip install onnxruntime numpy tokenizers soundfile huggingface_hub
hf download Prahaladha/hima-asr-ONNX hima_onnx.py --local-dir .
from hima_onnx import HimaONNX

model = HimaONNX("Prahaladha/hima-asr-ONNX", precision="q4")   # or "int8", "fp32"
print(model.transcribe("call.wav", language="hi"))

Mac, with MLX

pip install mlx mlx-lm numpy tokenizers soundfile huggingface_hub
hf download Prahaladha/hima-asr-mlx-8bit hima_mlx.py --local-dir .
from hima_mlx import HimaMLX

model = HimaMLX("Prahaladha/hima-asr-mlx-8bit")   # or hima-asr-mlx-4bit, hima-asr-mlx
print(model.transcribe("call.wav", language="hi"))

Both take 16 kHz audio files or arrays (pip install librosa to pass other sample rates), and language=None lets the model detect the language.

Ask anything

A decision is any question with a set of answers:

TypeExample
choice (default){"q": "Which emotion best describes the speaker?", "options": ["calm", "happy", "frustrated", "worried", "apologetic"]}
yesno{"q": "Is the speaker complaining about something?", "type": "yesno"}
scale{"q": "How formal is the speaker's language?", "type": "scale", "options": ["very casual", "neutral", "very formal"]}

Write the question the way you'd ask a person who just heard the clip. Options can carry a short description: {"options": {"callback": "asks to talk later", "wrong_person": "says this is the wrong number"}}.

Call hima.run("call.wav") with no questions to get a ready-made set of 16 (tone, emotion, sentiment, intent, topic, urgency, formality, language, speaker and more), listed in decide/questions.json.

Decisions in action

Every example below is a held-out clip the model never trained on, with the probabilities straight from the model.

Hindi · an angry caller

“Don't mess with my head this early in the morning. I told you, no Rahul lives here! I'm hanging up!”

DecisionAnswerConfidenceNext best
Sentimentnegative████████████████████ 100%neutral 0%
Emotionfrustrated████████████████████ 99%worried 1%
Complaining?yes███████████████████░ 97%no 3%
Agrees or disagrees?disagrees█████████████████░░░ 85%neither 11%
Asking you to act?yes██████████████████░░ 90%no 10%
Talks about money?no████████████████████ 98%yes 2%
Formalityvery casual████████████████████ 99%neutral 1%
Wants a human agent?no███████████████████░ 95%yes 5%

Hindi · read speech: who is speaking, and about what

“Most of the work was theoretical, but the program was written to simulate observations of the Sagittarius galaxy.”

DecisionAnswerConfidenceNext best
LanguageHindi████████████████████ 100%Bengali 0%
Speakerman████████████████████ 100%woman 0%
Topicscience / nature█████████████████░░░ 86%other 6%
What the caller is doinggiving information██████████████████░░ 92%other 8%
Emotioncalm███████████████████░ 94%frustrated 3%
Urgencynot urgent████████████████████ 98%somewhat urgent 1%
Asking a question?no████████████████████ 98%yes 2%
Talks about money?no███████████████████░ 97%yes 3%

Telugu · a caller in distress

“Why do you call every day and torment me? I had a road accident and I'm stuck in bed. Where am I supposed to bring the money from?”

DecisionAnswerConfidenceNext best
Tone of voiceangry███████████████████░ 95%frustrated 5%
Sentimentnegative████████████████████ 100%neutral 0%
Emotionfrustrated████████████████████ 98%worried 2%
Asking a question?yes███████████████████░ 94%no 6%
Complaining?yes████████████████████ 98%no 2%
Formalityvery casual██████████████████░░ 92%neutral 8%
Wants a human agent?no███████████████████░ 95%yes 5%
LanguageTelugu████████████████████ 100%Urdu 0%

Telugu + English · a caller in a hurry

“Hello, I'm driving... when is the due date?”

DecisionAnswerConfidenceNext best
Tone of voicerushed████████████████████ 100%cheerful 0%
What the caller is doingasking for details████████████████████ 99%other 1%
Asking a question?yes████████████████████ 98%no 2%
Agrees or disagrees?neither████████████████████ 100%disagrees 0%
Sentimentneutral███████████████████░ 97%negative 3%
Complaining?no█████████████████░░░ 87%yes 13%
Wants a human agent?no███████████████████░ 96%yes 4%
LanguageTelugu████████████████████ 100%Urdu 0%

Tamil · “I've already paid”

“Sir, I think you've called by mistake. I paid the ₹7,000 credit card bill on the 15th itself.”

DecisionAnswerConfidenceNext best
What the caller is doingalready paid / disputes██████████████████░░ 91%will pay 8%
Talks about money?yes████████████████████ 100%no 0%
Mentions a time?yes███████████████████░ 95%no 5%
Topicmoney████████████████████ 100%service 0%
Tone of voicecalm███████████████████░ 95%polite 4%
Formalityvery casual███████████████████░ 96%neutral 4%
Wants a human agent?no███████████████████░ 97%yes 3%
LanguageTamil████████████████████ 100%Hindi 0%

Tamil + English · a frustrated caller

“Hello, what does it mean to call ten times a day? Don't you have any manners?”

DecisionAnswerConfidenceNext best
Tone of voicefrustrated████████████████████ 99%angry 1%
Asking a question?yes███████████████████░ 95%no 5%
Mentions a time?yes██████████████████░░ 90%no 10%
Sentimentnegative████████████████░░░░ 79%neutral 20%
Complaining?yes████████████████░░░░ 81%no 19%
Formalityvery casual███████████████████░ 96%neutral 4%
Talks about money?no██████████████████░░ 90%yes 10%
LanguageTamil████████████████████ 100%Telugu 0%

Marathi · paid, and angry about the calls

“What is going on? I've already paid and you still keep calling to collect? Now I'll drag you to court!”

DecisionAnswerConfidenceNext best
Tone of voiceangry████████████████████ 98%frustrated 2%
Sentimentnegative████████████████████ 100%neutral 0%
Emotionfrustrated████████████████████ 99%worried 1%
What the caller is doingalready paid / disputes██████████████░░░░░░ 70%other 10%
Complaining?yes████████████████████ 99%no 1%
Talks about money?yes████████████████████ 98%no 2%
Agrees or disagrees?disagrees█████████████████░░░ 83%neither 13%
Formalityvery casual███████████████████░ 96%neutral 4%

Gujarati · a confused caller disputing a charge

“But I pay the full amount every month, so where did this extra interest come from? I don't understand at all.”

DecisionAnswerConfidenceNext best
Tone of voiceconfused████████████████████ 100%anxious 0%
What the caller is doingalready paid / disputes█████████████████░░░ 85%cannot pay now 6%
Asking a question?yes███████████████████░ 95%no 5%
Talks about money?yes████████████████████ 100%no 0%
Complaining?yes███████████████████░ 96%no 4%
Topicmoney████████████████████ 100%service 0%
Sentimentnegative████████████████████ 99%neutral 1%
Wants a human agent?no███████████████████░ 97%yes 3%

Malayalam · “call me later”

“I'm in a big meeting. Call at four.”

DecisionAnswerConfidenceNext best
What the caller is doingcall me later███████████████████░ 97%other 1%
Mentions a time?yes██████████████████░░ 92%no 8%
Asking you to act?yes██████████████████░░ 91%no 9%
Tone of voicecalm███████████████████░ 95%rushed 4%
Sentimentneutral██████████████████░░ 91%negative 8%
Complaining?no████████████████░░░░ 81%yes 19%
Talks about money?no███████████████████░ 95%yes 5%
LanguageMalayalam████████████████████ 100%Urdu 0%
Wants a human agent?no█████████████████░░░ 85%yes 15%

English · a loan question

“Good morning! Can we talk in Malayalam? Ramesh here, regarding my home loan EMI.”

DecisionAnswerConfidenceNext best
LanguageEnglish████████████████████ 99%Hindi 1%
Asking a question?yes███████████████████░ 97%no 3%
Topicmoney████████████████████ 100%daily life 0%
Talks about money?yes███████████████████░ 97%no 3%
Emotioncalm█████████████████░░░ 87%worried 8%
Complaining?no██████████████████░░ 91%yes 9%
Agrees or disagrees?neither███████████████████░ 96%agrees 3%
Urgencynot urgent█████████████████░░░ 83%somewhat urgent 17%

How often it's right

On held-out test clips in 12 Indian languages and English that the model never trained on:

DecisionRight
Speaker is a man or a woman12 / 12
Wants a human agent34 / 34
Talks about money34 / 35
Language (out of 13)35 / 36
Mentions a date or time33 / 35
Urgency27 / 29
Asking a question30 / 32
Asking the listener to do something31 / 34

The caller examples are acted replies in synthetic voices; the read-speech examples are real recordings (FLEURS, CC BY 4.0).

Benchmarks

Hima-ASR is the best of the four at South Indian languages. It has the lowest error in Telugu, Tamil, Kannada and Malayalam, and on 9 of their 11 test sets, at well under half the size of Flex and Core.

TeluguTamilKannadaMalayalam
Hima-ASR (0.46B)13.417.411.115.0
Flex (1.2B)15.020.913.516.8
Core (1.2B)14.619.813.016.5
Sarvam Saaras v315.520.511.716.7

Word error rate (WER, %, lower is better) against Indic-Transcribe-Flex, Indic-Transcribe-Core and Sarvam Saaras v3 (API). Every model is scored on the same clips with the same scorer, with the language given and text compared after standard normalisation (punctuation removed, Unicode NFC). Best result per row in bold.

LanguageTest setHima-ASR (0.46B)Flex (1.2B)Core (1.2B)Sarvam Saaras v3
All 12 languagesOverall average12.9513.2312.8412.79
All 12 languagesFLEURS average12.712.712.312.0
TeluguOverall13.415.014.615.5
Kathbath12.912.811.613.7
TamilOverall17.420.919.820.5
Kathbath15.414.113.815.0
MILE14.018.817.318.7
SPRING-INX round 136.446.544.739.6
SPRING-INX round 237.550.548.140.9
KannadaOverall11.113.513.011.7
Kathbath9.511.710.411.4
MILE13.815.815.015.5
SPRING-INX round 149.058.057.553.8
MalayalamOverall15.016.816.516.7
Kathbath19.926.823.625.2
SPRING-INX round 147.349.047.947.8
SPRING-INX round 250.852.952.451.9
HindiOverall14.213.213.116.6
FLEURS5.74.34.24.9
Gram Vaani (phone-quality, rural)17.216.516.420.1
Kathbath3.42.52.63.4
Lahaja (many accents)8.88.18.012.1
Monsoon (conversational)11.18.07.69.9
BengaliOverall12.310.910.010.5
Kathbath8.35.45.17.2
SPRING-INX round 126.226.926.426.8
SPRING-INX round 227.327.827.328.1
GujaratiOverall10.210.510.110.6
Kathbath7.35.45.26.7
SPRING-INX round 135.937.235.936.4
SPRING-INX round 239.641.139.939.9
MarathiOverall13.913.413.412.0
Kathbath11.08.88.79.9
SPRING-INX round 138.739.638.337.1
SPRING-INX round 234.238.634.033.0
OdiaOverall12.512.912.311.1
Kathbath8.310.08.78.6
SPRING-INX round 135.340.038.837.3
PunjabiOverall10.99.49.19.7
Kathbath8.17.16.97.7
SPRING-INX round 130.332.830.930.6
SPRING-INX round 233.134.733.433.3
AssameseOverall17.015.815.214.7
SPRING-INX round 135.638.537.938.9
SPRING-INX round 233.435.634.937.2
EnglishOverall7.56.46.94.0
Monsoon (conversational)4.26.16.33.5
Svarah (Indian-accented)11.46.87.84.7

Architecture

Hima-ASR has four parts:

  1. Audio encoder: turns 16 kHz speech into acoustic frames (12.5 per second). Initialised from the audio encoder of Qwen3-ASR-1.7B.
  2. Projector: maps the audio encoder's frames into the text decoder's input space.
  3. Text decoder: writes the transcript piece by piece (greedy). Initialised from Gemma 3 270M. Its piece table keeps only the 63,335 pieces Hima writes (Indian scripts and English), out of Gemma's 262,144.
  4. Decision head (decide/, 17.5M): reads a learned mix of every encoder and decoder layer over the audio, together with the question and its options, and scores each option. Its attention runs over the audio frames, so it hears tone, pauses and voice as well as content.

Files

FileWhat it is
model.safetensorsweights (bf16, 920 MB, trimmed piece table)
config.json, configuration_hima_asr.pyconfiguration
modeling_hima_asr.pymodel code (loaded with trust_remote_code=True)
preprocessor_config.jsonaudio feature settings
tokenizer.json, tokenizer_config.jsontext decoder tokenizer
decide/decision head: head.safetensors, decide.py (the Hima class), questions.json, demo clips

License

  • Hima-ASR's own parts (projector, training changes, inference code): Apache 2.0, see LICENSE.
  • Audio encoder: initialised from Qwen3-ASR-1.7B, Apache 2.0.
  • Text decoder: initialised from Gemma 3 270M. Gemma is provided under and subject to the Gemma Terms of Use found at ai.google.dev/gemma/terms, including its use restrictions. Hima-ASR is a Model Derivative of Gemma, so any use or redistribution of Hima-ASR must follow those terms. See NOTICE.

内容来源:Hugging Face 模型卡

在 Hugging Face 查看