Skip to content

Commit 3d9b9e6

Browse files
authored
Only log warning if type not explicitly set to "custom" (#1061)
1 parent aead8a9 commit 3d9b9e6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/models.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,10 @@ export class PreTrainedModel extends Callable {
10701070

10711071
} else { // should be MODEL_TYPES.EncoderOnly
10721072
if (modelType !== MODEL_TYPES.EncoderOnly) {
1073-
console.warn(`Model type for '${modelName ?? config?.model_type}' not found, assuming encoder-only architecture. Please report this at ${GITHUB_ISSUE_URL}.`)
1073+
const type = modelName ?? config?.model_type;
1074+
if (type !== 'custom') {
1075+
console.warn(`Model type for '${type}' not found, assuming encoder-only architecture. Please report this at ${GITHUB_ISSUE_URL}.`)
1076+
}
10741077
}
10751078
info = await Promise.all([
10761079
constructSessions(pretrained_model_name_or_path, {

0 commit comments

Comments
 (0)