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
Pass Error status in /dev/reload stream #8106
Conversation
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-builds.s3.amazonaws.com/7f6c699dc9626b3c0cf2e707c963fbdc169bc565/gradio-4.28.3-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@7f6c699dc9626b3c0cf2e707c963fbdc169bc565#subdirectory=client/python" |
🦄 change detectedThis Pull Request includes changes to the following packages.
With the following changelog entry.
Maintainers or the PR author can modify the PR title to modify this entry.
|
716f9ff
to
1181606
Compare
1181606
to
3cac8ea
Compare
I think it would be nice to show the full trace here but I guess the error toast is too small for that? |
I think so and they should have access to the server logs anyways (that's the idea on spaces as well I believe) |
Would be cool if it was all viewable in the browser tho, on a single screen you often have to choose 2 of browser, terminal, editor. Can discuss later anyway, this is much better DX! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works great! Thanks @freddyaboulton!
Just added the python traceback to the console! Thanks for the review @pngwn |
js/app/src/Blocks.svelte
Outdated
@@ -155,6 +155,10 @@ | |||
}; | |||
} | |||
export function add_new_message(message: string, type: ToastMessage["type"]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could use this internally in Block.svelte whenever we add a message too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks freddy! Only thought is if I wonder if the error message should show more than just "Error reloading app", maybe the actual traceback?
EDIT: just saw that was discussed above.
Also, I wish the reload error toast would go away immediately as soon as I fixed the app, but that's probably a bit tricky.
71f735e
to
e35b9b3
Compare
Thanks for the review @aliabid94 ! Will think about how we can close the error toast automatically! |
* get error message * Support multiple clients * add changeset * add changeset * add changeset * Display in UI * console.error the python traceback * lint --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
* get error message * Support multiple clients * add changeset * add changeset * add changeset * Display in UI * console.error the python traceback * lint --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
I think this should be possible. If each error message takes an |
We need to refactor the progress stuff tbh it has gotten a bit out of hand, very hard to parse now. One problem @freddyaboulton and I came across is that the loading status centres around components, changing statuses for functions is harder than we felt it should be. Can look into it. |
* get error message * Support multiple clients * add changeset * add changeset * add changeset * Display in UI * console.error the python traceback * lint --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Description
Let clients know when an error happened during reload. Also refactored the route to support more than one client connecting simultaneously.
Logic is here and should not conflict with #8056 but will wait for #8056
There are two message types in the thread
reload
anderror
.Edit: also errors are shown in the UI now
🎯 PRs Should Target Issues
Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.
Not adhering to this guideline will result in the PR being closed.
Tests
PRs will only be merged if tests pass on CI. To run the tests locally, please set up your Gradio environment locally and run the tests:
bash scripts/run_all_tests.sh
You may need to run the linters:
bash scripts/format_backend.sh
andbash scripts/format_frontend.sh