transcribe-cpp 0.0.10__tar.gz → 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.
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/PKG-INFO +3 -3
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/pyproject.toml +3 -3
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/src/transcribe_cpp/__init__.py +7 -1
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/src/transcribe_cpp/_generated.py +5 -3
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/.gitignore +0 -0
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/LICENSE +0 -0
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/README.md +0 -0
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/_generate/README.md +0 -0
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/_generate/check_version_sync.py +0 -0
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/_generate/generate.py +0 -0
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/examples/stream_wav.py +0 -0
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/examples/transcribe_wav.py +0 -0
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/src/transcribe_cpp/_abi.py +0 -0
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/src/transcribe_cpp/_library.py +0 -0
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/src/transcribe_cpp/errors.py +0 -0
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/src/transcribe_cpp/py.typed +0 -0
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/tests/conftest.py +0 -0
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/tests/test_abi.py +0 -0
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/tests/test_backends.py +0 -0
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/tests/test_device_select.py +0 -0
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/tests/test_errors.py +0 -0
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/tests/test_example.py +0 -0
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/tests/test_family_ext.py +0 -0
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/tests/test_lifetime.py +0 -0
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/tests/test_pcm.py +0 -0
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/tests/test_provider_discovery.py +0 -0
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/tests/test_streaming.py +0 -0
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/tests/test_transcribe.py +0 -0
- {transcribe_cpp-0.0.10 → transcribe_cpp-0.1.0}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: transcribe-cpp
|
|
3
|
-
Version: 0.0
|
|
3
|
+
Version: 0.1.0
|
|
4
4
|
Summary: Python bindings for transcribe.cpp
|
|
5
5
|
Project-URL: Homepage, https://github.com/handy-computer/transcribe.cpp
|
|
6
6
|
Project-URL: Repository, https://github.com/handy-computer/transcribe.cpp
|
|
@@ -21,9 +21,9 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
21
21
|
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
|
|
22
22
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
23
23
|
Requires-Python: >=3.9
|
|
24
|
-
Requires-Dist: transcribe-cpp-native==0.0
|
|
24
|
+
Requires-Dist: transcribe-cpp-native==0.1.0.*
|
|
25
25
|
Provides-Extra: cu12
|
|
26
|
-
Requires-Dist: transcribe-cpp-native-cu12==0.0
|
|
26
|
+
Requires-Dist: transcribe-cpp-native-cu12==0.1.0.*; extra == 'cu12'
|
|
27
27
|
Provides-Extra: test
|
|
28
28
|
Requires-Dist: numpy; extra == 'test'
|
|
29
29
|
Requires-Dist: pytest>=7; extra == 'test'
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "transcribe-cpp"
|
|
7
|
-
version = "0.0
|
|
7
|
+
version = "0.1.0"
|
|
8
8
|
description = "Python bindings for transcribe.cpp"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
# 3.8 is EOL (2024-10); 3.9 is the floor. The binding is ctypes-only, so there
|
|
@@ -34,13 +34,13 @@ classifiers = [
|
|
|
34
34
|
# packaging fix still resolves); the import-time version/header-hash check in
|
|
35
35
|
# _library.py is the runtime backstop. check_version_sync.py gates this pin
|
|
36
36
|
# against include/transcribe.h.
|
|
37
|
-
dependencies = ["transcribe-cpp-native==0.0
|
|
37
|
+
dependencies = ["transcribe-cpp-native==0.1.0.*"]
|
|
38
38
|
|
|
39
39
|
[project.optional-dependencies]
|
|
40
40
|
# Opt-in accelerator providers — ADDITIVE: they install alongside the default
|
|
41
41
|
# provider and the best one wins at runtime. Same base-version pin contract
|
|
42
42
|
# as the hard dependency (gated by check_version_sync.py).
|
|
43
|
-
cu12 = ["transcribe-cpp-native-cu12==0.0
|
|
43
|
+
cu12 = ["transcribe-cpp-native-cu12==0.1.0.*"]
|
|
44
44
|
# Test-only deps. Run with: uv run --extra test pytest (from bindings/python).
|
|
45
45
|
# numpy is here so the numpy PCM-input tests run in every lane instead of
|
|
46
46
|
# silently skipping wherever numpy happens to be absent.
|
|
@@ -46,7 +46,7 @@ from .errors import (
|
|
|
46
46
|
raise_for_status,
|
|
47
47
|
)
|
|
48
48
|
|
|
49
|
-
__version__ = "0.0
|
|
49
|
+
__version__ = "0.1.0"
|
|
50
50
|
|
|
51
51
|
# String-enum types, exported so callers (and type checkers) can name them.
|
|
52
52
|
Backend = Literal["auto", "cpu", "metal", "vulkan", "cpu_accel", "cuda"]
|
|
@@ -474,6 +474,7 @@ class Capabilities:
|
|
|
474
474
|
supports_streaming: bool
|
|
475
475
|
supports_spec_decode: bool
|
|
476
476
|
max_audio_ms: int
|
|
477
|
+
translate_target_languages: tuple[str, ...]
|
|
477
478
|
|
|
478
479
|
|
|
479
480
|
@dataclass(frozen=True)
|
|
@@ -847,6 +848,10 @@ class Model:
|
|
|
847
848
|
if caps.languages and caps.n_languages > 0:
|
|
848
849
|
for i in range(caps.n_languages):
|
|
849
850
|
languages.append(_decode(caps.languages[i]))
|
|
851
|
+
translate_targets = []
|
|
852
|
+
if caps.translate_target_languages and caps.n_translate_target_languages > 0:
|
|
853
|
+
for i in range(caps.n_translate_target_languages):
|
|
854
|
+
translate_targets.append(_decode(caps.translate_target_languages[i]))
|
|
850
855
|
return Capabilities(
|
|
851
856
|
native_sample_rate=caps.native_sample_rate,
|
|
852
857
|
languages=tuple(languages),
|
|
@@ -856,6 +861,7 @@ class Model:
|
|
|
856
861
|
supports_streaming=bool(caps.supports_streaming),
|
|
857
862
|
supports_spec_decode=bool(caps.supports_spec_decode),
|
|
858
863
|
max_audio_ms=caps.max_audio_ms,
|
|
864
|
+
translate_target_languages=tuple(translate_targets),
|
|
859
865
|
)
|
|
860
866
|
|
|
861
867
|
def supports(self, feature: Feature) -> bool:
|
|
@@ -13,7 +13,7 @@ import ctypes as _c
|
|
|
13
13
|
# Stable digest of the ABI surface below (structs, enums, macros, layout,
|
|
14
14
|
# prototypes). A native provider package echoes this back so the API
|
|
15
15
|
# package can reject an ABI-mismatched provider before dlopen.
|
|
16
|
-
PUBLIC_HEADER_HASH = "
|
|
16
|
+
PUBLIC_HEADER_HASH = "86b16dd97ad1cb58"
|
|
17
17
|
|
|
18
18
|
# === enum constants ===
|
|
19
19
|
TRANSCRIBE_OK = 0
|
|
@@ -153,7 +153,7 @@ transcribe_backend_device._fields_ = [("struct_size", _c.c_uint64), ("name", _c.
|
|
|
153
153
|
transcribe_model_load_params._fields_ = [("struct_size", _c.c_uint64), ("backend", _c.c_int), ("gpu_device", _c.c_int)]
|
|
154
154
|
transcribe_session_params._fields_ = [("struct_size", _c.c_uint64), ("n_threads", _c.c_int), ("kv_type", _c.c_int), ("n_ctx", _c.c_int32)]
|
|
155
155
|
transcribe_run_params._fields_ = [("struct_size", _c.c_uint64), ("task", _c.c_int), ("timestamps", _c.c_int), ("pnc", _c.c_int), ("itn", _c.c_int), ("language", _c.c_char_p), ("target_language", _c.c_char_p), ("keep_special_tags", _c.c_bool), ("family", _c.POINTER(transcribe_ext)), ("spec_k_drafts", _c.c_int32)]
|
|
156
|
-
transcribe_capabilities._fields_ = [("struct_size", _c.c_uint64), ("native_sample_rate", _c.c_int32), ("n_languages", _c.c_int), ("languages", _c.POINTER(_c.c_char_p)), ("max_timestamp_kind", _c.c_int), ("supports_language_detect", _c.c_bool), ("supports_translate", _c.c_bool), ("supports_streaming", _c.c_bool), ("supports_spec_decode", _c.c_bool), ("max_audio_ms", _c.c_int64)]
|
|
156
|
+
transcribe_capabilities._fields_ = [("struct_size", _c.c_uint64), ("native_sample_rate", _c.c_int32), ("n_languages", _c.c_int), ("languages", _c.POINTER(_c.c_char_p)), ("max_timestamp_kind", _c.c_int), ("supports_language_detect", _c.c_bool), ("supports_translate", _c.c_bool), ("supports_streaming", _c.c_bool), ("supports_spec_decode", _c.c_bool), ("max_audio_ms", _c.c_int64), ("n_translate_target_languages", _c.c_int), ("translate_target_languages", _c.POINTER(_c.c_char_p))]
|
|
157
157
|
transcribe_session_limits._fields_ = [("struct_size", _c.c_uint64), ("effective_n_ctx", _c.c_int32), ("effective_max_audio_ms", _c.c_int64), ("max_kv_bytes", _c.c_int64)]
|
|
158
158
|
transcribe_stream_params._fields_ = [("struct_size", _c.c_uint64), ("family", _c.POINTER(transcribe_ext)), ("commit_policy", _c.c_int), ("stable_prefix_agreement_n", _c.c_uint32)]
|
|
159
159
|
transcribe_stream_update._fields_ = [("struct_size", _c.c_uint64), ("result_changed", _c.c_bool), ("is_final", _c.c_bool), ("revision", _c.c_int32), ("input_received_ms", _c.c_int64), ("audio_committed_ms", _c.c_int64), ("buffered_ms", _c.c_int64), ("committed_changed", _c.c_bool), ("tentative_changed", _c.c_bool)]
|
|
@@ -195,7 +195,7 @@ STRUCT_LAYOUT = {
|
|
|
195
195
|
'transcribe_model_load_params': {'size': 16, 'align': 8, 'offsets': {'struct_size': 0, 'backend': 8, 'gpu_device': 12}},
|
|
196
196
|
'transcribe_session_params': {'size': 24, 'align': 8, 'offsets': {'struct_size': 0, 'n_threads': 8, 'kv_type': 12, 'n_ctx': 16}},
|
|
197
197
|
'transcribe_run_params': {'size': 64, 'align': 8, 'offsets': {'struct_size': 0, 'task': 8, 'timestamps': 12, 'pnc': 16, 'itn': 20, 'language': 24, 'target_language': 32, 'keep_special_tags': 40, 'family': 48, 'spec_k_drafts': 56}},
|
|
198
|
-
'transcribe_capabilities': {'size':
|
|
198
|
+
'transcribe_capabilities': {'size': 56, 'align': 8, 'offsets': {'struct_size': 0, 'native_sample_rate': 8, 'n_languages': 12, 'languages': 16, 'max_timestamp_kind': 24, 'supports_language_detect': 28, 'supports_translate': 29, 'supports_streaming': 30, 'supports_spec_decode': 31, 'max_audio_ms': 32, 'n_translate_target_languages': 40, 'translate_target_languages': 48}},
|
|
199
199
|
'transcribe_session_limits': {'size': 32, 'align': 8, 'offsets': {'struct_size': 0, 'effective_n_ctx': 8, 'effective_max_audio_ms': 16, 'max_kv_bytes': 24}},
|
|
200
200
|
'transcribe_stream_params': {'size': 24, 'align': 8, 'offsets': {'struct_size': 0, 'family': 8, 'commit_policy': 16, 'stable_prefix_agreement_n': 20}},
|
|
201
201
|
'transcribe_stream_update': {'size': 48, 'align': 8, 'offsets': {'struct_size': 0, 'result_changed': 8, 'is_final': 9, 'revision': 12, 'input_received_ms': 16, 'audio_committed_ms': 24, 'buffered_ms': 32, 'committed_changed': 40, 'tentative_changed': 41}},
|
|
@@ -297,6 +297,8 @@ def configure(lib):
|
|
|
297
297
|
lib.transcribe_model_load_file.argtypes = [_c.c_char_p, _c.POINTER(transcribe_model_load_params), _c.POINTER(_c.c_void_p)]
|
|
298
298
|
lib.transcribe_model_load_params_init.restype = None
|
|
299
299
|
lib.transcribe_model_load_params_init.argtypes = [_c.POINTER(transcribe_model_load_params)]
|
|
300
|
+
lib.transcribe_model_meta_val_str.restype = _c.c_char_p
|
|
301
|
+
lib.transcribe_model_meta_val_str.argtypes = [_c.c_void_p, _c.c_char_p]
|
|
300
302
|
lib.transcribe_model_supports.restype = _c.c_bool
|
|
301
303
|
lib.transcribe_model_supports.argtypes = [_c.c_void_p, _c.c_int]
|
|
302
304
|
lib.transcribe_model_variant_string.restype = _c.c_char_p
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|