Skip to content
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

Support official models #8

Merged
merged 1 commit into from
Sep 19, 2024
Merged

Support official models #8

merged 1 commit into from
Sep 19, 2024

Conversation

andreasjansson
Copy link
Member

@andreasjansson andreasjansson commented Sep 19, 2024

Official models don't have a list of versions


Important

Add support for official models without version lists by handling ReplicateError and using latest_version.

  • Behavior:
    • Handle ReplicateError with status 404 in cog_safe_push/main.py, cog_safe_push/predict.py, and cog_safe_push/schema.py to support official models without version lists.
    • Assume models are official if 404 error occurs when accessing versions.list() and use latest_version instead.
  • Functions:
    • Modify cog_safe_push() in main.py to check for official models when asserting version IDs.
    • Update predict() in predict.py to handle official models by checking ReplicateError and using model directly.
    • Add get_openapi_schema() in schema.py to fetch schema using latest_version for official models.
  • Misc:
    • Import ReplicateError in predict.py and schema.py.

This description was created by Ellipsis for a8cdb64. It will automatically update as commits are pushed.

Official models don't have a list of versions
@andreasjansson andreasjansson merged commit 568da71 into main Sep 19, 2024
2 checks passed
@andreasjansson andreasjansson deleted the support-official-models branch September 20, 2024 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant