Add imports to __init__.py
This commit is contained in:
24
README.md
24
README.md
@@ -1,9 +1,14 @@
|
||||
# GigaAM ASR for ONNX
|
||||
|
||||
## Project purpose:
|
||||
Usage of a latest (v3) versions of a GigaAMASR without additional dependencies and localy stored models
|
||||
|
||||
Usage of a latest (v3) versions of a GigaAMASR without additional dependencies and with localy stored models running in
|
||||
an ONNX runtime
|
||||
|
||||
## Project setup:
|
||||
|
||||
1. Set up original GigaAM project
|
||||
|
||||
```bash
|
||||
# Clone original GigaAM repo:
|
||||
git clone https://github.com/salute-developers/GigaAM
|
||||
@@ -16,25 +21,34 @@ source ./tmp_venv/bin/activate
|
||||
# Install project:
|
||||
pip install -e .
|
||||
```
|
||||
|
||||
2. Acquire chosen models:
|
||||
|
||||
```python
|
||||
import gigaam
|
||||
|
||||
onnx_dir = '/target/onnx/model/paths'
|
||||
model_version = 'v3_ctc' # Options: v3_* models
|
||||
|
||||
model = gigaam.load_model(model_version)
|
||||
model.to_onnx(dir_path=onnx_dir)
|
||||
```
|
||||
3. Fetch tokenizer SentencePieceProcessor model from cache
|
||||
- From `~/.cache/gigaam/{model_name}_tokenizer.model`
|
||||
- From `https://cdn.chatwm.opensmodel.sberdevices.ru/GigaAM/{model_name}_tokenizer.model`
|
||||
|
||||
3. Fetch SentencePieceProcessor tokenizer model
|
||||
|
||||
- From a cache `~/.cache/gigaam/{model_name}_tokenizer.model`
|
||||
- From a sberdevices server `https://cdn.chatwm.opensmodel.sberdevices.ru/GigaAM/{model_name}_tokenizer.model`
|
||||
|
||||
4. Then you may remove original project:
|
||||
|
||||
```bash
|
||||
cd ..
|
||||
rm -r ./GigaAM
|
||||
```
|
||||
|
||||
5. Install this (gigaam-onnx) project
|
||||
6. Set up onnx runtime and load chosen model:
|
||||
|
||||
```python
|
||||
import onnxruntime as ort
|
||||
from gigaam_onnx import GigaAMV3E2ERNNT, GigaAMV3RNNT, GigaAMV3E2ECTC, GigaAMV3CTC
|
||||
@@ -95,4 +109,4 @@ text, timings = e2e_rnnt_model.transcribe_batch(
|
||||
[audio_array] # audio chunks
|
||||
[1] # length of chunks to combine
|
||||
)[0]
|
||||
```
|
||||
```
|
||||
|
||||
@@ -4,8 +4,9 @@ authors = [
|
||||
{ name = "nikto_b", email = "niktob560@yandex.ru" }
|
||||
]
|
||||
license = "MIT"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
description = "ONNX wrapper for a GigaAMASR models"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.13"
|
||||
dependencies = [
|
||||
"hatchling>=1.28.0",
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
from gigaam_onnx.v3_ctc import GigaAMV3CTC
|
||||
from gigaam_onnx.v3_e2e_ctc import GigaAMV3E2ECTC
|
||||
from gigaam_onnx.v3_e2e_rnnt import GigaAMV3E2ERNNT
|
||||
from gigaam_onnx.v3_rnnt import GigaAMV3RNNT
|
||||
|
||||
Reference in New Issue
Block a user