Skip to content

Commit 594bff7

Browse files
authored
Merge pull request #347 from roboflow/lean/paligemma2-upload
PaliGemma2 model upload support
2 parents 7fca4bb + 12efbff commit 594bff7

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

CHANGELOG.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
## 1.1.5
5+
## 1.1.50
66

7-
[stub]
7+
- Added support for Palligema2 model uploads via `upload_model` command with the following model types:
8+
- `paligemma2-3b-pt-224`
9+
- `paligemma2-3b-pt-448`
10+
- `paligemma2-3b-pt-896`

roboflow/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from roboflow.models import CLIPModel, GazeModel # noqa: F401
1616
from roboflow.util.general import write_line
1717

18-
__version__ = "1.1.49"
18+
__version__ = "1.1.50"
1919

2020

2121
def check_key(api_key, model, notebook, num_retries=0):

roboflow/core/version.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@ def deploy(self, model_type: str, model_path: str, filename: str = "weights/best
488488
"yolov9",
489489
"yolonas",
490490
"paligemma",
491+
"paligemma2",
491492
"yolov10",
492493
"florence-2",
493494
"yolov11",
@@ -496,14 +497,17 @@ def deploy(self, model_type: str, model_path: str, filename: str = "weights/best
496497
if not any(supported_model in model_type for supported_model in supported_models):
497498
raise (ValueError(f"Model type {model_type} not supported. Supported models are" f" {supported_models}"))
498499

499-
if model_type.startswith(("paligemma", "florence-2")):
500-
if "paligemma" in model_type or "florence-2" in model_type:
500+
if model_type.startswith(("paligemma", "paligemma2", "florence-2")):
501+
if any(model in model_type for model in ["paligemma", "paligemma2", "florence-2"]):
501502
supported_hf_types = [
502503
"florence-2-base",
503504
"florence-2-large",
504505
"paligemma-3b-pt-224",
505506
"paligemma-3b-pt-448",
506507
"paligemma-3b-pt-896",
508+
"paligemma2-3b-pt-224",
509+
"paligemma2-3b-pt-448",
510+
"paligemma2-3b-pt-896",
507511
]
508512
if model_type not in supported_hf_types:
509513
raise RuntimeError(
@@ -819,10 +823,8 @@ def __download_zip(self, link, location, format):
819823
def bar_progress(current, total, width=80):
820824
progress_message = (
821825
"Downloading Dataset Version Zip in "
822-
+ location
823-
+ " to "
824-
+ format
825-
+ ": %d%% [%d / %d] bytes" % (current / total * 100, current, total)
826+
f"{location} to {format}: "
827+
f"{current/total*100:.0f}% [{current} / {total}] bytes"
826828
)
827829
sys.stdout.write("\r" + progress_message)
828830
sys.stdout.flush()

roboflow/deployment.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def is_valid_ISO8601_timestamp(ts):
1010
try:
1111
datetime.fromisoformat(ts)
1212
return True
13-
except:
13+
except (ValueError, TypeError):
1414
return False
1515

1616

0 commit comments

Comments
 (0)