@@ -22,10 +22,11 @@ use crate::compute_cap::{
2222 compatible_compute_cap, get_compile_compute_cap, get_runtime_compute_cap,
2323} ;
2424use crate :: models:: {
25- BertConfig , BertModel , Dense , DenseConfig , DenseLayer , DistilBertConfig , DistilBertModel ,
26- GTEConfig , GTEModel , Gemma3Config , Gemma3Model , JinaBertModel , JinaCodeBertModel , LLamaConfig ,
27- MPNetConfig , MPNetModel , MistralConfig , Model , ModernBertConfig , ModernBertModel ,
28- NomicBertModel , NomicConfig , Qwen2Config , Qwen3Config , Qwen3Model ,
25+ BertConfig , BertModel , DebertaV2Config , DebertaV2Model , Dense , DenseConfig , DenseLayer ,
26+ DistilBertConfig , DistilBertModel , GTEConfig , GTEModel , Gemma3Config , Gemma3Model ,
27+ JinaBertModel , JinaCodeBertModel , LLamaConfig , MPNetConfig , MPNetModel , MistralConfig , Model ,
28+ ModernBertConfig , ModernBertModel , NomicBertModel , NomicConfig , Qwen2Config , Qwen3Config ,
29+ Qwen3Model ,
2930} ;
3031#[ cfg( feature = "cuda" ) ]
3132use crate :: models:: {
@@ -92,6 +93,7 @@ impl<'de> Deserialize<'de> for BertConfigWrapper {
9293#[ serde( tag = "model_type" , rename_all = "kebab-case" ) ]
9394enum Config {
9495 Bert ( BertConfigWrapper ) ,
96+ DebertaV2 ( DebertaV2Config ) ,
9597 Camembert ( BertConfig ) ,
9698 #[ serde( rename( deserialize = "distilbert" ) ) ]
9799 DistilBert ( DistilBertConfig ) ,
@@ -265,6 +267,10 @@ impl CandleBackend {
265267 Ok ( Box :: new ( BertModel :: load ( vb, & config, model_type) . s ( ) ?) )
266268 }
267269 } ,
270+ ( Config :: DebertaV2 ( config) , Device :: Cpu | Device :: Metal ( _) ) => {
271+ tracing:: info!( "Starting DebertaV2 model on {:?}" , device) ;
272+ Ok ( Box :: new ( DebertaV2Model :: load ( vb, & config, model_type) . s ( ) ?) )
273+ }
268274 (
269275 Config :: Camembert ( config) | Config :: Roberta ( config) | Config :: XlmRoberta ( config) ,
270276 Device :: Cpu | Device :: Metal ( _) ,
@@ -392,6 +398,11 @@ impl CandleBackend {
392398 }
393399 }
394400 #[ cfg( feature = "cuda" ) ]
401+ ( Config :: DebertaV2 ( config) , Device :: Cuda ( _) ) => {
402+ tracing:: info!( "Starting DebertaV2 model on {:?}" , device) ;
403+ Ok ( Box :: new ( DebertaV2Model :: load ( vb, & config, model_type) . s ( ) ?) )
404+ }
405+ #[ cfg( feature = "cuda" ) ]
395406 ( Config :: DistilBert ( config) , Device :: Cuda ( _) ) => {
396407 if cfg ! ( feature = "flash-attn" )
397408 && dtype == DType :: F16
0 commit comments