Skip to content

Commit d4a72d9

Browse files
authored
Warn users about correct model type string for hf uploads (#286)
1 parent e62dbb1 commit d4a72d9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

roboflow/core/version.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,19 @@ def deploy(self, model_type: str, model_path: str, filename: str = "weights/best
459459
raise (ValueError(f"Model type {model_type} not supported. Supported models are" f" {supported_models}"))
460460

461461
if model_type.startswith(("paligemma", "florence-2")):
462+
if "paligemma" in model_type or "florence-2" in model_type:
463+
supported_hf_types = [
464+
"florence-2-base",
465+
"florence-2-large",
466+
"paligemma-3b-pt-224",
467+
"paligemma-3b-pt-448",
468+
"paligemma-3b-pt-896",
469+
]
470+
if model_type not in supported_hf_types:
471+
raise RuntimeError(
472+
f"{model_type} not supported for this type of upload."
473+
f"Supported upload types are {supported_hf_types}"
474+
)
462475
self.deploy_huggingface(model_type, model_path, filename)
463476
return
464477

0 commit comments

Comments
 (0)