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
parent
commit
ecb359c9e7
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      LLama/Native/SafeLlamaModelHandle.cs
  2. +1
    -1
      LLama/Native/SafeLlavaModelHandle.cs

+ 1
- 1
LLama/Native/SafeLlamaModelHandle.cs View File

@@ -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


+ 1
- 1
LLama/Native/SafeLlavaModelHandle.cs View File

@@ -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>


Loading…
Cancel
Save