Skip to content

Commit 0d76d92

Browse files
committed
upgraded whisper-rs fails to build on my mac
1 parent dc78877 commit 0d76d92

File tree

4 files changed

+15
-21
lines changed

4 files changed

+15
-21
lines changed

src-tauri/Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ natural = "0.5.0"
6363
version = "=2.0.0-rc.9"
6464

6565
[target.'cfg(target_os = "macos")'.dependencies]
66-
whisper-rs = { version = "0.14.4", features = ["metal", "log_backend"] }
66+
whisper-rs = { version = "0.15.0", features = ["metal", "log_backend"] }
6767

6868
[target.'cfg(target_os = "windows")'.dependencies]
69-
whisper-rs = { version = "0.14.4", features = ["vulkan", "log_backend"] }
69+
whisper-rs = { version = "0.15.0", features = ["vulkan", "log_backend"] }
7070

7171
[target.'cfg(target_os = "linux")'.dependencies]
72-
whisper-rs = { version = "0.14.4", features = ["vulkan", "log_backend"] }
72+
whisper-rs = { version = "0.15.0", features = ["vulkan", "log_backend"] }
7373

7474
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
7575
tauri-plugin-autostart = "2"

src-tauri/src/managers/transcription.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,10 @@ impl TranscriptionManager {
287287
let settings = get_settings(&self.app_handle);
288288

289289
// Initialize parameters
290-
let mut params = FullParams::new(SamplingStrategy::default());
290+
let mut params = FullParams::new(SamplingStrategy::BeamSearch {
291+
beam_size: 5,
292+
patience: -1.0,
293+
});
291294
let language = Some(settings.selected_language.as_str());
292295
params.set_language(language);
293296
params.set_print_special(false);
@@ -303,19 +306,10 @@ impl TranscriptionManager {
303306
params.set_translate(true);
304307
}
305308

306-
state
307-
.full(params, &audio)
308-
.expect("failed to convert samples");
309+
state.full(params, &audio).expect("failed to run model");
309310

310-
let num_segments = state
311-
.full_n_segments()
312-
.expect("failed to get number of segments");
313-
314-
for i in 0..num_segments {
315-
let segment = state
316-
.full_get_segment_text(i)
317-
.expect("failed to get segment");
318-
result.push_str(&segment);
311+
for segment in state.as_iter() {
312+
result.push_str(segment.to_str().expect("failed to get string from segment"));
319313
}
320314

321315
// Apply word correction if custom words are configured

src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"macOS": {
4343
"files": {},
4444
"hardenedRuntime": true,
45-
"minimumSystemVersion": "10.13",
45+
"minimumSystemVersion": "10.15",
4646
"signingIdentity": "-",
4747
"entitlements": "Entitlements.plist"
4848
},

0 commit comments

Comments
 (0)