Fix: Replace incompatible model loading in example code

#8

Description

The example code fails at runtime with the following error when attempting to run the fill-mask task:

KeyError: 'logits'

Changes

Replaced:

pipe = pipeline('fill-mask', model=model, tokenizer=tokenizer)

with:

pipe = pipeline('fill-mask', model="neuralmind/bert-base-portuguese-cased")

Testing

The code has been successfully tested and runs without error.

Note

This contribution is part of an ongoing research initiative to systematically identify and correct faulty example code in Hugging Face Model Cards.
We would appreciate a timely review and integration of this patch to support code reliability and enhance reproducibility for downstream users.

LGTM

(but it has to be @neuralmind to merge the PR :) )

Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment