|
|
|
|
|
""" |
|
|
Download original DeepSeek-V2-Lite model and copy to our directory |
|
|
""" |
|
|
|
|
|
import os |
|
|
from huggingface_hub import snapshot_download |
|
|
import shutil |
|
|
|
|
|
|
|
|
print("Downloading original DeepSeek-V2-Lite model...") |
|
|
original_path = snapshot_download( |
|
|
repo_id="deepseek-ai/DeepSeek-V2-Lite", |
|
|
cache_dir="/tmp/deepseek_download" |
|
|
) |
|
|
|
|
|
print(f"Downloaded to: {original_path}") |
|
|
|
|
|
|
|
|
target_dir = "/mnt/weka/home/shibo.hao/feng/code/junxia/deepseekv2lite" |
|
|
|
|
|
|
|
|
files_to_copy = [ |
|
|
"model-00001-of-000004.safetensors", |
|
|
"model-00002-of-000004.safetensors", |
|
|
"model-00003-of-000004.safetensors", |
|
|
"model-00004-of-000004.safetensors", |
|
|
"model.safetensors.index.json" |
|
|
] |
|
|
|
|
|
|
|
|
print("Copying model weight files...") |
|
|
for filename in files_to_copy: |
|
|
src = os.path.join(original_path, filename) |
|
|
dst = os.path.join(target_dir, filename) |
|
|
|
|
|
if os.path.exists(src): |
|
|
print(f"Copying {filename}...") |
|
|
shutil.copy2(src, dst) |
|
|
|
|
|
size = os.path.getsize(dst) |
|
|
print(f" Size: {size / (1024**3):.2f} GB") |
|
|
else: |
|
|
print(f"Warning: {filename} not found in original model") |
|
|
|
|
|
print("Done! Model weights copied successfully.") |