File size: 1,005 Bytes
995e681
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import shutil
import tensorrt_llm
from pathlib import Path

trtllm_path = Path(tensorrt_llm.__file__).parent
target_dir = trtllm_path / "models"

print(f"TensorRT-LLM path: {trtllm_path}")
print(f"Target models directory: {target_dir}")

target_dir.mkdir(parents=True, exist_ok=True)

patch_dir = Path("./patch")

patch_files = list(patch_dir.glob('*'))
if patch_files:
    print(f"Copying {len(patch_files)} patch file(s) to tensorrt_llm/models")

    for patch_file in patch_files:
        target_path = target_dir / patch_file.name
        if patch_file.is_file():
            shutil.copy2(patch_file, target_path)
            print(f"  Copied: {patch_file.name}")
        elif patch_file.is_dir():
            if target_path.exists():
                shutil.rmtree(target_path)
            shutil.copytree(patch_file, target_path)
            print(f"  Copied directory: {patch_file.name}")

    print(f"✓ Patch files copied successfully")
else:
    print(f"⚠ No patch files found in {patch_dir}")