Skip to content

Retry on all 5xx errors #261

Closed
Closed
@parikls

Description

@parikls

Sometimes we are observing an JSONDecodeError raised by the library.
This happens when replicate API returns 502 Bad Gateway

httplib log:

https://api.replicate.com/v1/models/beautyyuyanli/multilingual-e5-large/versions/a06276a89f1a902d5fc225a9ca32b6e8e6292b7f3b136518878da97c458e2bad

{
http.fragment: ,
http.method: GET,
http.query: ,
http.response.status_code: 502,
reason: Bad Gateway
}

IMO retryable status codes should be extended to cover all possible 5xx errors

https://github.com/replicate/replicate-python/blob/main/replicate/client.py#L203

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions