Skip to content

Commit 821bdc0

Browse files
committed
style
1 parent d70d892 commit 821bdc0

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

roboflow/core/version.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ def deploy(self, model_type: str, model_path: str) -> None:
299299
f"Model type {model_type} not supported. Supported models are {supported_models}"
300300
)
301301
)
302-
302+
303303
if model_type == "yolov8":
304304
try:
305305
import torch
@@ -325,7 +325,7 @@ def deploy(self, model_type: str, model_path: str) -> None:
325325
class_names = [x[1] for x in class_names]
326326

327327
if model_type == "yolov8":
328-
#try except for backwards compatibility with older versions of ultralytics
328+
# try except for backwards compatibility with older versions of ultralytics
329329
try:
330330
model_artifacts = {
331331
"names": class_names,
@@ -353,11 +353,11 @@ def deploy(self, model_type: str, model_path: str) -> None:
353353
"model_type": model_type,
354354
}
355355
elif model_type == "yolov5":
356-
#parse from yaml for yolov5
357-
356+
# parse from yaml for yolov5
357+
358358
with open(os.path.join(model_path, "opt.yaml"), "r") as stream:
359359
opts = yaml.safe_load(stream)
360-
360+
361361
model_artifacts = {
362362
"names": class_names,
363363
"yaml": model["model"].yaml,
@@ -377,7 +377,7 @@ def deploy(self, model_type: str, model_path: str) -> None:
377377
"model_artifacts.json",
378378
"state_dict.pt",
379379
]
380-
380+
381381
with zipfile.ZipFile(model_path + "roboflow_deploy.zip", "w") as zipMe:
382382
for file in lista_files:
383383
zipMe.write(
@@ -399,10 +399,10 @@ def deploy(self, model_type: str, model_path: str) -> None:
399399
except Exception as e:
400400
print(f"An error occured when getting the model upload URL: {e}")
401401
return
402-
402+
403403
res = requests.put(
404404
res.json()["url"],
405-
data=open(os.path.join(model_path + "roboflow_deploy.zip"), "rb")),
405+
data=open(os.path.join(model_path + "roboflow_deploy.zip"), "rb"),
406406
)
407407
try:
408408
res.raise_for_status()
@@ -421,7 +421,6 @@ def deploy(self, model_type: str, model_path: str) -> None:
421421

422422
except Exception as e:
423423
print(f"An error occured when uploading the model: {e}")
424-
425424

426425
def __download_zip(self, link, location, format):
427426
"""

0 commit comments

Comments
 (0)