@@ -73,16 +73,30 @@ def _infer(model, prompt=None, protocol=None):
7373 args += ["-i" , protocol ]
7474 run (args )
7575
76- def _profile (model , backend = None , service_kind = None , endpoint_type = None , url = None ):
76+ def _profile (model , backend = None , endpoint_type = None , url = None ):
7777 args = ["profile" , "-m" , model ]
7878 if backend :
7979 args += ["--backend" , backend ]
80- if service_kind :
81- args += ["--service-kind" , service_kind ]
80+
8281 if endpoint_type :
8382 args += ["--endpoint-type" , endpoint_type ]
83+
8484 if url :
8585 args += ["--url" , url ]
86+
87+ # Map each model to its corresponding HuggingFace tokenizer.
88+ # For the mock model, use a real tokenizer since "mock_llm" is not available on HuggingFace.
89+ tokenizer_map = {
90+ "mock_llm" : "gpt2" ,
91+ "gpt2" : "gpt2" ,
92+ "llama-3.1-8b-instruct" : "meta-llama/Llama-3.1-8B-Instruct" ,
93+ "llama-2-7b-chat" : "meta-llama/Llama-2-7b-chat-hf" ,
94+ "llama-2-7b" : "meta-llama/Llama-2-7b-hf" ,
95+ }
96+
97+ if model in tokenizer_map :
98+ args += ["--tokenizer" , tokenizer_map [model ]]
99+
86100 # NOTE: With default parameters, genai-perf may take upwards of 1m30s or 2m to run,
87101 # so limit the genai-perf run with --request-count to reduce time for testing purposes.
88102 args += ["--synthetic-input-tokens-mean" , "100" , "--" , "--request-count" , "10" ]
0 commit comments