Handle optional tensors
Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
This commit is contained in:
parent
c34a5deee8
commit
1c931f3d4f
1 changed files with 5 additions and 1 deletions
|
@ -3114,7 +3114,11 @@ struct llama_model_loader {
|
|||
}
|
||||
|
||||
struct ggml_tensor * get_tensor_meta(const char * name) const {
|
||||
return get_weights(name).tensor;
|
||||
try {
|
||||
return get_weights(name).tensor;
|
||||
} catch (const std::runtime_error & e) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
struct ggml_tensor * get_tensor_meta(int i) const {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue