candle-lora icon indicating copy to clipboard operation
candle-lora copied to clipboard

Flux Model

Open AlpineVibrations opened this issue 1 year ago • 1 comments

Adding the macros to the Flux Model gives error that it is now expecting an Arc

mismatched types
expected struct `Arc<(dyn LinearLayerLike + 'static)>`
   found struct `candle_nn::Linear

do we need to modify the model code or are we missing something?

AlpineVibrations avatar Dec 16 '24 21:12 AlpineVibrations

I tried adding Arc::new to the fields but i still get this error

the trait bound `Arc<dyn LinearLayerLike>: Module` is not satisfied
the following other types implement trait `Module`:
  AttentionBlock
  BeitVisionTransformer
  BertLMPredictionHead
  BertOnlyMLMHead
  ChineseClipVisionEmbeddings
  ChineseClipVisionTransformer
  ClipVisionTransformer
  Conv1d
and 131 others
required for `Arc<dyn LinearLayerLike>` to implement `Module`

at a few spot like this on the qkv apply

  fn qkv(&self, xs: &Tensor) -> Result<(Tensor, Tensor, Tensor)> {
        let qkv = xs.apply(&self.qkv)?;

AlpineVibrations avatar Dec 16 '24 22:12 AlpineVibrations