Skip to content

Commit

Permalink
Improve unknown model warnings (#554)
Browse files Browse the repository at this point in the history
Warn with model type if known
  • Loading branch information
xenova authored Feb 5, 2024
1 parent 2b3dcb1 commit a6f3f88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit a6f3f88

Please sign in to comment.