pdufour commited on
Commit
104dfa1
·
verified ·
1 Parent(s): 41a2bcb

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +6 -0
index.js CHANGED
@@ -136,6 +136,12 @@ export async function imageTextToText(
136
 
137
  const dummy = new ort.Tensor("int32", new Int32Array([0]), []);
138
 
 
 
 
 
 
 
139
  let { hidden_states } = await ortSessionB.run({
140
  input_ids: input_ids,
141
  ids_len: ids_len,
 
136
 
137
  const dummy = new ort.Tensor("int32", new Int32Array([0]), []);
138
 
139
+ if (!ortSessionB) {
140
+ await ort.InferenceSession.create(
141
+ await getModelFile(ONNX_MODEL, `onnx/QwenVL_B_${QUANT}.onnx`),
142
+ { executionProviders: ["webgpu"] }
143
+ );
144
+ }
145
  let { hidden_states } = await ortSessionB.run({
146
  input_ids: input_ids,
147
  ids_len: ids_len,