Browse Source
- Using more specific `LoadWeightsFailedException` when a llava model fails to load (#697)
- Passing model path, instead of a message, to `LoadWeightsFailedException` constructor
pull/700/head
Martin Evans
GitHub
1 year ago
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
2 additions and
2 deletions
-
LLama/Native/SafeLlamaModelHandle.cs
-
LLama/Native/SafeLlavaModelHandle.cs
|
|
|
@@ -121,7 +121,7 @@ namespace LLama.Native |
|
|
|
throw new InvalidOperationException($"Model file '{modelPath}' is not readable"); |
|
|
|
|
|
|
|
return llama_load_model_from_file(modelPath, lparams) |
|
|
|
?? throw new LoadWeightsFailedException($"Failed to load model {modelPath}."); |
|
|
|
?? throw new LoadWeightsFailedException(modelPath); |
|
|
|
} |
|
|
|
|
|
|
|
#region native API |
|
|
|
|
|
|
|
@@ -53,7 +53,7 @@ namespace LLama.Native |
|
|
|
throw new InvalidOperationException($"Llava MMP Model file '{modelPath}' is not readable"); |
|
|
|
|
|
|
|
return clip_model_load(modelPath, verbosity) |
|
|
|
?? throw new RuntimeError($"Failed to load LLaVa model {modelPath}."); |
|
|
|
?? throw new LoadWeightsFailedException(modelPath); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|