-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for TrOCR Model #1303
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a great addition, thanks! Just one small nitpick.
Merged, thanks a lot! Would be great to advertise this new model a bit if you felt like posting on twitter / reddit / discord so that potential users are aware of its existance. |
Thanks for nice addition! Anyway I have some issue for let vb = {
let model = match args.model {
Some(model) => std::path::PathBuf::from(model),
None => match args.which {
// Somehow this one is 404
Which::Base => Api::new()?
.repo(hf_hub::Repo::with_revision(
"microsoft/trocr-base-printed".to_string(),
hf_hub::RepoType::Model,
"main".to_string(),
))
.get("model.safetensors")?,
Which::Large => Api::new()?
.repo(hf_hub::Repo::with_revision(
"microsoft/trocr-large-printed".to_string(),
hf_hub::RepoType::Model,
"main".to_string(),
))
.get("model.safetensors")?,
},
};
println!("model: {:?}", model);
unsafe { VarBuilder::from_mmaped_safetensors(&[model], DType::F32, &device)? }
}; and
i got an error
Not sure what I miss? |
Hi @katopz , I think we might be missing the encoder configurations for the large model.
|
Oh, right! Anyway I hit another error after try to change
|
Add Support for TrOCR(https://huggingface.co/microsoft/trocr-base-printed) Model