Skip to content

How to get progress status of API calls? #152

@921kiyo

Description

@921kiyo

Hi Replicate team,

I am using the replicate API for image generation and fine-tuning. In our front-end, we would like to show how much % of the job is complete, so users have a better idea of how much it's complete, how long it takes to complete etc (e.g 10%, 30% complete etc.).

For image generation, I use replicate.predictions.create to start the image generation, and use the prediction id in replicatepredictions.get(pred_id), to check the status. I am wondering if there's a way to calculate/estimate the completion progress using replicate API. I know that Prediction.logs shows some information about the progress, but it's all in string.

I can do a hacky way to extract the progress from the logs, but let me know if there's a better way to calculate the progress (e.g how much of the iterations are complete out of XX total iterations etc).

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