Skip to content

Adding fromModelDirectory methods to various models#144

Merged
lucasnewman merged 1 commit intoBlaizzy:mainfrom
ptsochantaris:missing-local-model-inits
Apr 6, 2026
Merged

Adding fromModelDirectory methods to various models#144
lucasnewman merged 1 commit intoBlaizzy:mainfrom
ptsochantaris:missing-local-model-inits

Conversation

@ptsochantaris
Copy link
Copy Markdown
Contributor

@ptsochantaris ptsochantaris commented Apr 5, 2026

Summary

There are various models in this package that contain a fromModelDirectory method to instantiate them directly from pre-downloaded locations. However they are missing from some models.

This PR adds those in a very conservative typographic manner, creating the method and using it at the tail end of the existing fromPretrained method, following the pattern in other model files. Any extra parameters that may need cross over across aside from the model URL are given the same defaults that the original fromPretrained method applies.

Notes

Some models contain nested fromPretrained calls inside their own fromPretrained method (hence now part of the new fromModelDirectory methods). This PR does not attempt to refactor those, although this would be a good candidate for a subsequent PR, to ensure that no hub API interaction takes place with those models when fromModelDirectory is used.

Copy link
Copy Markdown
Collaborator

@lucasnewman lucasnewman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This is useful and probably should have been there all along :)

@lucasnewman lucasnewman merged commit da93511 into Blaizzy:main Apr 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants