Skip to content

Commit eff9154

Browse files
HuiGao-NVsuyoggupta
authored andcommitted
[https://nvbugs/5616189][fix] Make more cases use local cached models (NVIDIA#8935)
Signed-off-by: Hui Gao <huig@nvidia.com>
1 parent 7be446d commit eff9154

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/unittest/test_pip_install.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import sysconfig
66

77
import requests
8+
from utils.llm_data import llm_models_root
89

910

1011
def get_expected_license_files():
@@ -150,6 +151,23 @@ def install_tensorrt_llm():
150151
subprocess.check_call(install_command, shell=True)
151152

152153

154+
def create_link_for_models():
155+
models_root = llm_models_root()
156+
if not models_root.exists():
157+
print(f"ERROR: Models root {models_root} does not exist")
158+
exit(1)
159+
src_dst_dict = {
160+
# TinyLlama-1.1B-Chat-v1.0
161+
f"{models_root}/llama-models-v2/TinyLlama-1.1B-Chat-v1.0":
162+
f"{os.getcwd()}/TinyLlama/TinyLlama-1.1B-Chat-v1.0",
163+
}
164+
165+
for src, dst in src_dst_dict.items():
166+
if not os.path.islink(dst):
167+
os.makedirs(os.path.dirname(dst), exist_ok=True)
168+
os.symlink(src, dst, target_is_directory=True)
169+
170+
153171
def test_pip_install():
154172
parser = argparse.ArgumentParser(description="Check Pip Install")
155173
parser.add_argument("--wheel_path",
@@ -178,6 +196,10 @@ def test_pip_install():
178196
shell=True)
179197
print("########## Verify license files ##########")
180198
verify_license_files()
199+
200+
print("########## Create link for models ##########")
201+
create_link_for_models()
202+
181203
print("########## Test quickstart example ##########")
182204
subprocess.check_call(
183205
"python3 ../../examples/llm-api/quickstart_example.py", shell=True)

0 commit comments

Comments
 (0)