cohere-transcribe 0.1.2 → 0.1.3
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +9 -7
- data/ext/cohere_transcribe_native/.gitignore +6 -0
- data/ext/cohere_transcribe_native/CMakeLists.txt +8 -0
- data/ext/cohere_transcribe_native/audio_abi.cpp +20 -0
- data/ext/cohere_transcribe_native/audio_exports.macos +1 -0
- data/ext/cohere_transcribe_native/audio_exports.map +1 -0
- data/ext/cohere_transcribe_native/test/abi_smoke.rb +26 -0
- data/lib/cohere/transcribe/alignment/aligner.rb +40 -7
- data/lib/cohere/transcribe/asr/native.rb +43 -97
- data/lib/cohere/transcribe/audio/decoder.rb +184 -75
- data/lib/cohere/transcribe/audio/ffmpeg_native.rb +84 -32
- data/lib/cohere/transcribe/audio/segmentation.rb +1 -0
- data/lib/cohere/transcribe/cli.rb +30 -22
- data/lib/cohere/transcribe/configuration.rb +13 -0
- data/lib/cohere/transcribe/constants.rb +1 -1
- data/lib/cohere/transcribe/doctor.rb +2 -1
- data/lib/cohere/transcribe/hub.rb +446 -58
- data/lib/cohere/transcribe/input.rb +18 -3
- data/lib/cohere/transcribe/internal/interruptible_native_call.rb +70 -0
- data/lib/cohere/transcribe/internal/session_ownership.rb +61 -0
- data/lib/cohere/transcribe/internal/utf8.rb +19 -0
- data/lib/cohere/transcribe/model_identity.rb +10 -1
- data/lib/cohere/transcribe/output/publication.rb +95 -86
- data/lib/cohere/transcribe/pytorch_checkpoint.rb +38 -22
- data/lib/cohere/transcribe/runtime/engine.rb +37 -16
- data/lib/cohere/transcribe/runtime/preparation.rb +212 -35
- data/lib/cohere/transcribe/runtime/resources.rb +28 -62
- data/lib/cohere/transcribe/state/checkpoint.rb +3 -2
- data/lib/cohere/transcribe/state/io.rb +217 -117
- data/lib/cohere/transcribe/state/locking.rb +383 -64
- data/lib/cohere/transcribe/state/manifest.rb +21 -22
- data/lib/cohere/transcribe/types.rb +25 -11
- data/lib/cohere/transcribe/version.rb +1 -1
- data/sig/cohere/transcribe.rbs +1 -0
- metadata +5 -1
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require_relative "constants"
|
|
4
|
+
require_relative "internal/utf8"
|
|
5
|
+
|
|
3
6
|
module Cohere
|
|
4
7
|
module Transcribe
|
|
5
8
|
module TypesSupport
|
|
6
|
-
DEFAULT_ASR_MODEL_ID =
|
|
7
|
-
OUTPUT_FORMATS =
|
|
9
|
+
DEFAULT_ASR_MODEL_ID = Cohere::Transcribe::DEFAULT_ASR_MODEL_ID
|
|
10
|
+
OUTPUT_FORMATS = Cohere::Transcribe::OUTPUT_FORMATS
|
|
8
11
|
EXISTING_POLICIES = %w[error overwrite skip].freeze
|
|
9
12
|
|
|
10
13
|
module KeywordOnlyConstructor
|
|
@@ -47,10 +50,21 @@ module Cohere
|
|
|
47
50
|
immutable(array)
|
|
48
51
|
end
|
|
49
52
|
|
|
50
|
-
def
|
|
53
|
+
def reference(value)
|
|
54
|
+
source = value.respond_to?(:to_path) ? value.to_path : value
|
|
55
|
+
return immutable(value) unless source.is_a?(String)
|
|
56
|
+
|
|
57
|
+
text = Internal::UTF8.normalize(source)
|
|
58
|
+
text ? text.freeze : immutable(source)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def path(value, field: "path")
|
|
51
62
|
source = value.respond_to?(:to_path) ? value.to_path : value
|
|
52
|
-
|
|
53
|
-
|
|
63
|
+
raise TypeError, "#{field} must resolve to a text path" unless source.is_a?(String)
|
|
64
|
+
|
|
65
|
+
text = Internal::UTF8.normalize(source)
|
|
66
|
+
raise ArgumentError, "#{field} must contain valid UTF-8" unless text
|
|
67
|
+
|
|
54
68
|
absolute = text.start_with?("/")
|
|
55
69
|
prefix = if text.start_with?("//") && !text.start_with?("///")
|
|
56
70
|
"//"
|
|
@@ -84,9 +98,9 @@ module Cohere
|
|
|
84
98
|
|
|
85
99
|
super(
|
|
86
100
|
formats: formats,
|
|
87
|
-
output_dir: output_dir.nil? ? nil : TypesSupport.path(output_dir),
|
|
101
|
+
output_dir: output_dir.nil? ? nil : TypesSupport.path(output_dir, field: "output_dir"),
|
|
88
102
|
existing: TypesSupport.immutable(existing),
|
|
89
|
-
profile_json: profile_json.nil? ? nil : TypesSupport.path(profile_json)
|
|
103
|
+
profile_json: profile_json.nil? ? nil : TypesSupport.path(profile_json, field: "profile_json")
|
|
90
104
|
)
|
|
91
105
|
end
|
|
92
106
|
end
|
|
@@ -183,10 +197,10 @@ module Cohere
|
|
|
183
197
|
publication: nil
|
|
184
198
|
)
|
|
185
199
|
super(
|
|
186
|
-
model: TypesSupport.
|
|
187
|
-
model_revision: TypesSupport.
|
|
188
|
-
adapter: TypesSupport.
|
|
189
|
-
adapter_revision: TypesSupport.
|
|
200
|
+
model: TypesSupport.reference(model),
|
|
201
|
+
model_revision: TypesSupport.reference(model_revision),
|
|
202
|
+
adapter: TypesSupport.reference(adapter),
|
|
203
|
+
adapter_revision: TypesSupport.reference(adapter_revision),
|
|
190
204
|
language: TypesSupport.immutable(language),
|
|
191
205
|
text_only: text_only,
|
|
192
206
|
recursive: recursive,
|
data/sig/cohere/transcribe.rbs
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cohere-transcribe
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ali Hamdi Ali Fadel
|
|
@@ -88,6 +88,7 @@ files:
|
|
|
88
88
|
- THIRD_PARTY_NOTICES.md
|
|
89
89
|
- exe/cohere-transcribe
|
|
90
90
|
- exe/cohere-transcribe-doctor
|
|
91
|
+
- ext/cohere_transcribe_native/.gitignore
|
|
91
92
|
- ext/cohere_transcribe_native/CMakeLists.txt
|
|
92
93
|
- ext/cohere_transcribe_native/README.md
|
|
93
94
|
- ext/cohere_transcribe_native/audio_abi.cpp
|
|
@@ -130,6 +131,9 @@ files:
|
|
|
130
131
|
- lib/cohere/transcribe/gguf_writer.rb
|
|
131
132
|
- lib/cohere/transcribe/hub.rb
|
|
132
133
|
- lib/cohere/transcribe/input.rb
|
|
134
|
+
- lib/cohere/transcribe/internal/interruptible_native_call.rb
|
|
135
|
+
- lib/cohere/transcribe/internal/session_ownership.rb
|
|
136
|
+
- lib/cohere/transcribe/internal/utf8.rb
|
|
133
137
|
- lib/cohere/transcribe/licenses/crispasr.txt
|
|
134
138
|
- lib/cohere/transcribe/loader.rb
|
|
135
139
|
- lib/cohere/transcribe/model_identity.rb
|