diff --git a/src/_bentoml_sdk/service/factory.py b/src/_bentoml_sdk/service/factory.py index 5654bcf3c9f..62502a8ba30 100644 --- a/src/_bentoml_sdk/service/factory.py +++ b/src/_bentoml_sdk/service/factory.py @@ -404,6 +404,10 @@ def on_load_bento(self, bento: Bento) -> None: # Replace the model version with the one in the Bento if not isinstance(model, HuggingFaceModel): continue + model_id = info.metadata.get("model_id") # use the case in bento info + if not model_id: + model_id = info.tag.name.replace("--", "/") + model.model_id = model_id model.revision = info.tag.version self.bento = bento