Skip to content

Conversation

@dt-yuhui
Copy link

Hi there,

This PR addresses an issue that prevents loading certain models like MUSK and Hibou-Large from local checkpoints.

The Problem:

The current implementation of BasePatchEncoder._get_weights_path includes a validation step (ensure_valid_weights_path) that strictly requires the weights path to be a single file. However, the specific load functions for MUSK and Hibou-Large require a path to a directory, not a single checkpoint file. This strict file check makes it impossible to load these models from a local path.

The Solution:

To resolve this, I have commented out the call to ensure_valid_weights_path within _get_weights_path.

This is a minimal change that makes the loading mechanism more flexible. It allows the function to return a path to a directory, which is the expected behavior for loading these types of models. The existing logic for handling single-file checkpoints remains unaffected.

This enhancement will make it much easier for users to work with a broader range of local models, especially in offline environments.

Thanks for your consideration!

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.

1 participant