Skip to content

Commit

Permalink
Only log warning if type not explicitly set to "custom" (#1061)
Browse files Browse the repository at this point in the history
  • Loading branch information
xenova authored Dec 2, 2024
1 parent aead8a9 commit 3d9b9e6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,10 @@ export class PreTrainedModel extends Callable {

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

0 comments on commit 3d9b9e6

Please sign in to comment.