From b1240d150ddac1bddbb3ece128a6531b7d826b96 Mon Sep 17 00:00:00 2001 From: nikto_b Date: Wed, 3 Dec 2025 16:49:15 +0300 Subject: [PATCH] Add imports to __init__.py --- README.md | 24 +++++++++++++++++++----- pyproject.toml | 3 ++- src/gigaam_onnx/__init__.py | 4 ++++ 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4be029d..11b2262 100644 --- a/README.md +++ b/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] -``` \ No newline at end of file +``` diff --git a/pyproject.toml b/pyproject.toml index c5af59c..98a37ac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", diff --git a/src/gigaam_onnx/__init__.py b/src/gigaam_onnx/__init__.py index e69de29..b8d5607 100644 --- a/src/gigaam_onnx/__init__.py +++ b/src/gigaam_onnx/__init__.py @@ -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