From bbe83ecd2e252520de4d37e0c36b4e145c70d793 Mon Sep 17 00:00:00 2001 From: Leandro Rosemberg Date: Tue, 10 Dec 2024 20:18:44 -0300 Subject: [PATCH 1/7] PaliGemma2 model upload support --- roboflow/core/version.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/roboflow/core/version.py b/roboflow/core/version.py index 069ffd35..a6583ebe 100644 --- a/roboflow/core/version.py +++ b/roboflow/core/version.py @@ -504,6 +504,9 @@ def deploy(self, model_type: str, model_path: str, filename: str = "weights/best "paligemma-3b-pt-224", "paligemma-3b-pt-448", "paligemma-3b-pt-896", + "paligemma2-3b-pt-224", + "paligemma2-3b-pt-448", + "paligemma2-3b-pt-896" ] if model_type not in supported_hf_types: raise RuntimeError( From 020119d24d5aed814edc39c76a09070b81796581 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 23:19:45 +0000 Subject: [PATCH 2/7] =?UTF-8?q?fix(pre=5Fcommit):=20=F0=9F=8E=A8=20auto=20?= =?UTF-8?q?format=20pre-commit=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- roboflow/core/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roboflow/core/version.py b/roboflow/core/version.py index a6583ebe..fbdccdd3 100644 --- a/roboflow/core/version.py +++ b/roboflow/core/version.py @@ -506,7 +506,7 @@ def deploy(self, model_type: str, model_path: str, filename: str = "weights/best "paligemma-3b-pt-896", "paligemma2-3b-pt-224", "paligemma2-3b-pt-448", - "paligemma2-3b-pt-896" + "paligemma2-3b-pt-896", ] if model_type not in supported_hf_types: raise RuntimeError( From 2ebb314b71dd4d44b96168b34c7214a67a708b5a Mon Sep 17 00:00:00 2001 From: Leandro Rosemberg Date: Tue, 10 Dec 2024 20:27:01 -0300 Subject: [PATCH 3/7] explicit is better then implicit --- roboflow/core/version.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/roboflow/core/version.py b/roboflow/core/version.py index a6583ebe..7a00b3cd 100644 --- a/roboflow/core/version.py +++ b/roboflow/core/version.py @@ -488,6 +488,7 @@ def deploy(self, model_type: str, model_path: str, filename: str = "weights/best "yolov9", "yolonas", "paligemma", + "paligemma2", "yolov10", "florence-2", "yolov11", @@ -496,8 +497,8 @@ def deploy(self, model_type: str, model_path: str, filename: str = "weights/best 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 model_type.startswith(("paligemma", "florence-2")): - if "paligemma" in model_type or "florence-2" in model_type: + if model_type.startswith(("paligemma", "paligemma2", "florence-2")): + if any(model in model_type for model in ["paligemma", "paligemma2", "florence-2"]): supported_hf_types = [ "florence-2-base", "florence-2-large", From 363e3dbab2b88d94bfb1156ba828807062805c67 Mon Sep 17 00:00:00 2001 From: Leandro Rosemberg Date: Thu, 12 Dec 2024 19:41:49 -0300 Subject: [PATCH 4/7] ruff --- roboflow/core/version.py | 7 +++---- roboflow/deployment.py | 3 +-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/roboflow/core/version.py b/roboflow/core/version.py index fe481843..e6a21364 100644 --- a/roboflow/core/version.py +++ b/roboflow/core/version.py @@ -823,10 +823,9 @@ def __download_zip(self, link, location, format): def bar_progress(current, total, width=80): progress_message = ( "Downloading Dataset Version Zip in " - + location - + " to " - + format - + ": %d%% [%d / %d] bytes" % (current / total * 100, current, total) + f"{location} to " + f"{format}: " + f"{current/total*100:.0f}% [{current} / {total}] bytes" ) sys.stdout.write("\r" + progress_message) sys.stdout.flush() diff --git a/roboflow/deployment.py b/roboflow/deployment.py index 84fa792e..f45dd296 100644 --- a/roboflow/deployment.py +++ b/roboflow/deployment.py @@ -10,10 +10,9 @@ def is_valid_ISO8601_timestamp(ts): try: datetime.fromisoformat(ts) return True - except: + except: # noqa: E722 return False - def check_from_to_timestamp(from_timestamp, to_timestamp, default_timedelta): if from_timestamp and not is_valid_ISO8601_timestamp(from_timestamp): print("Please provide a valid from_timestamp in ISO8601 format (YYYY-MM-DD HH:MM:SS)") From 2863d19eac3bb01cdd6441a7253ec85084154449 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 22:42:18 +0000 Subject: [PATCH 5/7] =?UTF-8?q?fix(pre=5Fcommit):=20=F0=9F=8E=A8=20auto=20?= =?UTF-8?q?format=20pre-commit=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- roboflow/deployment.py | 1 + 1 file changed, 1 insertion(+) diff --git a/roboflow/deployment.py b/roboflow/deployment.py index f45dd296..50847c4b 100644 --- a/roboflow/deployment.py +++ b/roboflow/deployment.py @@ -13,6 +13,7 @@ def is_valid_ISO8601_timestamp(ts): except: # noqa: E722 return False + def check_from_to_timestamp(from_timestamp, to_timestamp, default_timedelta): if from_timestamp and not is_valid_ISO8601_timestamp(from_timestamp): print("Please provide a valid from_timestamp in ISO8601 format (YYYY-MM-DD HH:MM:SS)") From 2777f6c05c5c54fb3c5721a59438cd63a01c764f Mon Sep 17 00:00:00 2001 From: Leandro Rosemberg Date: Fri, 13 Dec 2024 11:49:16 -0300 Subject: [PATCH 6/7] review --- roboflow/core/version.py | 3 +-- roboflow/deployment.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/roboflow/core/version.py b/roboflow/core/version.py index e6a21364..1ffe74e4 100644 --- a/roboflow/core/version.py +++ b/roboflow/core/version.py @@ -823,8 +823,7 @@ def __download_zip(self, link, location, format): def bar_progress(current, total, width=80): progress_message = ( "Downloading Dataset Version Zip in " - f"{location} to " - f"{format}: " + f"{location} to {format}: " f"{current/total*100:.0f}% [{current} / {total}] bytes" ) sys.stdout.write("\r" + progress_message) diff --git a/roboflow/deployment.py b/roboflow/deployment.py index 50847c4b..a299bd1d 100644 --- a/roboflow/deployment.py +++ b/roboflow/deployment.py @@ -10,7 +10,7 @@ def is_valid_ISO8601_timestamp(ts): try: datetime.fromisoformat(ts) return True - except: # noqa: E722 + except (ValueError, TypeError): return False From 12efbff78d6e39e23826c8c630a7dc872642cd47 Mon Sep 17 00:00:00 2001 From: Leandro Rosemberg Date: Fri, 13 Dec 2024 11:57:17 -0300 Subject: [PATCH 7/7] bump version and changelog --- CHANGELOG.md | 7 +++++-- roboflow/__init__.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48403b2b..df7db79c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ All notable changes to this project will be documented in this file. -## 1.1.5 +## 1.1.50 -[stub] +- Added support for Palligema2 model uploads via `upload_model` command with the following model types: + - `paligemma2-3b-pt-224` + - `paligemma2-3b-pt-448` + - `paligemma2-3b-pt-896` diff --git a/roboflow/__init__.py b/roboflow/__init__.py index c306406a..403577c4 100644 --- a/roboflow/__init__.py +++ b/roboflow/__init__.py @@ -15,7 +15,7 @@ from roboflow.models import CLIPModel, GazeModel # noqa: F401 from roboflow.util.general import write_line -__version__ = "1.1.49" +__version__ = "1.1.50" def check_key(api_key, model, notebook, num_retries=0):