huggingface / candle

Minimalist ML framework for Rust
Apache License 2.0
15.91k stars 963 forks source link

Shape mismatch in where_cond #2586

Closed jiabochao closed 3 weeks ago

jiabochao commented 3 weeks ago

When I tried to modify the moondream example to load the model once and call the run method multiple times for different images

https://github.com/huggingface/candle/blob/139ff56aeb1a6bbf0ed742f936a7a96bebccfa30/candle-examples/examples/moondream/main.rs#L348

The first image processed correctly, but an error occurred with the second image.

 shape mismatch in where_cond, lhs: [32, 750, 750], rhs: [32, 750, 1593]

Could anyone please advise on how I can improve this? Is there a concept similar to context, or is it necessary to reload the model every time currently? Thank you.