Skip to content

Commit c24ec7d

Browse files
committed
Add data path to runner
Pull Request resolved: #10445 ^ ghstack-source-id: 280183822 @exported-using-ghexport Differential Revision: [D73617661](https://our.internmc.facebook.com/intern/diff/D73617661/)
1 parent 1432243 commit c24ec7d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

examples/models/llama/main.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ DEFINE_string(
2020
"llama2.pte",
2121
"Model serialized in flatbuffer format.");
2222

23+
DEFINE_string(data_path, "", "Data file for the model.");
24+
2325
DEFINE_string(tokenizer_path, "tokenizer.bin", "Tokenizer stuff.");
2426

2527
DEFINE_string(prompt, "The answer to the ultimate question is", "Prompt.");
@@ -49,6 +51,11 @@ int32_t main(int32_t argc, char** argv) {
4951
// and users can create their own DataLoaders to load from arbitrary sources.
5052
const char* model_path = FLAGS_model_path.c_str();
5153

54+
std::optional<std::string> data_path = std::nullopt;
55+
if (!FLAGS_data_path.empty()) {
56+
data_path = FLAGS_data_path.c_str();
57+
}
58+
5259
const char* tokenizer_path = FLAGS_tokenizer_path.c_str();
5360

5461
const char* prompt = FLAGS_prompt.c_str();
@@ -74,7 +81,7 @@ int32_t main(int32_t argc, char** argv) {
7481
#endif
7582
// create llama runner
7683
// @lint-ignore CLANGTIDY facebook-hte-Deprecated
77-
example::Runner runner(model_path, tokenizer_path);
84+
example::Runner runner(model_path, tokenizer_path, data_path);
7885

7986
if (warmup) {
8087
// @lint-ignore CLANGTIDY facebook-hte-Deprecated

0 commit comments

Comments
 (0)