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

Post-download progress #4

Open
domenic opened this issue Jul 1, 2024 · 5 comments
Open

Post-download progress #4

domenic opened this issue Jul 1, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@domenic
Copy link
Collaborator

domenic commented Jul 1, 2024

In cases where the model is not currently available, the API gives notifications of download progress. This is meant to allow a user experience that displays a progress bar or similar.

However, in our prototyping in Chrome at least, there are other steps after the download: e.g. decompressing the model, and verifying the download. These can take some time (on the order of seconds). Should the API allow monitoring these steps, so as to let sites display their progress?

Let's keep this issue open to see if people run into this issue in practice when trying to build good user experiences. If so, we'll brainstorm what kind of API would be good to expose.

@domenic domenic added the enhancement New feature or request label Jul 1, 2024
@MuraraAllan
Copy link

MuraraAllan commented Jul 17, 2024

I had this for around 1 minute on after-download with 16GB DDR4 i5 11 4GB VRAM GTX1060
Giving the difference inbetween hardware performances, would be very hard for a UX to estimate something meaningfull such as "ETA".

Also considering user onboarding process and stuff, probably everything will be settled after they interact with the UX. Or just got hold on a loading AI stuff.

% is always confusing for me as a user. I'd prefer to know if I can use or not only.

I don't think we need to know the exact moment of the process in detail.
The model is already available or not seems to provide enough info to a final user.

@yeikel16
Copy link

Hi, the download-progress section describe in the README is only a idea or is the next step?

@domenic
Copy link
Collaborator Author

domenic commented Jul 30, 2024

Hi, the download-progress section describe in the README is only a idea or is the next step?

I don't understand this question or its relationship to this issue.

@yeikel16
Copy link

I don't understand this question or its relationship to this issue.

Sorry if I don't explain myself well, I mean than in the README there is a section that refers to the download progress of the model. I would like to know if this issue is related with this task.

Download progress

In cases where the model needs to be downloaded as part of creation, you can monitor the download progress (e.g. in order to show your users a progress bar) using code such as the following:

const session = await ai.assistant.create({
  monitor(m) {
    m.addEventListener("downloadprogress", e => {
      console.log(`Downloaded ${e.loaded} of ${e.total} bytes.`);
    });
  }
});

If the download fails, then downloadprogress events will stop being emitted, and the promise returned by create() will be rejected with a "NetworkError" DOMException.

@domenic
Copy link
Collaborator Author

domenic commented Jul 31, 2024

This issue is specifically about post-download progress, not download progress. I think the original issue explains that pretty well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants