|
5 | 5 | import sysconfig |
6 | 6 |
|
7 | 7 | import requests |
| 8 | +from utils.llm_data import llm_models_root |
8 | 9 |
|
9 | 10 |
|
10 | 11 | def get_expected_license_files(): |
@@ -150,6 +151,23 @@ def install_tensorrt_llm(): |
150 | 151 | subprocess.check_call(install_command, shell=True) |
151 | 152 |
|
152 | 153 |
|
| 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 | + |
153 | 171 | def test_pip_install(): |
154 | 172 | parser = argparse.ArgumentParser(description="Check Pip Install") |
155 | 173 | parser.add_argument("--wheel_path", |
@@ -178,6 +196,10 @@ def test_pip_install(): |
178 | 196 | shell=True) |
179 | 197 | print("########## Verify license files ##########") |
180 | 198 | verify_license_files() |
| 199 | + |
| 200 | + print("########## Create link for models ##########") |
| 201 | + create_link_for_models() |
| 202 | + |
181 | 203 | print("########## Test quickstart example ##########") |
182 | 204 | subprocess.check_call( |
183 | 205 | "python3 ../../examples/llm-api/quickstart_example.py", shell=True) |
|
0 commit comments