diff --git a/common/common.cpp b/common/common.cpp index 5e9f7fa05..6d0dce601 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -2099,8 +2099,7 @@ struct llama_model * llama_load_model_from_url( } if(params.hf_token!=NULL){ - struct curl_slist *headers = NULL; - headers = curl_slist_append(headers, "Authorization: Bearer " + params.hf_token); + struct curl_slist * headers = curl_slist_append(NULL, "Authorization: Bearer " + params.hf_token); curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); } diff --git a/common/common.h b/common/common.h index cca44268e..81b873cec 100644 --- a/common/common.h +++ b/common/common.h @@ -98,6 +98,7 @@ struct gpt_params { std::string model_url = ""; // model url to download std::string hf_repo = ""; // HF repo std::string hf_file = ""; // HF file + std::string hf_token = ""; // HF token std::string prompt = ""; std::string prompt_file = ""; // store the external prompt file name std::string path_prompt_cache = ""; // path to file for saving/loading prompt eval state