mirror of
https://github.com/huggingface/candle.git
synced 2025-06-22 12:28:06 +00:00
Add support for TrOCR Model (#1303)
* add bce with logit loss * add bce with logit loss * remove imports * fix tiny bug * add test documentation and refactor function * fix test cases and formatting * add trocr model * fix formatting * commit the actual model lol * more formatting * remove tokenizer config
This commit is contained in:
16
candle-examples/examples/trocr/readme.md
Normal file
16
candle-examples/examples/trocr/readme.md
Normal file
@ -0,0 +1,16 @@
|
||||
# candle-trocr
|
||||
|
||||
`TrOCR` is a transformer OCR Model. In this example it is used to
|
||||
transcribe image text. See the associated [model
|
||||
card](https://huggingface.co/microsoft/trocr-base-printed) for details on
|
||||
the model itself.
|
||||
|
||||
## Running an example
|
||||
|
||||
```bash
|
||||
cargo run --example trocr --release -- --which base --cpu --image assets/trocr.png
|
||||
```
|
||||
|
||||
```
|
||||
<s> industry , Mr. Brown commented icily . " Let us have a</s>
|
||||
```
|
Reference in New Issue
Block a user