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

Check that model_save_name exists before trying to load it, to avoid confusing checkpoint error #39

Merged
merged 1 commit into from
May 1, 2023

Conversation

TheBloke
Copy link
Contributor

@TheBloke TheBloke commented May 1, 2023

Very simple fix that checks that the model exists before trying to load it.

Without this, if the user passes the wrong folder/file name, they get this error:

ValueError: `checkpoint` should be the path to a file containing a whole state dict, or the index of a sharded checkpoint, or a folder containing a sharded checkpoint, but got /workspace/stable-vicuna-13B-GPTQ/stable-vicuna-13B-GPTQ-4bit1.latest.act-order.safetensors.

I found this quite confusing because it does not clearly indicate that the file was not found at all.

With this PR, the user will now get:

FileNotFoundError: Could not find model at /workspace/stable-vicuna-13B-GPTQ/stable-vicuna-13B-GPTQ-4bit1.latest.act-order.safetensors

Copy link
Collaborator

@PanQiWei PanQiWei left a comment

Choose a reason for hiding this comment

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

Great! This will make error message clearer for users to understand what's actually going wrong.

@PanQiWei PanQiWei merged commit 144bd80 into AutoGPTQ:main May 1, 2023
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.

None yet

2 participants