Metadata-Version: 2.4
Name: hojo_asr_fa
Version: 0.1.0
Summary: HOJO ASR inference library accelerated with Flash Attention
Author-email: HojoAI <develop@hojoai.com>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/HojoAI/Hojo-ASR
Project-URL: Repository, https://github.com/HojoAI/Hojo-ASR
Keywords: asr,speech-recognition,wenet,transformers
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: flash-attn<2.9,>=2.8.3.post1
Requires-Dist: huggingface_hub<1.0,>=0.36.2
Requires-Dist: numpy<3.0,>=2.2.6
Requires-Dist: omegaconf<3.0,>=2.3.0
Requires-Dist: safetensors<0.9,>=0.8.0
Requires-Dist: soundfile<0.15,>=0.14.0
Requires-Dist: torch<2.10,>=2.9.1
Requires-Dist: torchaudio<2.10,>=2.9.1
Requires-Dist: torchcodec<0.10,>=0.9.0
Requires-Dist: transformers<4.58,>=4.57.6
Requires-Dist: openai-whisper>=20250625
Dynamic: license-file

# 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](https://pytorch.org/get-started/locally/)
and TorchAudio builds before Flash Attention:

```bash
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.post1,<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:

```bash
cd dist_env/hojo_asr_v1.5/hojo_asr_fa
python -m pip install -e .
```

## Quick start

```python
from hojo_asr_fa import HOJO_ASR

model = HOJO_ASR.load_model("/path/to/model_folder", device="cuda:0")
results = model.run_infer(["/path/to/audio.wav"], batch_size=1)

for item in results:
    print(item["key"], item["text"])
```

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`:

```python
from hojo_asr_fa.continuous_batching import ContinuousBeamEngine, FeatureLoader, FeaturePool
```

The batch evaluation entry point is `inference/infer.py`; its supporting
implementations are included in the installed package.

## Publish to PyPI

From the `asr_llm_train` repository root:

```bash
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](https://github.com/wenet-e2e/wenet)
(Apache License 2.0). Some modules are also derived from
[ESPnet](https://github.com/espnet/espnet) (Apache License 2.0).

See [NOTICE](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](LICENSE) and
[NOTICE](NOTICE) for details.
