From b79a41ee6a3366267ed1f43b864a5793a740cbbb Mon Sep 17 00:00:00 2001 From: Sourabrata Bose Date: Fri, 19 Apr 2024 13:53:19 +0530 Subject: [PATCH] feat : Adding hf_token declaration and user input support --- common/common.cpp | 3 +-- common/common.h | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) 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