From a6f3f88231f7fccf15b21a25ff58c2a10811d96c Mon Sep 17 00:00:00 2001 From: Joshua Lochner Date: Mon, 5 Feb 2024 17:35:49 +0200 Subject: [PATCH] Improve unknown model warnings (#554) Warn with model type if known --- src/models.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models.js b/src/models.js index 789f853fe..19119ecfe 100644 --- a/src/models.js +++ b/src/models.js @@ -788,7 +788,7 @@ export class PreTrainedModel extends Callable { } else { // should be MODEL_TYPES.EncoderOnly if (modelType !== MODEL_TYPES.EncoderOnly) { - console.warn(`Model type for '${modelName}' not found, assuming encoder-only architecture. Please report this at https://github.com/xenova/transformers.js/issues/new/choose.`) + console.warn(`Model type for '${modelName ?? config?.model_type}' not found, assuming encoder-only architecture. Please report this at https://github.com/xenova/transformers.js/issues/new/choose.`) } info = await Promise.all([ AutoConfig.from_pretrained(pretrained_model_name_or_path, options),