diff options
author | Georgi Gerganov <ggerganov@gmail.com> | 2024-01-23 14:12:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-23 14:12:57 +0200 |
commit | 89758723c75ba594e401f6513751beeba7ca1d28 (patch) | |
tree | 25555096747a2c44c5d8bdee6a67af43c8f2afb9 /common/common.cpp | |
parent | 2bed4aa3f37cb4e39e16e9ec7b595a7738fd5faf (diff) |
minor : clean-up some warnings and style (#5094)
* minor : clean-up some warnings and style
ggml-ci
* ggml : add comment
Diffstat (limited to 'common/common.cpp')
-rw-r--r-- | common/common.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/common/common.cpp b/common/common.cpp index 0a709617..6b07f119 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -216,12 +216,10 @@ bool gpt_params_parse_ex(int argc, char ** argv, gpt_params & params) { } // store the external file name in params params.prompt_file = argv[i]; - file.seekg(0, std::ios::end); - size_t size = file.tellg(); - file.seekg(0, std::ios::beg); - params.prompt.resize(size); - file.read((char *)params.prompt.data(), size); - fprintf(stderr, "Read %zu bytes from binary file %s\n", size, argv[i]); + std::ostringstream ss; + ss << file.rdbuf(); + params.prompt = ss.str(); + fprintf(stderr, "Read %zu bytes from binary file %s\n", params.prompt.size(), argv[i]); } else if (arg == "-f" || arg == "--file") { if (++i >= argc) { invalid_param = true; |