MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT-LLM / prepare_model_tests

Function prepare_model_tests

tests/unittest/bindings/binding_test_utils.py:20–40  ·  view source on GitHub ↗
(
    llm_root: _pl.Path,
    resource_path: _pl.Path,
    model_name: str,
    model_cache_arg=[],
)

Source from the content-addressed store, hash-verified

18
19
20def prepare_model_tests(
21 llm_root: _pl.Path,
22 resource_path: _pl.Path,
23 model_name: str,
24 model_cache_arg=[],
25):
26 scripts_dir = resource_path / "scripts"
27 python_exe = _sys.executable
28 model_env = {**_os.environ, "PYTHONPATH": f"examples/{model_name}"}
29 build_engines = [
30 python_exe,
31 str(scripts_dir / f"build_{model_name}_engines.py")
32 ] + model_cache_arg
33 run_command(build_engines, cwd=llm_root, env=model_env)
34
35 model_env["PYTHONPATH"] = "examples"
36 generate_expected_output = [
37 python_exe,
38 str(scripts_dir / f"generate_expected_{model_name}_output.py")
39 ]
40 run_command(generate_expected_output, cwd=llm_root, env=model_env)
41
42
43def prepare_lora_configs(llm_root: _pl.Path, resource_path: _pl.Path,

Callers 2

model_filesFunction · 0.70
model_filesFunction · 0.50

Calls 1

run_commandFunction · 0.70

Tested by

no test coverage detected