hojo_asr_fa
HOJO ASR inference library accelerated with Flash Attention
The bundled WeNet-derived code lives under hojo_asr_fa.wenet (not the top-level
wenet package) to avoid import conflicts with the official WeNet project.
Installation
Requires Python 3.10+, Linux, an NVIDIA Ampere/Ada/Hopper GPU, and FFmpeg
shared libraries for audio decoding. Building Flash Attention requires a
compatible CUDA toolkit (12.0+) and C++ compiler.
Install matching CUDA-enabled PyTorch
and TorchAudio builds before Flash Attention:
python -m pip install "torch>=2.9.1,<2.10" "torchaudio>=2.9.1,<2.10"
python -m pip install "setuptools>=77.0.0" wheel packaging ninja
python -m pip install "flash-attn>=2.8.3,<2.9" --no-build-isolation
python -m pip install hojo_asr_fa
For development, replace the last command with the following, starting from
the asr_llm_train repository root:
cd dist_env/hojo_asr_v1.5/hojo_asr_fa
python -m pip install -e .
Quick start
from hojo_asr_fa import HOJO_ASR
model = HOJO_ASR.load_model("/path/to/model_folder", device=0)
results = model.run_infer(["/path/to/audio.wav"], batch_size=1)
for item in results:
print(item["key"], item["text"])
device must be an integer GPU index (0, 1, ...), or a negative integer for CPU loading.
With CUDA_VISIBLE_DEVICES=4, device=0 selects physical GPU 4.
The default Flash Attention encoder still requires a supported CUDA GPU for inference.
The model folder should contain:
merged_full_model.safetensors
config.yaml
- Subdirectories referenced in
config.yaml
Continuous batching
Continuous beam decoding and audio feature loading are available from
hojo_asr_fa.continuous_batching:
from hojo_asr_fa.continuous_batching import ContinuousBeamEngine, FeatureLoader, FeaturePool
Publish to PyPI
From the asr_llm_train repository root:
cd dist_env/hojo_asr_v1.5/hojo_asr_fa
python -m pip install build twine
python -m build
python -m twine check dist/*
python -m twine upload dist/*
Third-party notices
This package includes a trimmed subset of WeNet
(Apache License 2.0). Some modules are also derived from
ESPnet (Apache License 2.0).
See NOTICE for attribution and a summary of modifications to the
bundled code under hojo_asr_fa.wenet. This package is not the official
WeNet distribution and does not install a top-level wenet module.
License
Copyright 2026 HojoAI.
Licensed under the Apache License, Version 2.0. See LICENSE and
NOTICE for details.