microsoft / microsoft/onnxruntime-inference-examples

Javascript web chat example is broken locally and in demo.

Open
#525 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
1.7k
Forks
414
Avg merge
1d 6h
Merged PRs (30d)
14

Description

When trying to run the phi3-mini demo located here: https://guschmue.github.io/ort-webgpu/chat/index.html I am seeing the following errors:

TypeError: Cannot read properties of undefined (reading 'run')
at LLM.generate (llm.js:209:1)
at Query (main.js:233:1)

2025-07-27 15:07:51.676000 [W:onnxruntime:, session_state.cc:1166 VerifyEachNodeIsAssignedToAnEp] Some nodes were not assigned to the preferred execution providers which may or may not have an negative impact on performance. e.g. ORT explicitly assigns shape related ops to CPU to improve perf.

2025-07-27 15:09:42.913699 [W:onnxruntime:, session_state.cc:1168 VerifyEachNodeIsAssignedToAnEp] Rerunning with verbose output on a non-minimal build will show node assignments.

TypeError: A float16 tensor's data must be type of function Float16Array() { [native code] }
at new ze (ort.webgpu.bundle.min.mjs:6:12047)
at LLM.initilize_feed (llm.js:135:44)
at LLM.load (llm.js:118:1)
at async Init (main.js:256:1)

The sample is also broken when trying to run locally although with different errors:

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)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the phi3-mini chat example in the hosted demo and locally, then inspect llm.js at the load, initilize_feed, and generate paths (lines 113, 135, and 209) and main.js at Query and Init (lines 233 and 256). Confirm the fix by loading the model and completing a chat query in both environments without the reported backend, tensor, or run errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.