Skip to content

Commit bdcb56f

Browse files
committed
Fixing model name not being passed into build
1 parent 679c677 commit bdcb56f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/clip_api_service/build.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from __future__ import annotations
22

3+
from clip_api_service.models import MODEL_ENV_VAR_KEY
4+
35
import os
46

57

@@ -13,6 +15,11 @@ def build_bento(model_name: str | None = None, use_gpu: bool = False):
1315

1416
bento_file = clip_module.bentofile_path(use_gpu=use_gpu)
1517

18+
# Setting Model name as environment variable to pass
19+
# into subprocess for bento build
20+
if model_name:
21+
os.environ[MODEL_ENV_VAR_KEY] = model_name
22+
1623
# Get parent directory path
1724
build_ctx = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
1825
bentoml.bentos.build_bentofile(bento_file, build_ctx=build_ctx)

0 commit comments

Comments
 (0)