Fix: Replace incompatible model loading in example code
#8
by
anon-repair-bot
- opened
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.