summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/common.cpp2
-rw-r--r--common/common.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/common/common.cpp b/common/common.cpp
index 186f5b26..60b00b5f 100644
--- a/common/common.cpp
+++ b/common/common.cpp
@@ -167,6 +167,8 @@ bool gpt_params_parse(int argc, char ** argv, gpt_params & params) {
invalid_param = true;
break;
}
+ // store the external file name in params
+ params.prompt_file = argv[i];
std::copy(std::istreambuf_iterator<char>(file), std::istreambuf_iterator<char>(), back_inserter(params.prompt));
if (params.prompt.back() == '\n') {
params.prompt.pop_back();
diff --git a/common/common.h b/common/common.h
index e095c56e..c8021527 100644
--- a/common/common.h
+++ b/common/common.h
@@ -79,6 +79,7 @@ struct gpt_params {
std::string model_draft = ""; // draft model for speculative decoding
std::string model_alias = "unknown"; // model alias
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
std::string input_prefix = ""; // string to prefix user inputs with
std::string input_suffix = ""; // string to suffix user inputs with