Skip to content

Commit 2d1bbdf

Browse files
committed
fix(execution): parse DICTEE_FORCE_CPU as truthy, not presence (release 1.3)
cuda_runtime_available() used var_os(...).is_some(), so the value "0" written by dictee-setup's Force CPU toggle when OFF was still treated as "force CPU" — silently disabling the GPU for Parakeet/Canary on any user who opened and applied the ASR settings page (the default state). Parse "1"/"true"/"yes" as truthy, like the Whisper daemon already does and as save_config's own comment already claims. Backport of master's existing implementation. Fixes the v1.3.5 regression introduced with the Force CPU toggle.
1 parent 7c157e9 commit 2d1bbdf

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/execution.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,14 @@ impl ModelConfig {
207207
/// and bypasses ort's own provider-list fallback.
208208
///
209209
/// Honors `DICTEE_FORCE_CPU` as a manual override.
210+
/// Truthy values that force CPU: "1", "true" / "TRUE", "yes". Anything else
211+
/// (including "0", "false", "no", empty) means "let me use GPU if available".
210212
#[cfg(feature = "cuda")]
211213
pub fn cuda_runtime_available() -> bool {
212-
if std::env::var_os("DICTEE_FORCE_CPU").is_some() {
214+
if std::env::var("DICTEE_FORCE_CPU")
215+
.map(|v| matches!(v.to_ascii_lowercase().as_str(), "1" | "true" | "yes"))
216+
.unwrap_or(false)
217+
{
213218
return false;
214219
}
215220
// Primary probe: NVIDIA driver populates one dir per GPU under

0 commit comments

Comments
 (0)