-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add a loading bar for tools #1188
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
Conversation
|
Uh I think the video I attached is loading poorly on the web, will let you try locally if you can to see if the behaviour works ok for you there edit: attached a better example |
|
Looks great but maybe we shouldn't animate to completion once the tool returns. Also, the estimated time can be known ahead of time for some tools (web search is 4-8s, url fetch is 2-4s, gradio spaces have an existing estimate). It might be nice to let the tools define their own estimates dynamically |
and no rounding on the loading bar
| } | ||
| }); | ||
| // go to 100% quickly if loading is done |
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.
not sure this works
Co-authored-by: Mishig <[email protected]>
mishig25
left a comment
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.
LGTM! Made a small suggestion #1191 (up to you to accept or not 👍 )
* Clear animation when done * make the bar go to the end --------- Co-authored-by: Nathan Sarrazin <[email protected]>
|
Accepted the suggestion, also made sure the loading bar goes til the end properly. Will add estimates from gradio API in a follow up PR if they are returned |
| <div | ||
| bind:this={loadingBarEl} | ||
| class="absolute -m-1 hidden h-full w-full rounded-l-lg bg-purple-500/5 transition-all dark:bg-purple-500/10" | ||
| class="absolute -m-1 hidden h-full w-[calc(100%+1rem)] rounded-lg bg-purple-500/5 transition-all dark:bg-purple-500/10" |
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.
looked more like a progress bar without the rounded lg on the right imo (you could add an overflow-hidden on the parent instead).
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.
agreed, working on bringing it back but fighting with the padding 😆
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.
it was fine as it was imo :D even if it wasn't taking the full width
* Add a loading bar for tools * move css to right file * lighter purple and no rounding on the loading bar * Update src/routes/+layout.server.ts Co-authored-by: Mishig <[email protected]> * Clear animation when done (huggingface#1191) * Clear animation when done * make the bar go to the end --------- Co-authored-by: Nathan Sarrazin <[email protected]> --------- Co-authored-by: Victor Mustar <[email protected]> Co-authored-by: Mishig <[email protected]>
* Add a loading bar for tools * move css to right file * lighter purple and no rounding on the loading bar * Update src/routes/+layout.server.ts Co-authored-by: Mishig <[email protected]> * Clear animation when done (huggingface#1191) * Clear animation when done * make the bar go to the end --------- Co-authored-by: Nathan Sarrazin <[email protected]> --------- Co-authored-by: Victor Mustar <[email protected]> Co-authored-by: Mishig <[email protected]>
* Add a loading bar for tools * move css to right file * lighter purple and no rounding on the loading bar * Update src/routes/+layout.server.ts Co-authored-by: Mishig <[email protected]> * Clear animation when done (huggingface#1191) * Clear animation when done * make the bar go to the end --------- Co-authored-by: Nathan Sarrazin <[email protected]> --------- Co-authored-by: Victor Mustar <[email protected]> Co-authored-by: Mishig <[email protected]>
* Add a loading bar for tools * move css to right file * lighter purple and no rounding on the loading bar * Update src/routes/+layout.server.ts Co-authored-by: Mishig <[email protected]> * Clear animation when done (huggingface#1191) * Clear animation when done * make the bar go to the end --------- Co-authored-by: Nathan Sarrazin <[email protected]> --------- Co-authored-by: Victor Mustar <[email protected]> Co-authored-by: Mishig <[email protected]>
* Add a loading bar for tools * move css to right file * lighter purple and no rounding on the loading bar * Update src/routes/+layout.server.ts Co-authored-by: Mishig <[email protected]> * Clear animation when done (huggingface#1191) * Clear animation when done * make the bar go to the end --------- Co-authored-by: Nathan Sarrazin <[email protected]> --------- Co-authored-by: Victor Mustar <[email protected]> Co-authored-by: Mishig <[email protected]>
* Add a loading bar for tools * move css to right file * lighter purple and no rounding on the loading bar * Update src/routes/+layout.server.ts Co-authored-by: Mishig <[email protected]> * Clear animation when done (huggingface#1191) * Clear animation when done * make the bar go to the end --------- Co-authored-by: Nathan Sarrazin <[email protected]> --------- Co-authored-by: Victor Mustar <[email protected]> Co-authored-by: Mishig <[email protected]>
This uses the prometheus metrics, takes the 90th percentile to estimate the size of the loading bar with a default to 15s.
The bar finishes quickly if done early, or hangs close to the end if late.
Screen.Recording.2024-05-28.at.01.08.43.mov