Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receiving NaN for predictions. #1

Open
Kesanov opened this issue Nov 13, 2024 · 1 comment
Open

Receiving NaN for predictions. #1

Kesanov opened this issue Nov 13, 2024 · 1 comment

Comments

@Kesanov
Copy link

Kesanov commented Nov 13, 2024

Hi, I have tested the classifier on my dataset with variable length input sequences up to 1024, and I am receiving NaN values for predictions for some reason.

The setup I use is:

MODEL = "state-spaces/mamba-130m-hf"
tokenizer = AutoTokenizer.from_pretrained(MODEL, add_eos_token=True, use_fast=True)

def tokenize(text):
  tokenizer(text, padding="max_length", truncation=True, max_length=1024)
  
id2label = {0: "NEGATIVE", 1: "POSITIVE"}
label2id = {"NEGATIVE": 0, "POSITIVE": 1}
model = MambaForSequenceClassification.from_pretrained(model, num_labels=2, id2label=id2label, label2id=label2id, use_cache=False)

# train with HF trainer and dataset
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@Kesanov and others