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 11db949 commit aead8a9Copy full SHA for aead8a9
src/models.js
@@ -1814,7 +1814,7 @@ export class PreTrainedModel extends Callable {
1814
const dtype = session?.config?.kv_cache_dtype ?? 'float32';
1815
const empty = (dtype === 'float16') ? new Uint16Array() : [];
1816
1817
- 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;
1818
const shapes = getKeyValueShapes(this.config, { batch_size });
1819
1820
for (const name in shapes) {
0 commit comments