alkove 0.2.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.
- alkove-0.2.0/Cargo.lock +153 -0
- alkove-0.2.0/Cargo.toml +26 -0
- alkove-0.2.0/LICENSE +202 -0
- alkove-0.2.0/NOTICE +73 -0
- alkove-0.2.0/PKG-INFO +131 -0
- alkove-0.2.0/README.md +106 -0
- alkove-0.2.0/alkove/__init__.py +514 -0
- alkove-0.2.0/alkove/errors.py +6 -0
- alkove-0.2.0/alkove/models.py +123 -0
- alkove-0.2.0/alkove/py.typed +0 -0
- alkove-0.2.0/crates/core/Cargo.toml +13 -0
- alkove-0.2.0/crates/core/README.md +69 -0
- alkove-0.2.0/crates/core/build.rs +23 -0
- alkove-0.2.0/crates/core/models.json +40 -0
- alkove-0.2.0/crates/core/src/chain.rs +386 -0
- alkove-0.2.0/crates/core/src/cue.rs +140 -0
- alkove-0.2.0/crates/core/src/focus.rs +41 -0
- alkove-0.2.0/crates/core/src/fp.rs +88 -0
- alkove-0.2.0/crates/core/src/js.rs +137 -0
- alkove-0.2.0/crates/core/src/learner.rs +131 -0
- alkove-0.2.0/crates/core/src/level.rs +163 -0
- alkove-0.2.0/crates/core/src/lex.rs +208 -0
- alkove-0.2.0/crates/core/src/lib.rs +107 -0
- alkove-0.2.0/crates/core/src/live.rs +54 -0
- alkove-0.2.0/crates/core/src/math.rs +167 -0
- alkove-0.2.0/crates/core/src/pipeline.rs +845 -0
- alkove-0.2.0/crates/core/src/process.rs +407 -0
- alkove-0.2.0/crates/core/src/resample.rs +129 -0
- alkove-0.2.0/crates/core/src/spot/enroll.rs +173 -0
- alkove-0.2.0/crates/core/src/spot/mod.rs +398 -0
- alkove-0.2.0/crates/core/src/spot/phones.rs +166 -0
- alkove-0.2.0/crates/core/src/spot/search.rs +156 -0
- alkove-0.2.0/crates/core/src/spot/tables.rs +131 -0
- alkove-0.2.0/crates/core/src/text/mod.rs +261 -0
- alkove-0.2.0/crates/core/src/text/tables.rs +13 -0
- alkove-0.2.0/crates/core/src/timbre.rs +394 -0
- alkove-0.2.0/crates/core/src/value.rs +216 -0
- alkove-0.2.0/crates/core/tools/unicode.py +111 -0
- alkove-0.2.0/crates/engine/Cargo.toml +15 -0
- alkove-0.2.0/crates/engine/FORMAT.md +420 -0
- alkove-0.2.0/crates/engine/README.md +90 -0
- alkove-0.2.0/crates/engine/examples/bench.rs +104 -0
- alkove-0.2.0/crates/engine/fingerprints.sh +14 -0
- alkove-0.2.0/crates/engine/src/format.rs +173 -0
- alkove-0.2.0/crates/engine/src/gemm.rs +236 -0
- alkove-0.2.0/crates/engine/src/kernels.rs +921 -0
- alkove-0.2.0/crates/engine/src/lib.rs +350 -0
- alkove-0.2.0/crates/engine/src/math.rs +281 -0
- alkove-0.2.0/crates/engine/src/ops.rs +796 -0
- alkove-0.2.0/crates/engine/src/simd.rs +512 -0
- alkove-0.2.0/crates/engine/tests/kernels.rs +312 -0
- alkove-0.2.0/pyproject.toml +37 -0
- alkove-0.2.0/python/.gitignore +5 -0
- alkove-0.2.0/python/Cargo.toml +21 -0
- alkove-0.2.0/python/LICENSE +202 -0
- alkove-0.2.0/python/NOTICE +73 -0
- alkove-0.2.0/python/README.md +106 -0
- alkove-0.2.0/python/src/lib.rs +670 -0
- alkove-0.2.0/python/tests/conftest.py +4 -0
- alkove-0.2.0/python/tests/test_api.py +168 -0
- alkove-0.2.0/python/tests/test_digests.py +198 -0
- alkove-0.2.0/python/tests/test_spot.py +202 -0
- alkove-0.2.0/python/tests/test_timbre.py +88 -0
alkove-0.2.0/Cargo.lock
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "alkove-core"
|
|
7
|
+
version = "0.2.0"
|
|
8
|
+
dependencies = [
|
|
9
|
+
"alkove-engine",
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
[[package]]
|
|
13
|
+
name = "alkove-engine"
|
|
14
|
+
version = "0.2.0"
|
|
15
|
+
|
|
16
|
+
[[package]]
|
|
17
|
+
name = "alkove-python"
|
|
18
|
+
version = "0.2.0"
|
|
19
|
+
dependencies = [
|
|
20
|
+
"alkove-core",
|
|
21
|
+
"alkove-engine",
|
|
22
|
+
"pyo3",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
[[package]]
|
|
26
|
+
name = "alkove-wasm"
|
|
27
|
+
version = "0.2.0"
|
|
28
|
+
dependencies = [
|
|
29
|
+
"alkove-core",
|
|
30
|
+
"alkove-engine",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[[package]]
|
|
34
|
+
name = "heck"
|
|
35
|
+
version = "0.5.0"
|
|
36
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
37
|
+
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
38
|
+
|
|
39
|
+
[[package]]
|
|
40
|
+
name = "libc"
|
|
41
|
+
version = "0.2.191"
|
|
42
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
43
|
+
checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
|
|
44
|
+
|
|
45
|
+
[[package]]
|
|
46
|
+
name = "once_cell"
|
|
47
|
+
version = "1.21.4"
|
|
48
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
49
|
+
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
|
|
50
|
+
|
|
51
|
+
[[package]]
|
|
52
|
+
name = "portable-atomic"
|
|
53
|
+
version = "1.15.0"
|
|
54
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
55
|
+
checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
|
|
56
|
+
|
|
57
|
+
[[package]]
|
|
58
|
+
name = "proc-macro2"
|
|
59
|
+
version = "1.0.107"
|
|
60
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
61
|
+
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
|
|
62
|
+
dependencies = [
|
|
63
|
+
"unicode-ident",
|
|
64
|
+
]
|
|
65
|
+
|
|
66
|
+
[[package]]
|
|
67
|
+
name = "pyo3"
|
|
68
|
+
version = "0.30.1"
|
|
69
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
70
|
+
checksum = "229ca13b8a15bb0d1487b81ab975bfcd97513416499a8312011b6036e42e0de4"
|
|
71
|
+
dependencies = [
|
|
72
|
+
"libc",
|
|
73
|
+
"once_cell",
|
|
74
|
+
"portable-atomic",
|
|
75
|
+
"pyo3-build-config",
|
|
76
|
+
"pyo3-ffi",
|
|
77
|
+
"pyo3-macros",
|
|
78
|
+
]
|
|
79
|
+
|
|
80
|
+
[[package]]
|
|
81
|
+
name = "pyo3-build-config"
|
|
82
|
+
version = "0.30.1"
|
|
83
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
84
|
+
checksum = "70130e2b6dd1ee589a8788026a429561ca5c40fa7a2fa7914c2282eddae24700"
|
|
85
|
+
dependencies = [
|
|
86
|
+
"target-lexicon",
|
|
87
|
+
]
|
|
88
|
+
|
|
89
|
+
[[package]]
|
|
90
|
+
name = "pyo3-ffi"
|
|
91
|
+
version = "0.30.1"
|
|
92
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
93
|
+
checksum = "5e7ff73c555c286d212d4ce7e5fbda845a973c4f61bd5f160f5f2c3c2a04d1c4"
|
|
94
|
+
dependencies = [
|
|
95
|
+
"libc",
|
|
96
|
+
"pyo3-build-config",
|
|
97
|
+
]
|
|
98
|
+
|
|
99
|
+
[[package]]
|
|
100
|
+
name = "pyo3-macros"
|
|
101
|
+
version = "0.30.1"
|
|
102
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
103
|
+
checksum = "c46d2e5862c7bb8207e3b639f713dda3c499933444784154c11d013c5a691b60"
|
|
104
|
+
dependencies = [
|
|
105
|
+
"proc-macro2",
|
|
106
|
+
"pyo3-macros-backend",
|
|
107
|
+
"quote",
|
|
108
|
+
"syn",
|
|
109
|
+
]
|
|
110
|
+
|
|
111
|
+
[[package]]
|
|
112
|
+
name = "pyo3-macros-backend"
|
|
113
|
+
version = "0.30.1"
|
|
114
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
115
|
+
checksum = "38b89f066f2ae72a2aef52d1537ca2fcd104440ebfadee06e97aa90738a25b9b"
|
|
116
|
+
dependencies = [
|
|
117
|
+
"heck",
|
|
118
|
+
"proc-macro2",
|
|
119
|
+
"quote",
|
|
120
|
+
"syn",
|
|
121
|
+
]
|
|
122
|
+
|
|
123
|
+
[[package]]
|
|
124
|
+
name = "quote"
|
|
125
|
+
version = "1.0.47"
|
|
126
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
127
|
+
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
|
|
128
|
+
dependencies = [
|
|
129
|
+
"proc-macro2",
|
|
130
|
+
]
|
|
131
|
+
|
|
132
|
+
[[package]]
|
|
133
|
+
name = "syn"
|
|
134
|
+
version = "3.0.9"
|
|
135
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
136
|
+
checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
|
|
137
|
+
dependencies = [
|
|
138
|
+
"proc-macro2",
|
|
139
|
+
"quote",
|
|
140
|
+
"unicode-ident",
|
|
141
|
+
]
|
|
142
|
+
|
|
143
|
+
[[package]]
|
|
144
|
+
name = "target-lexicon"
|
|
145
|
+
version = "0.13.5"
|
|
146
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
147
|
+
checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
|
|
148
|
+
|
|
149
|
+
[[package]]
|
|
150
|
+
name = "unicode-ident"
|
|
151
|
+
version = "1.0.27"
|
|
152
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
153
|
+
checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
|
alkove-0.2.0/Cargo.toml
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[workspace]
|
|
2
|
+
members = ["crates/engine", "crates/core", "python"]
|
|
3
|
+
resolver = "2"
|
|
4
|
+
|
|
5
|
+
[workspace.package]
|
|
6
|
+
version = "0.2.0"
|
|
7
|
+
edition = "2021"
|
|
8
|
+
rust-version = "1.88"
|
|
9
|
+
license = "Apache-2.0"
|
|
10
|
+
repository = "https://github.com/alkove-ai/alkove"
|
|
11
|
+
|
|
12
|
+
[profile.release]
|
|
13
|
+
opt-level = 3
|
|
14
|
+
lto = true
|
|
15
|
+
codegen-units = 1
|
|
16
|
+
panic = "abort"
|
|
17
|
+
strip = true
|
|
18
|
+
|
|
19
|
+
# the core runs light loops around the engine: built for size
|
|
20
|
+
[profile.release.package.alkove-core]
|
|
21
|
+
opt-level = "s"
|
|
22
|
+
|
|
23
|
+
# the Python wheel: a panic raises in Python instead of ending the interpreter
|
|
24
|
+
[profile.python]
|
|
25
|
+
inherits = "release"
|
|
26
|
+
panic = "unwind"
|
alkove-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
alkove-0.2.0/NOTICE
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
Alkove
|
|
2
|
+
Copyright 2026 Eddy Bordi
|
|
3
|
+
|
|
4
|
+
This product includes software developed by third parties:
|
|
5
|
+
|
|
6
|
+
- alkove-focus-1-preview is derived from GTCRN
|
|
7
|
+
(https://github.com/Xiaobin-Rong/gtcrn), under the MIT License:
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2024 Rong Xiaobin
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
28
|
+
|
|
29
|
+
- The text tables of alkove-core (crates/core/src/text/tables.rs) are derived
|
|
30
|
+
from the Unicode Character Database 16.0, under the Unicode License v3:
|
|
31
|
+
|
|
32
|
+
UNICODE LICENSE V3
|
|
33
|
+
|
|
34
|
+
COPYRIGHT AND PERMISSION NOTICE
|
|
35
|
+
|
|
36
|
+
Copyright © 1991-2024 Unicode, Inc.
|
|
37
|
+
|
|
38
|
+
NOTICE TO USER: Carefully read the following legal agreement. BY
|
|
39
|
+
DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR
|
|
40
|
+
SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
|
|
41
|
+
TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT
|
|
42
|
+
DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
|
|
43
|
+
|
|
44
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
|
45
|
+
copy of data files and any associated documentation (the "Data Files") or
|
|
46
|
+
software and any associated documentation (the "Software") to deal in the
|
|
47
|
+
Data Files or Software without restriction, including without limitation
|
|
48
|
+
the rights to use, copy, modify, merge, publish, distribute, and/or sell
|
|
49
|
+
copies of the Data Files or Software, and to permit persons to whom the
|
|
50
|
+
Data Files or Software are furnished to do so, provided that either (a)
|
|
51
|
+
this copyright and permission notice appear with all copies of the Data
|
|
52
|
+
Files or Software, or (b) this copyright and permission notice appear in
|
|
53
|
+
associated Documentation.
|
|
54
|
+
|
|
55
|
+
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
|
|
56
|
+
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
57
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
|
58
|
+
THIRD PARTY RIGHTS.
|
|
59
|
+
|
|
60
|
+
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
|
|
61
|
+
BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
|
|
62
|
+
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
|
63
|
+
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
|
64
|
+
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA
|
|
65
|
+
FILES OR SOFTWARE.
|
|
66
|
+
|
|
67
|
+
Except as contained in this notice, the name of a copyright holder shall
|
|
68
|
+
not be used in advertising or otherwise to promote the sale, use or other
|
|
69
|
+
dealings in these Data Files or Software without prior written
|
|
70
|
+
authorization of the copyright holder.
|
|
71
|
+
|
|
72
|
+
- The Python extension is built with PyO3 (https://github.com/PyO3/pyo3) and
|
|
73
|
+
the Rust standard library, both under the Apache License 2.0 (see LICENSE).
|
alkove-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: alkove
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Classifier: Programming Language :: Python :: 3
|
|
5
|
+
Classifier: Programming Language :: Rust
|
|
6
|
+
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
|
|
7
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
8
|
+
Classifier: Operating System :: MacOS
|
|
9
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
10
|
+
Requires-Dist: numpy>=1.21
|
|
11
|
+
Requires-Dist: pytest>=7 ; extra == 'test'
|
|
12
|
+
Provides-Extra: test
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
License-File: NOTICE
|
|
15
|
+
Summary: On-device voice input: keep the user's voice, detect speech. No server, no key.
|
|
16
|
+
Keywords: voice,speech,noise-suppression,voice-isolation,target-speaker-extraction,voice-activity-detection,vad,voice-agent,on-device
|
|
17
|
+
Author: Eddy Bordi
|
|
18
|
+
License-Expression: Apache-2.0
|
|
19
|
+
Requires-Python: >=3.9
|
|
20
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
21
|
+
Project-URL: Homepage, https://alkove.ai
|
|
22
|
+
Project-URL: Issues, https://github.com/alkove-ai/alkove/issues
|
|
23
|
+
Project-URL: Repository, https://github.com/alkove-ai/alkove
|
|
24
|
+
|
|
25
|
+
# alkove
|
|
26
|
+
|
|
27
|
+
On-device voice input for Python: keep the user's voice and drop the rest (Focus), find where they speak (Cue), hear a wake word typed in 7 languages (Spot, Lex), know who is speaking (Timbre). It runs natively on the CPU, one thread per stream. No server, no key, no telemetry.
|
|
28
|
+
|
|
29
|
+
The core is the one the web SDK runs in WebAssembly: for the same 16 kHz audio, the output is the same to the bit.
|
|
30
|
+
|
|
31
|
+
> **Preview (0.x).** A minor version may break the API until 1.0; a patch never does.
|
|
32
|
+
|
|
33
|
+
**Read this first.** Alkove is made for **a near microphone and one person**: a phone, a headset, a laptop, a caller on a line. It keeps the closest voice (or the voice of a print) and removes the others. Audio is processed at 16 kHz: the output carries speech up to 8 kHz.
|
|
34
|
+
|
|
35
|
+
## Install
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
pip install alkove
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Wheels for Linux (x86-64, aarch64), macOS and Windows, Python 3.9 and later. numpy is the only dependency.
|
|
42
|
+
|
|
43
|
+
## Models
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
import alkove
|
|
47
|
+
|
|
48
|
+
models = alkove.Models.load(["focus", "cue"]) # Hugging Face at this version's revision, then the cache
|
|
49
|
+
models = alkove.Models.load(["focus", "cue"], dir="models") # a folder of .alk files, nothing on the network
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Each file is checked against the sha256 this version pins; a file that does not match raises `AlkoveError` with the code `models.hash`. `alkove.fetch()` downloads them ahead, `alkove.cache_dir()` says where they go. Load them once: a `Models` is shared by every stream, in any thread.
|
|
53
|
+
|
|
54
|
+
## A stream
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
p = alkove.Processor(models, focus=True, cue=True, rate=48000)
|
|
58
|
+
for frame in frames: # float32 or int16 numpy arrays, any length
|
|
59
|
+
part = p.push(frame)
|
|
60
|
+
send(part.audio) # 16 kHz, the user's voice only
|
|
61
|
+
for s in part.speech: # Speech(start, end), seconds from the stream's start
|
|
62
|
+
...
|
|
63
|
+
last = p.end()
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The output comes back aligned with the input: the first `part.audio` is shorter by the chain's delay (16 ms), and `end()` gives it back. `push` releases the GIL: streams in several threads run on several cores.
|
|
67
|
+
|
|
68
|
+
Options, the same as the web SDK's `Alkove.process`:
|
|
69
|
+
|
|
70
|
+
| | |
|
|
71
|
+
|---|---|
|
|
72
|
+
| `focus=True` | keep the closest voice; with `voiceprint=` (192 numbers) the voice of that print |
|
|
73
|
+
| `strength=` | 0 gives the raw mic back, 1 Focus's output (default) |
|
|
74
|
+
| `cue=` | `None` (default): speech found behind Focus; `True`: Cue on its own without Focus; `False`: no speech |
|
|
75
|
+
| `speech=alkove.SpeechParams(...)` | `confidence`, `exit_confidence`, `start_secs`, `stop_secs` |
|
|
76
|
+
| `normalize=True` | bring the voice to a steady level |
|
|
77
|
+
| `trace=True` | Focus's level every 16 ms and Cue's probability every 30 ms, in `part.trace` |
|
|
78
|
+
| `rate=` | the rate of what `push` takes; the output is always 16 kHz |
|
|
79
|
+
| `words=`, `context=` | the words Spot listens for, and where they count: `"anywhere"` (default), `"pause"`, `"both"` |
|
|
80
|
+
|
|
81
|
+
## A wake word
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
models = alkove.Models.load(["spot", "lex"])
|
|
85
|
+
lex = alkove.Lex(models)
|
|
86
|
+
word = lex.compile("Camille", "fr") # any word in fr, en, es, it, pt, ca, ro; or alkove.compile("/kamij/") without Lex
|
|
87
|
+
store(word.to_json()) # bound to this version's Spot: alkove.Word.from_json gives None for another one
|
|
88
|
+
|
|
89
|
+
listener = alkove.Listener(models, [word]) # after a pause, by default; context="anywhere" or "both"
|
|
90
|
+
for frame in mic: # 16 kHz
|
|
91
|
+
for heard in listener.push(frame): # one every 30 ms
|
|
92
|
+
for wake in heard.wakes: # {word, score, threshold, context, start, end}
|
|
93
|
+
...
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
`Processor(..., words=[word])` and `process(..., words=[word])` find the words too, behind Focus when it is on: `part.wakes`. `alkove.Enroller(models, word)` sets a word's thresholds on the user's own voice from three takes (`push` the audio, then `result()`). `lex.phonemize("amendement", "fr")` gives the likeliest pronunciations, `alkove.Lex.distance(a, b)` how far two of them are.
|
|
97
|
+
|
|
98
|
+
## A voice
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
models = alkove.Models.load(["timbre", "focus", "cue"])
|
|
102
|
+
timbre = alkove.Timbre(models)
|
|
103
|
+
me = timbre.embed(pcm) # 1.5 s of voice or more
|
|
104
|
+
same, score = alkove.Timbre.verify(me, timbre.embed(other))
|
|
105
|
+
p = alkove.Processor(models, focus=True, voiceprint=me) # Focus keeps that voice, not just the closest one
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
`alkove.VoiceprintLearner(models).offer(pcm)` learns a print from the user's speech, window by window, as the web SDK's inputs do: a window joins only if it sounds like the others. A print is bound to this version's Timbre: `alkove.Voiceprint.from_json` gives None for another one.
|
|
109
|
+
|
|
110
|
+
## A file
|
|
111
|
+
|
|
112
|
+
```python
|
|
113
|
+
r = alkove.process(models, pcm, rate=44100, focus=True, cue=True)
|
|
114
|
+
r.audio # as long as the input, at 16 kHz
|
|
115
|
+
r.speech # [Speech(start, end)]
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Real time, hop by hop
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
chain = alkove.Chain(models, gate=True) # 256 samples at 16 kHz per step
|
|
122
|
+
out, events = chain.step(hop) # events: speechstart, speechend, idle, diag
|
|
123
|
+
chain.set_voiceprint(embedding) # applied at the next silence
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
`alkove.Resampler(48000, 16000)` and `alkove.resample(pcm, 44100, 16000)` convert rates the way the core does.
|
|
127
|
+
|
|
128
|
+
## License
|
|
129
|
+
|
|
130
|
+
Code and model weights: [Apache-2.0](./LICENSE). See [NOTICE](./NOTICE). The Apache license grants no right to the Alkove name or logo: a fork may not call itself Alkove.
|
|
131
|
+
|