Skip to content

Commit 991b259

Browse files
authored
Fix error when dtype in config is unset (#1271)
* Fix auto dtype * Fix typecheck
1 parent 7ac2d8b commit 991b259

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/models.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ async function getSession(pretrained_model_name_or_path, fileName, options) {
191191
// Try to choose the auto dtype based on the custom config
192192
let config_dtype = custom_config.dtype;
193193
if (typeof config_dtype !== 'string') {
194-
config_dtype = config_dtype[fileName];
194+
config_dtype = config_dtype?.[fileName];
195195
}
196196

197197
if (config_dtype && config_dtype !== DATA_TYPES.auto && DATA_TYPES.hasOwnProperty(config_dtype)) {

0 commit comments

Comments
 (0)