Conversation
rwood-97
left a comment
There was a problem hiding this comment.
Hi Jihye,
I've added a few small comments.
Could you also have a go at updating the docs, this is the file you'd need to edit: https://github.com/maps-as-data/MapReader/blob/main/docs/source/using-mapreader/step-by-step-guide/4-classify/train.rst
The unit tests are failing at the moment but this isn't your fault - it is a dependency issue I think so I will try fix these in a separate branch.
The only one you need to fix is the check changelog test, this basically checks you've updated the changelog CHANGELOG.md as part of your PR. To fix it you just need to update the CHANGELOG.md file with your changes.
Thanks for doing this :)
|
Hi Jihye, I've just fixed the issue with the tests failing. Can you run the following commands to incorportate these changes into your PR: |
|
Hi Rosie, |
Summary
This pull request adds support for Hugging Face models within the
ClassifierContainer. Previously, users had to manually load Hugging Face models and feature extractors before passing them to the container. Now, by simply passing a Hugging Face repository path and setting thehuggingface=Trueflag, the container handles the initialization automatically. (It is a part of the participation in the hut101 opportunities)Fixes #192
Describe your changes
ClassifierContainer.__init__: Added ahuggingfaceboolean flag (defaulting toFalse).transformerslibrary:AutoModelForImageClassification.from_pretrained.ignore_mismatched_sizes=Trueto allow easy fine-tuning on custom labels.self.is_inception = Falsefor HF models to bypass legacy Inception-specific logic while maintaining the existing_get_logitsworkflow.getattrto dynamically setself.input_sizefrom the processor's configuration, ensuring compatibility across different HF models.Checklist before assigning a reviewer (update as needed)
Reviewer checklist
Please add anything you want reviewers to specifically focus/comment on.