Closed fsa3z closed 9 months ago
Thanks for head up, already made a PR with printed supported.
cargo run --example trocr --release -- --which base-hand-written --cpu --image candle-examples/examples/trocr/assets/trocr.png
cargo run --example trocr --release -- --which large-hand-written --cpu --image candle-examples/examples/trocr/assets/trocr.png
cargo run --example trocr --release -- --which base-printed --cpu --image candle-examples/examples/trocr/assets/printed-number.jpg
cargo run --example trocr --release -- --which large-printed --cpu --image candle-examples/examples/trocr/assets/printed-number.jpg
got
Error: cannot find tensor decoder.model.decoder.embed_positions.weight
Any idea on this one?
I've just merged #1689 which instead of using an hardcoded config gets it from the HF hub. This should make it easier to add more supported models in the future if compatible architectures appear.
For the large-printed
model, the trickiness is that the position embeddings are not learnt but rather hardcoded in the model. I've made the error message be more specific about it and will look at adding support for this.
Closing this now as hopefully it's all good, feel free to re-open if you run into further issues.
Hi,
the trouble came from :
Which::Large is build with the same config as Which::Base