How to Get the Progress of the Processing job in serverless ?

When I use status/id, it only return like {delayTime: 873, id: 3e9eb0e4-c11d-4778-8c94-4d045baa99c1-e1, status: IN_PROGRESS, workerId: eluw70apx442ph}, no progress data. I want progress data just like screenshot on serverless console log。Please tell me how to get it in app client.
No description
5 Replies
yhlong00000
yhlong000005d ago
Additional controls | RunPod Documentation
Send progress updates during job execution using the runpod.serverless.progress_update function, and refresh workers for long-running or complex jobs by returning a dictionary with a 'refresh_worker' flag in your handler.
fireice
fireiceOP5d ago
Thank you Can you supply a real project code ? Document is so simple, I can't follow it. In real project,I don't know how long each step will take. Code like " for update_number in range(0, 3): runpod.serverless.progress_update(job, f"Update {update_number}/3") " will not work .
yhlong00000
yhlong000004d ago
You can just put below code in your handler.py file, no need to know total how many steps. runpod.serverless.progress_update(job, f"Finish step 1") " runpod.serverless.progress_update(job, f"Finish step 2") " runpod.serverless.progress_update(job, f"Finish step 3") "
fireice
fireiceOP4d ago
My requirement is to generate only one photo each time. For the progress updates, I need the system to send a progress update after each step during the generation of a single photo. If generating one photo takes 30 steps, I expect an update after each step so that the client can display the progress as N / 30. with self.progress_bar(total=num_inference_steps) as progress_bar: for i, t in enumerate(timesteps): runpod.serverless.progress_update(job, f"Finished step {i + 1} / {len(timesteps)}") . Maybe I should put it here, at the end of each step execution?
nerdylive
nerdylive4d ago
Do you have some code that supplies the steps? Then you can hook it with the update function for Runpod serverless Not sure what that means or what library or framework are you using, I'm sure progresses are dependent with those
Want results from more Discord servers?
Add your server