File size: 1,905 Bytes
5cf5ff6
 
 
 
 
2090788
5cf5ff6
 
 
 
3517f34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5cf5ff6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
title: Kashmiri Streaming Asr Zipformer
emoji: πŸ’»
colorFrom: purple
colorTo: gray
sdk: docker
pinned: false
short_description: 'Kashmiri streaming ASR with Zipformer '
---

# πŸŽ™οΈ Real-Time Kashmiri Streaming ASR  (FastAPI + Sherpa-ONNX)

This project demonstrates a real-time speech-to-text (ASR) web application with:
* πŸŽ›οΈ Hugging Face Deployment taken from [Luigi](https://huggingface.co/spaces/Luigi/Streaming-Zipformer)
* 🧠 [Sherpa-ONNX](https://github.com/k2-fsa/sherpa-onnx) streaming Zipformer model
* πŸš€ FastAPI backend with WebSocket support
* ☁️ Docker-compatible deployment (CPU-only) on Hugging Face Spaces


## πŸ€– Training
* Model: [Zipformer Small](https://github.com/k2-fsa/icefall)
* Dataset: [IndicVoices](https://huggingface.co/datasets/ai4bharat/IndicVoices)
* WER: 36%
  
## πŸ§ͺ Local Development

1. **Install dependencies**

```bash
pip install -r requirements.txt
```

2. **Run the app locally**

```bash
uvicorn app.main:app --reload --host 0.0.0.0 --port 8501
```

Open [http://localhost:8501](http://localhost:8501) in your browser.

[https://k2-fsa.github.io/sherpa/ncnn/endpoint.html](https://k2-fsa.github.io/sherpa/ncnn/endpoint.html)

## πŸ“ Project Structure

```
.
β”œβ”€β”€ app
β”‚   β”œβ”€β”€ main.py
β”‚   β”œβ”€β”€ asr.py
β”‚   └── model parts
        └── All Model parts here (encoder, decoder, joiner, tokens)
    β”œβ”€β”€ index.html
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ Dockerfile
└── README.md
```

## πŸ”§ Credits

* [Sherpa-ONNX](https://github.com/k2-fsa/sherpa-onnx)
* [OpenCC](https://github.com/BYVoid/OpenCC)
* [FastAPI](https://fastapi.tiangolo.com/)
* [Hugging Face Spaces](https://huggingface.co/docs/hub/spaces)
* [AI4Bharat](https://ai4bharat.iitm.ac.in/)
* [Icefall-K2](https://github.com/k2-fsa/icefall)


Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference