Exception: data did not match any variant of untagged enum ModelWrapper at line 250548 column 3

#1
by alex6610 - opened

When I ran this model, I got this error "Exception: data did not match any variant of untagged enum ModelWrapper at line 250548 column 3"
How to solve this problem? Thankyou!
code:
"from transformers import AutoTokenizer, AutoModel

Load model and tokenizer

tokenizer = AutoTokenizer.from_pretrained("NAMAA-Space/AraModernBert-Base-V1.0")
model = AutoModel.from_pretrained("NAMAA-Space/AraModernBert-Base-V1.0")

Encode text

text = "مرحبا بكم في عالم الذكاء الاصطناعي"
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)

Get embeddings

embeddings = outputs.last_hidden_state"

Network for Advancing Modern ArabicNLP & AI org

Hi Alex,

The code runs normally for me when tested on Colab, so the issue might be related to version differences. Could you please ensure that you're adding the READ TOKEN to both the tokenizer and the model? Also, make sure to upgrade your transformers library by running pip install --upgrade transformers.

Screenshot 2025-04-15 at 8.33.44 AM.png

Thank you! Problem solved. After upgrading transformers library version, I got same output.

Network for Advancing Modern ArabicNLP & AI org

Nice , good luck

Omartificial-Intelligence-Space changed discussion status to closed
Your need to confirm your account before you can post a new comment.

Sign up or log in to comment