0.1.4.post3

This commit is contained in:
2026-09-16 00:07:29 +03:00
parent 44ee142946
commit 5043855ef8
4 changed files with 21 additions and 12 deletions
+1 -1
View File
@@ -58,7 +58,7 @@ import numpy as np
if 'CUDAExecutionProvider' in ort.get_available_providers():
provider = 'CUDAExecutionProvider'
else:
provider = 'CPUExecutionProvider"
provider = 'CPUExecutionProvider'
opts = ort.SessionOptions()
opts.intra_op_num_threads = 16
opts.execution_mode = ort.ExecutionMode.ORT_SEQUENTIAL
+12 -8
View File
@@ -4,22 +4,22 @@ authors = [
{ name = "nikto_b", email = "niktob560@yandex.ru" }
]
license = "MIT"
version = "0.1.3"
version = "0.1.4.post3"
description = "ONNX wrapper for a GigaAMASR models"
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.8"
dependencies = [
"hatchling>=1.28.0",
"numpy==2.*",
"onnxruntime==1.23.*",
"sentencepiece>=0.2.1",
"torch>=2.5,<2.9",
"torchaudio>=2.5,<2.9",
"numpy>=1.24.0",
"onnxruntime>=1.17.0",
"sentencepiece>=0.2.0",
"torch>=2.4,<2.9",
"torchaudio>=2.4,<2.9",
]
[dependency-groups]
dev = [
"scipy>=1.0.0",
"hatchling",
]
[build-system]
@@ -28,3 +28,7 @@ build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/gigaam_onnx"]
core-metadata-version = "2.4"
[tool.hatch.build.targets.sdist]
core-metadata-version = "2.4"
+3 -2
View File
@@ -76,9 +76,10 @@ class ASRABCModel(abc.ABC):
features = None
input_lengths_array = None
full_batch_size = len(all_wavs)
BATCH_MAX_SIZE = 1
while len(all_wavs) > 0:
wavs = all_wavs[:128]
all_wavs = all_wavs[128:]
wavs = all_wavs[:BATCH_MAX_SIZE]
all_wavs = all_wavs[BATCH_MAX_SIZE:]
input_lengths = []
processed_wavs = []
+5 -1
View File
@@ -30,6 +30,9 @@ class RNNTASR(ASRABCModel):
timings = []
prev_token = self.blank_idx
if len(features.shape) == 2:
features = np.expand_dims(features, axis=0)
pred_states = [
np.zeros(shape=(1, 1, self.head.decoder.pred_hidden), dtype=DTYPE),
np.zeros(shape=(1, 1, self.head.decoder.pred_hidden), dtype=DTYPE),
@@ -57,7 +60,8 @@ class RNNTASR(ASRABCModel):
log_probs = self.jointer.run(
[node.name for node in self.jointer.get_outputs()], joint_inputs
)
token = log_probs[0].argmax(-1)[0][0]
#token = log_probs[0].argmax(-1)[0][0]
token = int(log_probs[0].argmax(-1).reshape(-1)[0])
if token != self.blank_idx:
prev_token = int(token)