Skip to content

Commit

Permalink
Warn users about correct model type string for hf uploads (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
probicheaux committed Jul 19, 2024
1 parent e62dbb1 commit d4a72d9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions roboflow/core/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,19 @@ def deploy(self, model_type: str, model_path: str, filename: str = "weights/best
raise (ValueError(f"Model type {model_type} not supported. Supported models are" f" {supported_models}"))

if model_type.startswith(("paligemma", "florence-2")):
if "paligemma" in model_type or "florence-2" in model_type:
supported_hf_types = [
"florence-2-base",
"florence-2-large",
"paligemma-3b-pt-224",
"paligemma-3b-pt-448",
"paligemma-3b-pt-896",
]
if model_type not in supported_hf_types:
raise RuntimeError(
f"{model_type} not supported for this type of upload."
f"Supported upload types are {supported_hf_types}"
)
self.deploy_huggingface(model_type, model_path, filename)
return

Expand Down

0 comments on commit d4a72d9

Please sign in to comment.