Exception: data did not match any variant of untagged enum ModelWrapper at line 250548 column 3
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"
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.
Thank you! Problem solved. After upgrading transformers library version, I got same output.
Nice , good luck