Garden-AI / garden

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

Pin commit hash in model connectors (#455) #464

Closed hholb closed 1 month ago

hholb commented 1 month ago

resolves #455

Related: #454

Overview

Both HFConnector and GitHubConnector now attempt to retrieve a commit hash from their remote repos and store it in their ModelMetadata.model_version when instantiated. If no commmit hash is found, a ConnectorInvalidRevisionError is raised.

The pinned commit hash is then used when stage() is called to pull down the same model each time the entrypoint is run.

Discussion

In GitHubConnector I am using the github api to get the commit info. This only works with public repos.

Testing

New unit tests in tests/test_models.py confirm the commit hash is correctly stored and used within stage().

Documentation

No documentation updated.


📚 Documentation preview 📚: https://garden-ai--464.org.readthedocs.build/en/464/

codecov-commenter commented 1 month ago

Codecov Report

Attention: Patch coverage is 89.70588% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 75.94%. Comparing base (cd758d8) to head (45ebff4).

Files Patch % Lines
garden_ai/model_connectors/github_conn.py 80.95% 4 Missing :warning:
garden_ai/model_connectors/hugging_face.py 83.33% 2 Missing :warning:
garden_ai/model_connectors/exceptions.py 66.66% 1 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 #464 +/- ## ========================================== + Coverage 75.42% 75.94% +0.52% ========================================== Files 50 51 +1 Lines 3198 3264 +66 ========================================== + Hits 2412 2479 +67 + Misses 786 785 -1 ```

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