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

Fix js/chat example #506

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

joncamp
Copy link

@joncamp joncamp commented Dec 30, 2024

The chat example is broken currently, as noted in #431. TLDR: Update Onnxruntime-web in chat sample to be v1.20.1

There are two symptoms that are displayed in the console. One is a failure to initialize the session, leading to TypeError: Cannot read properties of undefined (reading 'run'). That error is somewhat ambiguous. However, running under a debugger we see a more descriptive error:

Error: no available backend found. ERR: [webgpu] TypeError: r.requestAdapterInfo is not a function
    at On (ort.webgpu.min.js:6:1623)
    at async e.create (ort.webgpu.min.js:6:18113)
    at async LLM.load (llm.js:113:1)
    at async Init (main.js:256:1)

Per https://issues.chromium.org/issues/346321149, requestAdapterInfo was deprecated. gyagp/onnxruntime@2a70ffd is the associated PR into onnxruntime making the update.

This change only updates the chat sample. Other samples (ort-whisper, quick-start_onnxruntime-web-bundler, sd-turbo, and segment-anything) all use even older onnxruntime-web packages. For sd-turbo, PR #498 submitted an equivalent change for a different issue. Consider updating all of the onnxruntime-web packages.

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

Successfully merging this pull request may close these issues.

1 participant