Uunan commited on
Commit
7edcc51
·
verified ·
1 Parent(s): 0917586

Update download_model.py

Browse files
Files changed (1) hide show
  1. download_model.py +18 -16
download_model.py CHANGED
@@ -1,22 +1,24 @@
 
1
  from huggingface_hub import hf_hub_download
2
- import shutil, os
3
 
4
- REPO = "unsloth/Qwen2.5-VL-7B-Instruct-GGUF"
5
- FILENAME = "Qwen2.5-VL-7B-Instruct-Q4_K_M.gguf"
 
6
 
7
- os.makedirs("model", exist_ok=True)
 
 
 
 
8
 
9
- print("Model indiriliyor...")
10
 
11
- path = hf_hub_download(
12
- repo_id=REPO,
13
- filename=FILENAME,
14
- local_dir="model"
15
- )
 
16
 
17
- dst = os.path.join("model", FILENAME)
18
-
19
- if path != dst:
20
- shutil.move(path, dst)
21
-
22
- print("Model indirildi:", dst)
 
1
+ import os
2
  from huggingface_hub import hf_hub_download
 
3
 
4
+ MODEL_REPO = "Qwen/Qwen2.5-3B-Instruct-GGUF"
5
+ FILE_NAME = "qwen2.5-3b-instruct-q4_k_m.gguf"
6
+ LOCAL_PATH = f"model/{FILE_NAME}"
7
 
8
+ def download_model():
9
+ # Eğer model zaten varsa indirmeden devam et
10
+ if os.path.exists(LOCAL_PATH):
11
+ print(f"📁 Model zaten mevcut, indirme atlandı: {LOCAL_PATH}")
12
+ return LOCAL_PATH
13
 
14
+ print("🔽 Model indiriliyor...")
15
 
16
+ downloaded = hf_hub_download(
17
+ repo_id=MODEL_REPO,
18
+ filename=FILE_NAME,
19
+ local_dir="model",
20
+ local_dir_use_symlinks=False
21
+ )
22
 
23
+ print(f"✅ Model indirildi: {downloaded}")
24
+ return downloaded