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

Set the capabilities fields to null when the model status is "after-download"? #58

Open
lozy219 opened this issue Nov 12, 2024 · 3 comments

Comments

@lozy219
Copy link
Contributor

lozy219 commented Nov 12, 2024

In the IDL of capabilities API, we have

  // Always null if available === "no"
  readonly attribute unsigned long? defaultTopK;
  readonly attribute unsigned long? maxTopK;
  readonly attribute float? defaultTemperature;
  readonly attribute float? maxTemperature;

Those optional attributes should also be set to null when available === "after-download" since the model is not ready yet.
It only becomes an issue after we migrated the sampling param config to the model.

@domenic
Copy link
Collaborator

domenic commented Nov 13, 2024

Hmm.

The intention here is that this information is supposed to be available before the download, because it might impact whether a web developer wants to spend the user's bandwidth downloading the model, or not. This is discussed in https://github.com/WICG/translation-api#:~:text=This%20design%20means%20that%20the,mechanism%20that%20eagerly%20pushes%20updates.)

However, that's more important for questions like the supported languages. It's harder to imagine a web developer saying that they don't want to use the prompt API if maxTemperature only goes up to 1.0, or something like that.

So maybe we can keep the capabilities hyperparameters as null in the after-download state, even though we need to support languageAvailable() in that state.

What do you think?

@lozy219
Copy link
Contributor Author

lozy219 commented Nov 14, 2024

I chatted with @fergald about this, maybe we could keep the current implementation that returns null for the sampling params if the model is not downloaded yet, but eventually this could be supported by fetching the metadata of the model and read the config without downloading the full model.

For the languageAvailable() method, yes it will be supported even when the model is not downloaded.

@domenic
Copy link
Collaborator

domenic commented Nov 14, 2024

OK, cool. Let's tentatively keep the explainer as-is, with Chromium not matching it for now. We can keep this issue open to track that it's still unclear what the best path is, and revisit when we have either more information from web developers, more information from other implementations, or more information on how difficult this would be in the Chromium implementation.

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

No branches or pull requests

2 participants