hojo-asr-fa 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hojo_asr_fa-0.1.0/LICENSE +201 -0
- hojo_asr_fa-0.1.0/MANIFEST.in +6 -0
- hojo_asr_fa-0.1.0/NOTICE +26 -0
- hojo_asr_fa-0.1.0/PKG-INFO +123 -0
- hojo_asr_fa-0.1.0/README.md +89 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/__init__.py +29 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/continuous_batching/__init__.py +18 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/continuous_batching/data.py +265 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/continuous_batching/engine.py +514 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/continuous_batching/kv_reorder.py +105 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/continuous_batching/runner.py +228 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/dataset.py +518 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/hf_hub_loader.py +257 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/hojo_asr_model.py +775 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/qwen3_omni_audioencoder.py +318 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/utils.py +106 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/wenet/__init__.py +7 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/wenet/efficient_conformer/__init__.py +0 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/wenet/efficient_conformer/attention.py +257 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/wenet/efficient_conformer/subsampling.py +74 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/wenet/paraformer/__init__.py +0 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/wenet/paraformer/embedding.py +14 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/wenet/squeezeformer/__init__.py +0 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/wenet/squeezeformer/conv2d.py +69 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/wenet/squeezeformer/subsampling.py +321 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/wenet/transformer/MoD.py +175 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/wenet/transformer/__init__.py +0 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/wenet/transformer/attention.py +702 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/wenet/transformer/convolution.py +157 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/wenet/transformer/embedding.py +257 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/wenet/transformer/encoder.py +728 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/wenet/transformer/encoder_layer.py +256 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/wenet/transformer/norm.py +22 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/wenet/transformer/positionwise_feed_forward.py +154 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/wenet/transformer/subsampling.py +390 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/wenet/transformer/swish.py +26 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/wenet/utils/__init__.py +0 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/wenet/utils/class_utils.py +95 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/wenet/utils/common.py +340 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/wenet/utils/mask.py +374 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa/wenet/utils/rope_utils.py +33 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa.egg-info/PKG-INFO +123 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa.egg-info/SOURCES.txt +47 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa.egg-info/dependency_links.txt +1 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa.egg-info/requires.txt +11 -0
- hojo_asr_fa-0.1.0/hojo_asr_fa.egg-info/top_level.txt +1 -0
- hojo_asr_fa-0.1.0/pyproject.toml +49 -0
- hojo_asr_fa-0.1.0/requirements.txt +13 -0
- hojo_asr_fa-0.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works, within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works, or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 HojoAI
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
hojo_asr_fa-0.1.0/NOTICE
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
hojo_asr_fa
|
|
2
|
+
Copyright 2026 HojoAI
|
|
3
|
+
|
|
4
|
+
This product bundles inference code from the WeNet project
|
|
5
|
+
(https://github.com/wenet-e2e/wenet).
|
|
6
|
+
|
|
7
|
+
WeNet
|
|
8
|
+
Copyright 2020-2023 Mobvoi Inc. and contributors.
|
|
9
|
+
Licensed under the Apache License, Version 2.0.
|
|
10
|
+
|
|
11
|
+
Portions of the bundled code under `hojo_asr_fa.wenet` are derived from ESPnet
|
|
12
|
+
(https://github.com/espnet/espnet).
|
|
13
|
+
Copyright ESPnet contributors.
|
|
14
|
+
Licensed under the Apache License, Version 2.0.
|
|
15
|
+
|
|
16
|
+
Modifications by HojoAI to the bundled WeNet-derived code include, but are not
|
|
17
|
+
limited to:
|
|
18
|
+
- Vendoring under `hojo_asr_fa.wenet` instead of a top-level `wenet` package.
|
|
19
|
+
- Removing training scripts, CLI tools, dataset pipelines, and other
|
|
20
|
+
components not required for HOJO ASR inference.
|
|
21
|
+
- Keeping only modules needed by `ConformerEncoder` inference.
|
|
22
|
+
- Replacing `hojo_asr_fa/wenet/__init__.py` to avoid importing CLI entry points.
|
|
23
|
+
|
|
24
|
+
This package is not affiliated with, endorsed by, or maintained by the
|
|
25
|
+
official WeNet project. The name "WeNet" is used only to identify the
|
|
26
|
+
origin of the included source code.
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hojo_asr_fa
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: HOJO ASR inference library accelerated with Flash Attention
|
|
5
|
+
Author-email: HojoAI <develop@hojoai.com>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/HojoAI/Hojo-ASR
|
|
8
|
+
Project-URL: Repository, https://github.com/HojoAI/Hojo-ASR
|
|
9
|
+
Keywords: asr,speech-recognition,wenet,transformers
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
18
|
+
Requires-Python: >=3.10
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
License-File: NOTICE
|
|
22
|
+
Requires-Dist: flash-attn<2.9,>=2.8.3.post1
|
|
23
|
+
Requires-Dist: huggingface_hub<1.0,>=0.36.2
|
|
24
|
+
Requires-Dist: numpy<3.0,>=2.2.6
|
|
25
|
+
Requires-Dist: omegaconf<3.0,>=2.3.0
|
|
26
|
+
Requires-Dist: safetensors<0.9,>=0.8.0
|
|
27
|
+
Requires-Dist: soundfile<0.15,>=0.14.0
|
|
28
|
+
Requires-Dist: torch<2.10,>=2.9.1
|
|
29
|
+
Requires-Dist: torchaudio<2.10,>=2.9.1
|
|
30
|
+
Requires-Dist: torchcodec<0.10,>=0.9.0
|
|
31
|
+
Requires-Dist: transformers<4.58,>=4.57.6
|
|
32
|
+
Requires-Dist: openai-whisper>=20250625
|
|
33
|
+
Dynamic: license-file
|
|
34
|
+
|
|
35
|
+
# hojo_asr_fa
|
|
36
|
+
|
|
37
|
+
HOJO ASR inference library accelerated with Flash Attention
|
|
38
|
+
|
|
39
|
+
The bundled WeNet-derived code lives under `hojo_asr_fa.wenet` (not the top-level
|
|
40
|
+
`wenet` package) to avoid import conflicts with the official WeNet project.
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
|
|
44
|
+
Requires Python 3.10+, Linux, an NVIDIA Ampere/Ada/Hopper GPU, and FFmpeg
|
|
45
|
+
shared libraries for audio decoding. Building Flash Attention requires a
|
|
46
|
+
compatible CUDA toolkit (12.0+) and C++ compiler.
|
|
47
|
+
|
|
48
|
+
Install matching CUDA-enabled [PyTorch](https://pytorch.org/get-started/locally/)
|
|
49
|
+
and TorchAudio builds before Flash Attention:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
python -m pip install "torch>=2.9.1,<2.10" "torchaudio>=2.9.1,<2.10"
|
|
53
|
+
python -m pip install "setuptools>=77.0.0" wheel packaging ninja
|
|
54
|
+
python -m pip install "flash-attn>=2.8.3.post1,<2.9" --no-build-isolation
|
|
55
|
+
python -m pip install hojo_asr_fa
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
For development, replace the last command with the following, starting from
|
|
59
|
+
the `asr_llm_train` repository root:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
cd dist_env/hojo_asr_v1.5/hojo_asr_fa
|
|
63
|
+
python -m pip install -e .
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Quick start
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
from hojo_asr_fa import HOJO_ASR
|
|
70
|
+
|
|
71
|
+
model = HOJO_ASR.load_model("/path/to/model_folder", device="cuda:0")
|
|
72
|
+
results = model.run_infer(["/path/to/audio.wav"], batch_size=1)
|
|
73
|
+
|
|
74
|
+
for item in results:
|
|
75
|
+
print(item["key"], item["text"])
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The model folder should contain:
|
|
79
|
+
|
|
80
|
+
- `merged_full_model.safetensors`
|
|
81
|
+
- `config.yaml`
|
|
82
|
+
- Subdirectories referenced in `config.yaml`
|
|
83
|
+
|
|
84
|
+
## Continuous batching
|
|
85
|
+
|
|
86
|
+
Continuous beam decoding and audio feature loading are available from
|
|
87
|
+
`hojo_asr_fa.continuous_batching`:
|
|
88
|
+
|
|
89
|
+
```python
|
|
90
|
+
from hojo_asr_fa.continuous_batching import ContinuousBeamEngine, FeatureLoader, FeaturePool
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
The batch evaluation entry point is `inference/infer.py`; its supporting
|
|
94
|
+
implementations are included in the installed package.
|
|
95
|
+
|
|
96
|
+
## Publish to PyPI
|
|
97
|
+
|
|
98
|
+
From the `asr_llm_train` repository root:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
cd dist_env/hojo_asr_v1.5/hojo_asr_fa
|
|
102
|
+
python -m pip install build twine
|
|
103
|
+
python -m build
|
|
104
|
+
python -m twine check dist/*
|
|
105
|
+
python -m twine upload dist/*
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Third-party notices
|
|
109
|
+
|
|
110
|
+
This package includes a trimmed subset of [WeNet](https://github.com/wenet-e2e/wenet)
|
|
111
|
+
(Apache License 2.0). Some modules are also derived from
|
|
112
|
+
[ESPnet](https://github.com/espnet/espnet) (Apache License 2.0).
|
|
113
|
+
|
|
114
|
+
See [NOTICE](NOTICE) for attribution and a summary of modifications to the
|
|
115
|
+
bundled code under `hojo_asr_fa.wenet`. This package is **not** the official
|
|
116
|
+
WeNet distribution and does not install a top-level `wenet` module.
|
|
117
|
+
|
|
118
|
+
## License
|
|
119
|
+
|
|
120
|
+
Copyright 2026 HojoAI.
|
|
121
|
+
|
|
122
|
+
Licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) and
|
|
123
|
+
[NOTICE](NOTICE) for details.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# hojo_asr_fa
|
|
2
|
+
|
|
3
|
+
HOJO ASR inference library accelerated with Flash Attention
|
|
4
|
+
|
|
5
|
+
The bundled WeNet-derived code lives under `hojo_asr_fa.wenet` (not the top-level
|
|
6
|
+
`wenet` package) to avoid import conflicts with the official WeNet project.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
Requires Python 3.10+, Linux, an NVIDIA Ampere/Ada/Hopper GPU, and FFmpeg
|
|
11
|
+
shared libraries for audio decoding. Building Flash Attention requires a
|
|
12
|
+
compatible CUDA toolkit (12.0+) and C++ compiler.
|
|
13
|
+
|
|
14
|
+
Install matching CUDA-enabled [PyTorch](https://pytorch.org/get-started/locally/)
|
|
15
|
+
and TorchAudio builds before Flash Attention:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
python -m pip install "torch>=2.9.1,<2.10" "torchaudio>=2.9.1,<2.10"
|
|
19
|
+
python -m pip install "setuptools>=77.0.0" wheel packaging ninja
|
|
20
|
+
python -m pip install "flash-attn>=2.8.3.post1,<2.9" --no-build-isolation
|
|
21
|
+
python -m pip install hojo_asr_fa
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
For development, replace the last command with the following, starting from
|
|
25
|
+
the `asr_llm_train` repository root:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
cd dist_env/hojo_asr_v1.5/hojo_asr_fa
|
|
29
|
+
python -m pip install -e .
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Quick start
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
from hojo_asr_fa import HOJO_ASR
|
|
36
|
+
|
|
37
|
+
model = HOJO_ASR.load_model("/path/to/model_folder", device="cuda:0")
|
|
38
|
+
results = model.run_infer(["/path/to/audio.wav"], batch_size=1)
|
|
39
|
+
|
|
40
|
+
for item in results:
|
|
41
|
+
print(item["key"], item["text"])
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The model folder should contain:
|
|
45
|
+
|
|
46
|
+
- `merged_full_model.safetensors`
|
|
47
|
+
- `config.yaml`
|
|
48
|
+
- Subdirectories referenced in `config.yaml`
|
|
49
|
+
|
|
50
|
+
## Continuous batching
|
|
51
|
+
|
|
52
|
+
Continuous beam decoding and audio feature loading are available from
|
|
53
|
+
`hojo_asr_fa.continuous_batching`:
|
|
54
|
+
|
|
55
|
+
```python
|
|
56
|
+
from hojo_asr_fa.continuous_batching import ContinuousBeamEngine, FeatureLoader, FeaturePool
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
The batch evaluation entry point is `inference/infer.py`; its supporting
|
|
60
|
+
implementations are included in the installed package.
|
|
61
|
+
|
|
62
|
+
## Publish to PyPI
|
|
63
|
+
|
|
64
|
+
From the `asr_llm_train` repository root:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
cd dist_env/hojo_asr_v1.5/hojo_asr_fa
|
|
68
|
+
python -m pip install build twine
|
|
69
|
+
python -m build
|
|
70
|
+
python -m twine check dist/*
|
|
71
|
+
python -m twine upload dist/*
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Third-party notices
|
|
75
|
+
|
|
76
|
+
This package includes a trimmed subset of [WeNet](https://github.com/wenet-e2e/wenet)
|
|
77
|
+
(Apache License 2.0). Some modules are also derived from
|
|
78
|
+
[ESPnet](https://github.com/espnet/espnet) (Apache License 2.0).
|
|
79
|
+
|
|
80
|
+
See [NOTICE](NOTICE) for attribution and a summary of modifications to the
|
|
81
|
+
bundled code under `hojo_asr_fa.wenet`. This package is **not** the official
|
|
82
|
+
WeNet distribution and does not install a top-level `wenet` module.
|
|
83
|
+
|
|
84
|
+
## License
|
|
85
|
+
|
|
86
|
+
Copyright 2026 HojoAI.
|
|
87
|
+
|
|
88
|
+
Licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) and
|
|
89
|
+
[NOTICE](NOTICE) for details.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright 2026 HojoAI
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
#
|
|
16
|
+
|
|
17
|
+
"""HOJO ASR: speech recognition with audio encoder, Conformer adapter, and causal LM."""
|
|
18
|
+
|
|
19
|
+
__version__ = "0.1.2"
|
|
20
|
+
from hojo_asr_fa.hf_hub_loader import HuggingFaceResourceLoader, ModelAssets, load_model as load_model_assets
|
|
21
|
+
from hojo_asr_fa.hojo_asr_model import HOJO_ASR
|
|
22
|
+
__all__ = ["HOJO_ASR", "__version__"]
|
|
23
|
+
__all__ = [
|
|
24
|
+
"HOJO_ASR",
|
|
25
|
+
"HuggingFaceResourceLoader",
|
|
26
|
+
"ModelAssets",
|
|
27
|
+
"load_model_assets",
|
|
28
|
+
"__version__",
|
|
29
|
+
]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""Data preparation and continuous beam decoding for HOJO ASR inference."""
|
|
2
|
+
|
|
3
|
+
from .data import FeatureLoader, FeaturePool, Record, load_audio_list, sort_by_duration
|
|
4
|
+
from .engine import ContinuousBeamEngine
|
|
5
|
+
from .runner import PromptBuilder, log_timing, transcribe, warmup_frontend
|
|
6
|
+
|
|
7
|
+
__all__ = [
|
|
8
|
+
"ContinuousBeamEngine",
|
|
9
|
+
"FeatureLoader",
|
|
10
|
+
"FeaturePool",
|
|
11
|
+
"PromptBuilder",
|
|
12
|
+
"Record",
|
|
13
|
+
"load_audio_list",
|
|
14
|
+
"log_timing",
|
|
15
|
+
"sort_by_duration",
|
|
16
|
+
"transcribe",
|
|
17
|
+
"warmup_frontend",
|
|
18
|
+
]
|