Skip to content

Commit afeb2c5

Browse files
committed
removes the versionless model upload thru CLI
1 parent 090b2d1 commit afeb2c5

File tree

2 files changed

+12
-22
lines changed

2 files changed

+12
-22
lines changed

roboflow/roboflowpy.py

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -82,20 +82,10 @@ def upload_model(args):
8282
rf = roboflow.Roboflow(args.api_key)
8383
workspace = rf.workspace(args.workspace)
8484

85-
if args.version_number is not None:
86-
# Deploy to specific version
87-
project = workspace.project(args.project)
88-
version = project.version(args.version_number)
89-
version.deploy(str(args.model_type), str(args.model_path), str(args.filename))
90-
else:
91-
# Deploy to multiple projects
92-
workspace.deploy_model(
93-
model_type=str(args.model_type),
94-
model_path=str(args.model_path),
95-
project_ids=args.project,
96-
model_name=str(args.model_name),
97-
filename=str(args.filename),
98-
)
85+
# Deploy to specific version
86+
project = workspace.project(args.project)
87+
version = project.version(args.version_number)
88+
version.deploy(str(args.model_type), str(args.model_path), str(args.filename))
9989

10090

10191
def list_projects(args):
@@ -492,11 +482,13 @@ def _add_upload_model_parser(subparsers):
492482
upload_model_parser.add_argument(
493483
"-p",
494484
dest="project",
495-
action="append", # Allow multiple projects
496-
help="project_id to upload the model into (can be specified multiple times)",
485+
help="project_id to upload the model into",
497486
)
498487
upload_model_parser.add_argument(
499-
"-v", dest="version_number", type=int, help="version number to upload the model to (optional)", default=None
488+
"-v",
489+
dest="version_number",
490+
type=int,
491+
help="version number to upload the model to",
500492
)
501493
upload_model_parser.add_argument(
502494
"-t",
@@ -514,11 +506,6 @@ def _add_upload_model_parser(subparsers):
514506
default="weights/best.pt",
515507
help="name of the model file",
516508
)
517-
upload_model_parser.add_argument(
518-
"-n",
519-
dest="model_name",
520-
help="name of the model",
521-
)
522509
upload_model_parser.set_defaults(func=upload_model)
523510

524511

roboflow/util/model_processor.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ def _get_processor_function(model_type: str) -> Callable:
4545
"paligemma2-3b-pt-224",
4646
"paligemma2-3b-pt-448",
4747
"paligemma2-3b-pt-896",
48+
"paligemma2-3b-pt-224-peft",
49+
"paligemma2-3b-pt-448-peft",
50+
"paligemma2-3b-pt-896-peft",
4851
]
4952
if model_type not in supported_hf_types:
5053
raise RuntimeError(

0 commit comments

Comments
 (0)