Skip to content

Commit

Permalink
SAMPLES: fix benchmark_genai to have required args (#1541)
Browse files Browse the repository at this point in the history
Otherwise, it's easy to make a mistake like:
```bash
$ /home/devuser/ilavreno/openvino/bin/intel64/Debug/benchmark_genai /home/devuser/ilavreno/models/share-05-1/WW02_llm-optimum_2025.0.0-17771/llama-3-8b/pytorch/ov/OV_FP16-INT4_SYM
Check 'ov_tokenizer || ov_detokenizer' failed at /home/devuser/ilavreno/openvino.genai/src/cpp/src/tokenizer.cpp:196:
Neither tokenizer nor detokenzier models were provided
```
  • Loading branch information
ilya-lavrenov authored Jan 14, 2025
1 parent f578a9b commit b284111
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions samples/cpp/text_generation/benchmark_genai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ int main(int argc, char* argv[]) try {
cxxopts::Options options("benchmark_vanilla_genai", "Help command");

options.add_options()
("m,model", "Path to model and tokenizers base directory", cxxopts::value<std::string>()->default_value("."))
("m,model", "Path to model and tokenizers base directory", cxxopts::value<std::string>())
("p,prompt", "Prompt", cxxopts::value<std::string>()->default_value("The Sky is blue because"))
("nw,num_warmup", "Number of warmup iterations", cxxopts::value<size_t>()->default_value(std::to_string(1)))
("n,num_iter", "Number of iterations", cxxopts::value<size_t>()->default_value(std::to_string(3)))
Expand Down Expand Up @@ -60,7 +60,7 @@ int main(int argc, char* argv[]) try {
std::cout << "TPOT: " << metrics.get_tpot().mean << " ± " << metrics.get_tpot().std << " ms/token " << std::endl;
std::cout << "Throughput: " << metrics.get_throughput().mean << " ± " << metrics.get_throughput().std << " tokens/s" << std::endl;

return 0;
return EXIT_SUCCESS;
} catch (const std::exception& error) {
try {
std::cerr << error.what() << '\n';
Expand Down
2 changes: 1 addition & 1 deletion samples/python/text_generation/benchmark_genai.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

def main():
parser = argparse.ArgumentParser(description="Help command")
parser.add_argument("-m", "--model", type=str, help="Path to model and tokenizers base directory")
parser.add_argument("-m", "--model", type=str, required=True, help="Path to model and tokenizers base directory")
parser.add_argument("-p", "--prompt", type=str, default="The Sky is blue because", help="Prompt")
parser.add_argument("-nw", "--num_warmup", type=int, default=1, help="Number of warmup iterations")
parser.add_argument("-n", "--num_iter", type=int, default=2, help="Number of iterations")
Expand Down

0 comments on commit b284111

Please sign in to comment.