Skip to content

Commit 0059325

Browse files
pytorchbotlucylq
andauthored
Add data path to runner (#10460)
This PR was created by the merge bot to help merge the original PR into the main branch. ghstack PR number: #10445 by @lucylq ^ Please use this as the source of truth for the PR details, comments, and reviews ghstack PR base: https://github.com/pytorch/executorch/tree/gh/lucylq/66/base ghstack PR head: https://github.com/pytorch/executorch/tree/gh/lucylq/66/head Merge bot PR base: https://github.com/pytorch/executorch/tree/main Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/lucylq/66/orig @diff-train-skip-merge Co-authored-by: lucylq <[email protected]>
1 parent b504ba2 commit 0059325

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

examples/models/llama/main.cpp

+8-1
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)