Garden-AI / garden

https://garden-ai.readthedocs.io
MIT License
20 stars 4 forks source link

Make it more convenient to import code from Hugging Face repos #349

Closed WillEngler closed 11 months ago

WillEngler commented 11 months ago

This is quality of life improvement that came up while working on a PyTorch seedling. (https://github.com/Garden-AI/seedlings/issues/14)

Overview

This PR makes it so that, by default, Hugging Face download paths are added to sys.path, letting users import Python modules from their Hugging Face repos. In practice this is a helpful way to share model class definition files for PyTorch.

Discussion

Any additional context that you think is important for reviewers or future users/contributors looking at this PR.

Testing

I co-developed this with the torch seedling and confirmed it worked in that context: https://github.com/Garden-AI/seedlings/pull/17

Documentation

No docs for this yet


:books: Documentation preview :books:: https://garden-ai--349.org.readthedocs.build/en/349/

codecov-commenter commented 11 months ago

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (8a01e46) 78.51% compared to head (4bead9f) 78.46%.

Files Patch % Lines
garden_ai/model_connectors/hugging_face.py 60.00% 2 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #349 +/- ## ========================================== - Coverage 78.51% 78.46% -0.06% ========================================== Files 41 41 Lines 2183 2187 +4 ========================================== + Hits 1714 1716 +2 - Misses 469 471 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.