-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat!: New API for models initialization with accelerators parameters. Use HF implementation for LayoutPredictor. Migrate models to safetensors format. #50
Conversation
Signed-off-by: Christoph Auer <[email protected]>
Signed-off-by: Christoph Auer <[email protected]>
Signed-off-by: Nikos Livathinos <[email protected]>
Signed-off-by: Nikos Livathinos <[email protected]>
Signed-off-by: Nikos Livathinos <[email protected]>
…layout_predictor_jit.py The safe tensors version is the layout_predictor.py Signed-off-by: Nikos Livathinos <[email protected]>
Signed-off-by: Nikos Livathinos <[email protected]>
…text files with the predictions Signed-off-by: Nikos Livathinos <[email protected]>
…t_predictor_jit.py Signed-off-by: Nikos Livathinos <[email protected]>
Signed-off-by: Nikos Livathinos <[email protected]>
Signed-off-by: Nikos Livathinos <[email protected]>
Signed-off-by: Nikos Livathinos <[email protected]>
…youtPredictor Signed-off-by: Nikos Livathinos <[email protected]>
Signed-off-by: Nikos Livathinos <[email protected]>
Signed-off-by: Nikos Livathinos <[email protected]>
Signed-off-by: Nikos Livathinos <[email protected]>
Signed-off-by: Nikos Livathinos <[email protected]>
Signed-off-by: Nikos Livathinos <[email protected]>
…e measurements Signed-off-by: Nikos Livathinos <[email protected]>
Signed-off-by: Nikos Livathinos <[email protected]>
… num_threads. Remove envvars. Update unit tests. Signed-off-by: Nikos Livathinos <[email protected]>
…g. Improve demo_layout_predictor Signed-off-by: Nikos Livathinos <[email protected]>
pyproject.toml
Outdated
@@ -24,6 +24,8 @@ packages = [ | |||
python = "^3.9" | |||
torch = "^2.2.2" | |||
torchvision = "^0" | |||
transformers = "^4.46.2" |
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.
RT-DETR was published in 4.42.0 would that be a good initial version?
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.
I just tried it with 4.42.0
and it seems to work and pass the tests. I guess we can lower the version.
pyproject.toml
Outdated
@@ -24,6 +24,8 @@ packages = [ | |||
python = "^3.9" | |||
torch = "^2.2.2" | |||
torchvision = "^0" | |||
transformers = "^4.46.2" | |||
accelerate = "^1.1.1" |
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.
it doesn't seem to be imported. do we need it?
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.
The accelerate
module is used internally by the HF RT-DETR implementation and we need to install it, otherwise we receive an error message to do it.
I have refactored the code so that the accelerate
package is not needed.
…58) Signed-off-by: Christoph Auer <[email protected]>
Signed-off-by: Nikos Livathinos <[email protected]> Signed-off-by: Christoph Auer <[email protected]>
Signed-off-by: Nikos Livathinos <[email protected]> Signed-off-by: Christoph Auer <[email protected]>
Signed-off-by: Nikos Livathinos <[email protected]> Signed-off-by: Christoph Auer <[email protected]>
Signed-off-by: Nikos Livathinos <[email protected]> Signed-off-by: Christoph Auer <[email protected]>
Signed-off-by: Nikos Livathinos <[email protected]> Signed-off-by: Christoph Auer <[email protected]>
…ests. Signed-off-by: Nikos Livathinos <[email protected]> Signed-off-by: Christoph Auer <[email protected]>
Signed-off-by: Nikos Livathinos <[email protected]> Signed-off-by: Christoph Auer <[email protected]>
Signed-off-by: Nikos Livathinos <[email protected]> Signed-off-by: Christoph Auer <[email protected]>
Signed-off-by: Christoph Auer <[email protected]>
Signed-off-by: Nikos Livathinos <[email protected]> Signed-off-by: Christoph Auer <[email protected]>
Signed-off-by: Nikos Livathinos <[email protected]> Signed-off-by: Christoph Auer <[email protected]>
5c232b2
to
8d8c2f8
Compare
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.
LGTM!
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.
LGTM!
Signed-off-by: Christoph Auer <[email protected]>
This PR includes the following tasks:
LayoutPredictor
that uses the HF API and safe tensors checkpoint.torch.jit
implementation and the new HF + safe tensors are the same (labels, bboxes).LayoutPredictor
to use the safe tensors implementation and improve the output.Links:
https://huggingface.co/docs/transformers/model_doc/rt_detr
Checklist:
conventional commits.