-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
94 lines (74 loc) · 3.77 KB
/
Cargo.toml
File metadata and controls
94 lines (74 loc) · 3.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
[workspace]
members = [".", "tools/quantize-kokoro", "tools/quantize-parakeet", "tools/quantize-moonshine", "tools/quantize-vad"]
[package]
name = "speech"
version = "0.1.0"
edition = "2024"
license = "Apache-2.0"
[lib]
crate-type = ["lib", "cdylib"]
path = "src/lib.rs"
[features]
default = ["fbgemm-bf16"] # CPU-optimized bf16 GEMM for all non-Metal configurations
quantized = [] # Use quantized inference (QMatMul with Q8_0/Q4K weights)
embed-assets = [] # Embed model assets in binary
qwen = [] # Enable Qwen3 text correction model (adds ~400MB to assets)
auto-transcribe-on-pause = [] # Automatically transcribe segments after detecting pause (non-default)
use-moonshine = [] # NAPI binding uses Moonshine V2 instead of Parakeet TDT
fast-cpu = ["dep:rayon"] # CPU-optimized matmul: pre-dequantize to F32 + BLAS, with rayon-parallel Q8_0 fallback
fbgemm = ["fast-cpu", "dep:fbgemm-rs"] # Additionally use fbgemm-rs AVX2/Neon packed GEMM (f32 weights)
fbgemm-bf16 = ["fbgemm"] # Use bf16-packed weights with fbgemm-rs (half memory, ~0.4% accuracy loss)
triton-metal = ["dep:candle-metal-kernels", "dep:objc2-metal"] # Use Triton-compiled Metal kernels for encoder
triton-d3d12 = ["dep:candle-d3d12-kernels"] # Use Triton-compiled HLSL kernels for encoder on D3D12
[dependencies]
anyhow = "1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
candle-core = { git = "https://github.com/jacobgorm/candle", branch = "windows" }
candle-nn = { git = "https://github.com/jacobgorm/candle", branch = "windows" }
candle-transformers = { git = "https://github.com/jacobgorm/candle", branch = "windows" }
# Tokenizer to decode Parakeet's SentencePiece/BPE tokens
tokenizers = "0.20"
hound = "3.5"
rustfft = "6.2"
num-complex = "0.4"
# For silero
safetensors = "0.4"
# For GGUF quantization and asset compression
tempfile = "3.8"
zstd = "0.13.3"
memmap2 = "0.9"
# NAPI bindings for Node.js
napi = "3.2.2"
napi-derive = "3.2.2"
log = "0.4"
once_cell = "1.21.3"
# CPU-optimized matmul (optional)
rayon = { version = "1", optional = true }
fbgemm-rs = { git = "https://github.com/jacobgorm/fbgemm-rs", branch = "main", optional = true, features = ["rayon"] }
# Triton-compiled Metal kernels (optional, macOS only)
candle-metal-kernels = { git = "https://github.com/jacobgorm/candle", branch = "windows", optional = true }
objc2-metal = { version = "0.3", optional = true }
# Triton-compiled HLSL D3D12 kernels (optional, Windows only)
candle-d3d12-kernels = { git = "https://github.com/jacobgorm/candle", branch = "windows", optional = true }
half = "2.5"
# Audio input (for mic example)
cpal = "0.15"
crossterm = "0.28"
[build-dependencies]
napi-build = "2.2.3"
[target.'cfg(target_os = "macos")'.dependencies]
candle-core = { git = "https://github.com/jacobgorm/candle", branch = "windows", features = ["metal", "accelerate"] }
candle-nn = { git = "https://github.com/jacobgorm/candle", branch = "windows", features = ["metal", "accelerate"] }
[target.'cfg(all(target_os = "linux", target_arch = "x86_64"))'.dependencies]
candle-core = { git = "https://github.com/jacobgorm/candle", branch = "windows" }
candle-nn = { git = "https://github.com/jacobgorm/candle", branch = "windows" }
[target.'cfg(target_os = "windows")'.dependencies]
candle-core = { git = "https://github.com/jacobgorm/candle", branch = "windows" }
candle-nn = { git = "https://github.com/jacobgorm/candle", branch = "windows" }
## Override candle git deps with local worktree that has D3D12 backend
#[patch."https://github.com/jacobgorm/candle"]
#candle-core = { path = "../candle/windows/candle-core" }
#candle-nn = { path = "../candle/windows/candle-nn" }
#candle-transformers = { path = "../candle/windows/candle-transformers" }
#candle-metal-kernels = { path = "../candle/windows/candle-metal-kernels" }