aboutsummaryrefslogtreecommitdiff
path: root/utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils.cpp')
-rw-r--r--utils.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/utils.cpp b/utils.cpp
index be81c6c..320d7c3 100644
--- a/utils.cpp
+++ b/utils.cpp
@@ -40,6 +40,9 @@ bool gpt_params_parse(int argc, char ** argv, gpt_params & params) {
} else if (arg == "-f" || arg == "--file") {
std::ifstream 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();
+ }
} else if (arg == "-n" || arg == "--n_predict") {
params.n_predict = std::stoi(argv[++i]);
} else if (arg == "--top_k") {