Spaces:
Running
Running
Update coder_model.py
Browse files- coder_model.py +1 -5
coder_model.py
CHANGED
|
@@ -12,15 +12,11 @@ REPO_ID = "Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF"
|
|
| 12 |
FILENAME = "qwen2.5-coder-1.5b-instruct-q8_0.gguf"
|
| 13 |
|
| 14 |
def download_if_needed(local_dir: str):
|
| 15 |
-
|
| 16 |
-
os.makedirs(local_dir, exist_ok=True)
|
| 17 |
-
except Exception as e:
|
| 18 |
-
logger.warning(f"Could not create dir {local_dir}: {e}")
|
| 19 |
local_path = os.path.join(local_dir, FILENAME)
|
| 20 |
if os.path.exists(local_path):
|
| 21 |
logger.info(f"Coder model already present: {local_path}")
|
| 22 |
return local_path
|
| 23 |
-
|
| 24 |
logger.info(f"Downloading coder model to {local_dir} ...")
|
| 25 |
path = hf_hub_download(repo_id=REPO_ID, filename=FILENAME, local_dir=local_dir)
|
| 26 |
logger.info(f"Downloaded coder: {path}")
|
|
|
|
| 12 |
FILENAME = "qwen2.5-coder-1.5b-instruct-q8_0.gguf"
|
| 13 |
|
| 14 |
def download_if_needed(local_dir: str):
|
| 15 |
+
os.makedirs(local_dir, exist_ok=True)
|
|
|
|
|
|
|
|
|
|
| 16 |
local_path = os.path.join(local_dir, FILENAME)
|
| 17 |
if os.path.exists(local_path):
|
| 18 |
logger.info(f"Coder model already present: {local_path}")
|
| 19 |
return local_path
|
|
|
|
| 20 |
logger.info(f"Downloading coder model to {local_dir} ...")
|
| 21 |
path = hf_hub_download(repo_id=REPO_ID, filename=FILENAME, local_dir=local_dir)
|
| 22 |
logger.info(f"Downloaded coder: {path}")
|