Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Slim-LM] Add BaseLoader and SafeTensorLoader #1108

Closed
wants to merge 1 commit into from

Conversation

LeshengJin
Copy link
Contributor

Loading safetensor is similar to the process of loading pytorch, so most of codes in HFTorchLoader could be reused in SafeTensor, or other future loaders. To enhanced code reusability, This PR introduces BaseLoader, a container for common helper functions used across multiple loaders. For different loaders, customization would focus on two methods, __init__ and _load_shard(self, path: Path). _load_shard loads parameters from path and yield their values.

@LeshengJin
Copy link
Contributor Author

Redirect to #1113

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