-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deploy model without version #348
base: main
Are you sure you want to change the base?
Conversation
|
||
except ImportError: | ||
raise RuntimeError( | ||
"The ultralytics python package is required to deploy yolov10" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"The ultralytics python package is required to deploy yolov10" | |
"The ultralytics python package is required to deploy yolov11" |
|
||
zip_file_name = "roboflow_deploy.zip" | ||
|
||
with zipfile.ZipFile(os.path.join(model_path, zip_file_name), "w") as zipMe: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for now, but we should stop zipping these big files with Python. It is too slow for big files.
list_files = [ | ||
"results.json", | ||
"results.png", | ||
"model_artifacts.json", | ||
"state_dict.pt", | ||
] | ||
|
||
zip_file_name = "roboflow_deploy.zip" | ||
|
||
with zipfile.ZipFile(os.path.join(model_path, zip_file_name), "w") as zipMe: | ||
for file in list_files: | ||
if os.path.exists(os.path.join(model_path, file)): | ||
zipMe.write( | ||
os.path.join(model_path, file), | ||
arcname=file, | ||
compress_type=zipfile.ZIP_DEFLATED, | ||
) | ||
else: | ||
if file in ["model_artifacts.json", filename]: | ||
raise (ValueError(f"File {file} not found. Please make sure to provide a" " valid model path.")) | ||
|
||
return zip_file_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like some duplicated code, but we can organize it later.
Description
You can now deploy versions without specifying the version number. To do this, you can use the deploy_model method from the Workspace:
Example:
Alternatively, you can use the CLI:
General overview
Type of change
How has this change been tested, please provide a testcase or example of how you tested the change?