Skip to content

Commit 5fcfb48

Browse files
feat: use "MODEL_NAME" instead of "MODEL_PATH"
1 parent ec910bd commit 5fcfb48

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

.runpod/hub.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"allowedCudaVersions": ["12.7", "12.6", "12.5", "12.4"],
1313
"env": [
1414
{
15-
"key": "MODEL_PATH",
15+
"key": "MODEL_NAME",
1616
"input": {
1717
"name": "Model",
1818
"type": "huggingface",

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ COPY handler.py engine.py utils.py download_model.py test_input.json ./
1818
COPY public/ ./public/
1919

2020
# Setup for Option 2: Building the Image with the Model included
21-
ARG MODEL_PATH=""
21+
ARG MODEL_NAME=""
2222
ARG TOKENIZER_NAME=""
2323
ARG BASE_PATH="/runpod-volume"
2424
ARG QUANTIZATION=""
2525
ARG MODEL_REVISION=""
2626
ARG TOKENIZER_REVISION=""
2727

28-
ENV MODEL_PATH=$MODEL_PATH \
28+
ENV MODEL_NAME=$MODEL_NAME \
2929
MODEL_REVISION=$MODEL_REVISION \
3030
TOKENIZER_NAME=$TOKENIZER_NAME \
3131
TOKENIZER_REVISION=$TOKENIZER_REVISION \
@@ -42,7 +42,7 @@ RUN --mount=type=secret,id=HF_TOKEN,required=false \
4242
if [ -f /run/secrets/HF_TOKEN ]; then \
4343
export HF_TOKEN=$(cat /run/secrets/HF_TOKEN); \
4444
fi && \
45-
if [ -n "$MODEL_PATH" ]; then \
45+
if [ -n "$MODEL_NAME" ]; then \
4646
python3 download_model.py; \
4747
fi
4848

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ All behaviour is controlled through environment variables:
1414

1515
| Environment Variable | Description | Default | Options |
1616
| --------------------------------- | ------------------------------------------------- | ------------------------------------- | ----------------------------------------------------------------------------------------- |
17-
| `MODEL_PATH` | Path of the model weights | "meta-llama/Meta-Llama-3-8B-Instruct" | Local folder or Hugging Face repo ID |
17+
| `MODEL_NAME` | Hugging Face model name or local path | "meta-llama/Meta-Llama-3-8B-Instruct" | Hugging Face repo ID or local folder path |
1818
| `HF_TOKEN` | HuggingFace access token for gated/private models | | Your HuggingFace access token |
1919
| `TOKENIZER_PATH` | Path of the tokenizer | | |
2020
| `TOKENIZER_MODE` | Tokenizer mode | "auto" | "auto", "slow" |

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ services:
1414
environment:
1515
- HOST=0.0.0.0
1616
- PORT=30000
17-
- MODEL_PATH=meta-llama/Llama-3.2-1B-Instruct
17+
- MODEL_NAME=meta-llama/Llama-3.2-1B-Instruct
1818
- TRUST_REMOTE_CODE=true
1919
- ATTENTION_BACKEND=flashinfer
2020
- SAMPLING_BACKEND=flashinfer

docs/conventions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
feat(docker): add github workflow for automated builds
4646
fix(handler): resolve openai compatibility issue
4747
docs(readme): update installation instructions
48-
refactor(engine): migrate from MODEL_NAME to MODEL_PATH
48+
refactor(engine): migrate from MODEL_PATH to MODEL_NAME
4949
chore(deps): update requirements.txt
5050
```
5151

download_model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def setup_env():
1717
os.environ.update(
1818
{
1919
"HF_HOME": f"{BASE_DIR}/hf_cache",
20-
"MODEL_PATH": "openchat/openchat-3.5-0106",
20+
"MODEL_NAME": "openchat/openchat-3.5-0106",
2121
"HF_HUB_ENABLE_HF_TRANSFER": "1",
2222
"TENSORIZE": "1",
2323
"TENSORIZER_NUM_GPUS": "1",
@@ -52,7 +52,7 @@ def download(name, revision, type, cache_dir):
5252
setup_env()
5353
cache_dir = os.getenv("HF_HOME")
5454
model_name, model_revision = (
55-
os.getenv("MODEL_PATH"),
55+
os.getenv("MODEL_NAME"),
5656
os.getenv("MODEL_REVISION") or None,
5757
)
5858
tokenizer_name, tokenizer_revision = (
@@ -63,7 +63,7 @@ def download(name, revision, type, cache_dir):
6363
model_path_downloaded = download(model_name, model_revision, "model", cache_dir)
6464

6565
metadata = {
66-
"MODEL_PATH": model_path_downloaded,
66+
"MODEL_NAME": model_path_downloaded,
6767
"MODEL_REVISION": os.getenv("MODEL_REVISION"),
6868
"QUANTIZATION": os.getenv("QUANTIZATION"),
6969
}

engine.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class SGlangEngine:
1111
def __init__(
1212
self,
13-
model=os.getenv("MODEL_PATH"),
13+
model=os.getenv("MODEL_NAME"),
1414
host=os.getenv("HOST", "0.0.0.0"),
1515
port=int(os.getenv("PORT", 30000)),
1616
):
@@ -33,7 +33,7 @@ def start_server(self):
3333

3434
# Dictionary of all possible options and their corresponding env var names
3535
options = {
36-
"MODEL_PATH": "--model-path",
36+
"MODEL_NAME": "--model-path",
3737
"TOKENIZER_PATH": "--tokenizer-path",
3838
"TOKENIZER_MODE": "--tokenizer-mode",
3939
"LOAD_FORMAT": "--load-format",

0 commit comments

Comments
 (0)