8000 fix: check model pointer validity before use (#13631) · foldl/llama.cpp@9c55e5c · GitHub
[go: up one dir, main page]

Skip to content

Commit 9c55e5c

Browse files
authored
fix: check model pointer validity before use (ggml-org#13631)
1 parent 33d7aed commit 9c55e5c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/simple/simple.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ int main(int argc, char ** argv) {
8484
model_params.n_gpu_layers = ngl;
8585

8686
llama_model * model = llama_model_load_from_file(model_path.c_str(), model_params);
87-
const llama_vocab * vocab = llama_model_get_vocab(model);
8887

8988
if (model == NULL) {
9089
fprintf(stderr , "%s: error: unable to load model\n" , __func__);
9190
return 1;
9291
}
9392

93+
const llama_vocab * vocab = llama_model_get_vocab(model);
9494
// tokenize the prompt
9595

9696
// find the number of tokens in the prompt

0 commit comments

Comments
 (0)
0