Skip to content

Commit 73784a1

Browse files
committed
feat(downloads): RUNTIME_DOWNLOAD from HF when no MODEL_URL given
1 parent 4576c5f commit 73784a1

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

api/app.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,13 @@ def inference(all_inputs: dict) -> dict:
168168
if not os.path.isdir(model_dir):
169169
model_url = call_inputs.get("MODEL_URL", None)
170170
if not model_url:
171-
return {
172-
"$error": {
173-
"code": "NO_MODEL_URL",
174-
"message": "Currently RUNTIME_DOWNOADS requires a MODEL_URL callInput",
175-
}
176-
}
171+
# return {
172+
# "$error": {
173+
# "code": "NO_MODEL_URL",
174+
# "message": "Currently RUNTIME_DOWNOADS requires a MODEL_URL callInput",
175+
# }
176+
# }
177+
normalized_model_id = hf_model_id or model_id
177178
download_model(
178179
model_id=model_id,
179180
model_url=model_url,

api/download.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def download_model(
146146
else:
147147
# do a dry run of loading the huggingface model, which will download weights at build time
148148
loadModel(
149-
model_id=normalized_model_id,
149+
model_id=hf_model_id,
150150
load=False,
151151
precision=model_precision,
152152
revision=model_revision,

0 commit comments

Comments
 (0)