Skip to content

Commit 316688c

Browse files
committed
Pass create options into download method
1 parent e814bf9 commit 316688c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/ai/src/methods/chrome-adapter.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ export class ChromeAdapter {
257257
if (availability === Availability.downloadable) {
258258
// Side-effect: triggers out-of-band model download.
259259
// This is required because Chrome manages the model download.
260-
this.download();
260+
this.download(createOptions);
261261
}
262262

263263
return availability;
@@ -267,18 +267,18 @@ export class ChromeAdapter {
267267
* Triggers out-of-band download of an on-device model.
268268
*
269269
* <p>Chrome only downloads models as needed. Chrome knows a model is needed when code calls
270-
* LanguageModel.create.</p>
270+
* {@link LanguageModel.create}.</p>
271271
*
272272
* <p>Since Chrome manages the download, the SDK can only avoid redundant download requests by
273273
* tracking if a download has previously been requested.</p>
274274
*/
275-
private download(): void {
275+
private download(createOptions: LanguageModelCreateOptions): void {
276276
if (this.isDownloading) {
277277
return;
278278
}
279279
this.isDownloading = true;
280280
this.downloadPromise = this.languageModelProvider
281-
?.create(this.onDeviceParams.createOptions)
281+
?.create(createOptions)
282282
.then(() => {
283283
this.isDownloading = false;
284284
});

0 commit comments

Comments
 (0)