Skip to content

Commit 13ebffb

Browse files
committed
update: exclude support for metal device
1 parent f54126c commit 13ebffb

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

backends/candle/src/lib.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,15 @@ impl CandleBackend {
229229
"Qwen2 is only supported on Cuda devices in fp16 with flash attention enabled"
230230
.to_string(),
231231
)),
232-
(Config::MPNet(config), Device::Cpu | Device::Metal(_)) => {
233-
tracing::info!("Starting MPNet model on {:?}", device);
234-
Ok(Box::new(MPNetModel::load(vb, &config, model_type).s()?))
235-
}
232+
(Config::MPNet(config), Device::Cpu | Device::Metal(_)) => match device {
233+
Device::Cpu => {
234+
tracing::info!("Starting MPNet model on {:?}", device);
235+
Ok(Box::new(MPNetModel::load(vb, &config, model_type).s()?))
236+
}
237+
_ => Err(BackendError::Start(
238+
"MPNet is only supported on CPU devices in fp32".to_string(),
239+
)),
240+
},
236241
#[cfg(feature = "cuda")]
237242
(Config::Bert(config), Device::Cuda(_)) => {
238243
if cfg!(any(feature = "flash-attn", feature = "flash-attn-v1"))

0 commit comments

Comments
 (0)