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

refactor(worker): cleanup worker error handling logic #190

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

rickstaa
Copy link
Collaborator

@rickstaa rickstaa commented Sep 5, 2024

This pull request restructures the worker error handling logic so that the code is a bit leaner.

This commit adds the inference error logic from the SAM2 pipeline to all
pipelines so users are given a warning when they supply wrong arguments.
This commit ensures that users get a descriptive error message when the
GPU runs out of memory.
This commit ensures that all response errors are known by FastAPI and
therefore shown in the docs.
This commit adds some missing error handling to the pipeline worker
functions.
This commit improves the error handling code so that it contains less
redundancy.
This commite moves the handleJSONError to the global scope since it is
used by each pipeline. This prvents code redundancy.
@rickstaa rickstaa marked this pull request as draft September 5, 2024 08:18
@rickstaa rickstaa changed the title trim worker err handling code refactor(worker): cleanup worker error handling logic Sep 5, 2024
@@ -219,34 +206,25 @@ func (w *Worker) Upscale(ctx context.Context, req UpscaleMultipartRequestBody) (
return nil, err
}

if resp.JSON422 != nil {
val, err := json.Marshal(resp.JSON422)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check why this was used before.

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