Skip to content

Commit c62e143

Browse files
authored
[REFACTOR] Rename MLC_LLM_READONLY_WEIGHT_CACHES (#2423)
This PR renames MLC_LLM_READONLY_WEIGHT_CACHES=>MLC_LLM_READONLY_WEIGHT_CACHE to be consistent with rest of env var convention
1 parent 3b272eb commit c62e143

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

python/mlc_llm/support/constants.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ def _get_test_model_path() -> List[Path]:
6767

6868

6969
def _get_read_only_weight_caches() -> List[Path]:
70-
if "MLC_LLM_READONLY_WEIGHT_CACHES" in os.environ:
71-
return [Path(p) for p in os.environ["MLC_LLM_READONLY_WEIGHT_CACHES"].split(os.pathsep)]
70+
if "MLC_LLM_READONLY_WEIGHT_CACHE" in os.environ:
71+
return [Path(p) for p in os.environ["MLC_LLM_READONLY_WEIGHT_CACHE"].split(os.pathsep)]
7272
return []
7373

7474

@@ -80,6 +80,6 @@ def _get_read_only_weight_caches() -> List[Path]:
8080

8181
MLC_DOWNLOAD_POLICY = os.environ.get("MLC_DOWNLOAD_POLICY", "ON")
8282
MLC_LLM_HOME: Path = _get_cache_dir()
83-
MLC_LLM_READONLY_WEIGHT_CACHES = _get_read_only_weight_caches()
83+
MLC_LLM_READONLY_WEIGHT_CACHE = _get_read_only_weight_caches()
8484

8585
_check()

python/mlc_llm/support/download.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from .constants import (
1717
MLC_DOWNLOAD_POLICY,
1818
MLC_LLM_HOME,
19-
MLC_LLM_READONLY_WEIGHT_CACHES,
19+
MLC_LLM_READONLY_WEIGHT_CACHE,
2020
MLC_TEMP_DIR,
2121
)
2222
from .style import bold
@@ -147,7 +147,7 @@ def download_and_cache_mlc_weights( # pylint: disable=too-many-locals
147147
domain = "hf"
148148

149149
readonly_cache_dirs = []
150-
for base in MLC_LLM_READONLY_WEIGHT_CACHES:
150+
for base in MLC_LLM_READONLY_WEIGHT_CACHE:
151151
cache_dir = base / domain / user / repo
152152
readonly_cache_dirs.append(str(cache_dir))
153153
if (cache_dir / "mlc-chat-config.json").is_file():
@@ -170,7 +170,7 @@ def download_and_cache_mlc_weights( # pylint: disable=too-many-locals
170170
raise RuntimeError(
171171
f"Cannot find cache for {model_url}, "
172172
"cannot proceed to download as MLC_DOWNLOAD_POLICY=READONLY, "
173-
"please check settings MLC_LLM_READONLY_WEIGHT_CACHES, "
173+
"please check settings MLC_LLM_READONLY_WEIGHT_CACHE, "
174174
f"local path candidates: {readonly_cache_dirs}"
175175
)
176176

0 commit comments

Comments
 (0)