We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9584263 commit 4f08a3dCopy full SHA for 4f08a3d
src/models.js
@@ -1757,7 +1757,7 @@ export class PreTrainedModel extends Callable {
1757
const dtype = session?.config?.kv_cache_dtype ?? 'float32';
1758
const empty = (dtype === 'float16') ? new Uint16Array() : [];
1759
1760
- const batch_size = (decoderFeeds[this.main_input_name] ?? decoderFeeds.attention_mask).dims?.[0] ?? 1;
+ const batch_size = (decoderFeeds[this.main_input_name] ?? decoderFeeds.attention_mask)?.dims?.[0] ?? 1;
1761
const shapes = getKeyValueShapes(this.config, { batch_size });
1762
1763
for (const name in shapes) {
0 commit comments