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

litgpt download ..model_name... --convert_checkpoint false is performing conversion #1791

Open
wiiiktor opened this issue Oct 13, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@wiiiktor
Copy link

Bug description

The command
litgpt download ..model_name... --convert_checkpoint false
is performing conversion and deletes the safetensor files (my workaround is to terminate work after safetensors are downloaded, just before they are deleted):
image

What operating system are you using?

Unknown

LitGPT Version


Version: 0.4.13

@wiiiktor wiiiktor added the bug Something isn't working label Oct 13, 2024
@rasbt rasbt added enhancement New feature or request and removed bug Something isn't working labels Oct 21, 2024
@rasbt
Copy link
Collaborator

rasbt commented Oct 21, 2024

Thanks for reporting!

The --convert_checkpoint false flag is not for the .safetensor file conversion but for the HF -> LitGPT conversion.

Some models on the HF Hub have .bin files and some have .safetensor files. So, for simplicity, .safetensor files are always converted to .bin files as a first step (this is part of the download logic, not the checkpoint conversion logic, so it happens whether --convert_checkpoint is true or false.

To prevent the .safetensor files from being deleted, you could comment out the following line:

os.remove(safetensor_path)

Anyways, thanks for reporting this though. It would be nice to improve the HF -> LitGPT conversion logic some time to read from .safetensor files directly (I do that in some of my other code bases too and should be too hard).

@wiiiktor
Copy link
Author

Just after converting from safetensor to bin, I terminate this operation and safetensor files stay in my folder ;) Anyway, thanks for explanation. Safetensor files are oftentimes handy, as in practice I use various tools/libraries and some of them use safetensors instead of bins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants