fix: improve error message when LlamaModel fails to load#2187
Open
Anai-Guo wants to merge 1 commit intoabetlen:mainfrom
Open
fix: improve error message when LlamaModel fails to load#2187Anai-Guo wants to merge 1 commit intoabetlen:mainfrom
Anai-Guo wants to merge 1 commit intoabetlen:mainfrom
Conversation
When llama_model_load_from_file returns None, the error was a generic 'Failed to load model from file'. With verbose=False (the default), the llama.cpp log is suppressed, leaving users with no actionable information. The error message now: - includes the file size in GB to help diagnose OOM - lists common causes (insufficient RAM/VRAM, unsupported format, corrupt file) - suggests verbose=True to see the full llama.cpp error log - suggests n_gpu_layers=-1 for GPU offloading Fixes abetlen#2145
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2145
When
llama_model_load_from_filereturnsNone, the previous error was:With
verbose=False(the default), the llama.cpp log is suppressed, so users have no way to know why loading failed. This is particularly confusing for large BF16 models where the silent failure is typically OOM.Changes
The error message now includes:
verbose=Trueto see the llama.cpp log,n_gpu_layers=-1for GPU offloadingBefore
After