Skip to content

Commit

Permalink
Fix error caused by running without ggml_time_init
Browse files Browse the repository at this point in the history
If you do not initialise the ggml timer on windows the exe will crash due to
uninitialised variables - see
ggerganov#166
  • Loading branch information
ravenscroftj committed Jun 12, 2023
1 parent 1848e6c commit 6c4fe0e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions examples/codegen/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@


int main(int argc, char ** argv) {
ggml_time_init();
const int64_t t_main_start_us = ggml_time_us();

gpt_params params;
Expand Down
2 changes: 1 addition & 1 deletion examples/codegen/serve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ crow::response serve_response(gpt_params params, gptj_model &model, gpt_vocab &v
}

int main(int argc, char** argv) {

ggml_time_init();
gpt_params params;
params.model = "models/gpt-j-6B/ggml-model.bin";

Expand Down

0 comments on commit 6c4fe0e

Please sign in to comment.