diff --git a/roboflow/core/version.py b/roboflow/core/version.py index 2fa9e0fc..7bd63126 100644 --- a/roboflow/core/version.py +++ b/roboflow/core/version.py @@ -438,13 +438,13 @@ def deploy(self, model_type: str, model_path: str, filename: str = "weights/best filename (str, optional): The name of the weights file. Defaults to "weights/best.pt". """ - supported_models = ["yolov5", "yolov7-seg", "yolov8", "yolov9", "yolonas", "paligemma", "yolov10"] + supported_models = ["yolov5", "yolov7-seg", "yolov8", "yolov9", "yolonas", "paligemma", "yolov10", "florence-2"] if not any(supported_model in model_type for supported_model in supported_models): raise (ValueError(f"Model type {model_type} not supported. Supported models are" f" {supported_models}")) - if "paligemma" in model_type: - self.deploy_paligemma(model_type, model_path, filename) + if model_type.startswith(("paligemma", "florence-2")): + self.deploy_huggingface(model_type, model_path, filename) return if "yolonas" in model_type: @@ -569,7 +569,7 @@ def deploy(self, model_type: str, model_path: str, filename: str = "weights/best self.upload_zip(model_type, model_path) - def deploy_paligemma( + def deploy_huggingface( self, model_type: str, model_path: str, filename: str = "fine-tuned-paligemma-3b-pt-224.f16.npz" ) -> None: # Check if model_path exists @@ -583,11 +583,8 @@ def deploy_paligemma( # Find first .npz file in model_path npz_filename = next((file for file in model_files if file.endswith(".npz")), None) if any([file.endswith(".safetensors") for file in model_files]): - print("Found .safetensors file in model path. Deploying PyTorch PaliGemma model.") + print(f"Found .safetensors file in model path. Deploying PyTorch {model_type} model.") necessary_files = [ - "config.json", - "generation_config.json", - "model.safetensors.index.json", "preprocessor_config.json", "special_tokens_map.json", "tokenizer_config.json",