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

Training classifiers error #63

Open
Islam231bi opened this issue Jul 21, 2024 · 0 comments
Open

Training classifiers error #63

Islam231bi opened this issue Jul 21, 2024 · 0 comments

Comments

@Islam231bi
Copy link

from ares import ARES

classifier_config = {
    "training_dataset": ["./documents/synthetic_queries_1.csv"], 
    "validation_set": ["./documents/nq_labeled_output.tsv"], 
    "label_column": ["Context_Relevance_Label"], 
    "num_epochs": 10, 
    "patience_value": 3, 
    "learning_rate": 5e-6,
    "assigned_batch_size": 1,
    "model_choice": "t5-small",  
    "gradient_accumulation_multiplier": 32,  
}

ares = ARES(classifier_model=classifier_config)
ares.train_classifier()
Traceback (most recent call last):
  File "/home/islam/Projects/brightskies/repos/BSRAG/test_ares.py", line 16, in <module>
    ares.train_classifier()
  File "/home/islam/.local/lib/python3.10/site-packages/ares/ares.py", line 137, in train_classifier
    binary_classifer_config(**self.classifier_model_config)
  File "/home/islam/.local/lib/python3.10/site-packages/ares/binary_classifier.py", line 164, in binary_classifer_config
    model, avg_train_losses, avg_valid_losses, eval_dataloader, inference_times = train_and_evaluate_model(train_and_eval_settings)
  File "/home/islam/.local/lib/python3.10/site-packages/ares/LLM_as_a_Judge_Adaptation/General_Binary_Classifier.py", line 793, in train_and_evaluate_model
    outputs = model(**new_batch)
  File "/home/islam/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/home/islam/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/islam/.local/lib/python3.10/site-packages/ares/LLM_as_a_Judge_Adaptation/General_Binary_Classifier.py", line 217, in forward
    total_output = self.encoderModel(input_ids=ids, attention_mask=mask)
  File "/home/islam/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/home/islam/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/islam/.local/lib/python3.10/site-packages/transformers/models/t5/modeling_t5.py", line 1517, in forward
    decoder_outputs = self.decoder(
  File "/home/islam/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/home/islam/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/islam/.local/lib/python3.10/site-packages/transformers/models/t5/modeling_t5.py", line 1010, in forward
    raise ValueError(f"You have to specify either {err_msg_prefix}input_ids or {err_msg_prefix}inputs_embeds")
ValueError: You have to specify either decoder_input_ids or decoder_inputs_embeds

I get this error when trying to train a classifier, I installed ares using pip

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

1 participant