Questions tagged [huggingface-trainer]

33 questions
0
votes
2 answers

How to use huggingface HF trainer train with custom collate function?

I have some custom data set with custom table entries and wanted to deal with it with a custom collate. But it didn't work when I pass a collate function I wrote (that DOES work on a individual dataloader e.g., see How does one create a pytorch data…
0
votes
0 answers

Weighted Loss in Huggingface Generator module

I am using Huggginface's Seq2SeqTrainer module and Generator modules for my encoder-decoder models. I have to use weighted sample loss calculation in each mini-batches. Does anyone know how to achieve this ? Is there a way to do weighted loss in…
0
votes
1 answer

Huggingface SFT for completion only not working

I have a project where I am trying to finetune Llama-2-7b on a dataset for Parameter extraction, which is linked here: . The problem with the dataset is that the context for a…
0
votes
0 answers

With a HuggingFace trainer, how do I show the training loss versus the eval data set?

I'm running: #original training script trainer = transformers.Trainer( model=model, train_dataset=train_dataset, eval_dataset=test_dataset, #turn on the eval dataset for comparisons args=transformers.TrainingArguments( …
0
votes
0 answers

input batch_size does not match target batch_size when fine-tuning AutoModelForCausalLM

I would like to fine-tune a model to do the following task: given an input text, return relevant labels that describe it. One example might be applying labels to stack overflow questions--the key points here are that there are many labels (on the…
0
votes
0 answers

divide huggingface dataset into equal sized and uniform classed parts

I have local image data in which each subfolder contains images of a class, loaded the data with load_dataset . then i noticed it is very slow in the feature extracting and training process, so I want to divide the data into 10 parts, each…
0
votes
0 answers

Can we add new set of start_token_id for different examples based on different tasks in huggingface API?

I am trying to modify Huggingface Seq2SeqTrainer() and other APIs such that the model works with prefix allowed function. I wrote a prefix_allowed_funtion() to allow different tasks for each examples during train & test phases. However, since start…
0
votes
0 answers

How to constraint decode using a prompt in Huggingface (encoder-decoder model)?

I am trying to use Huggingface generate() function for sequence generation task. My model uses encoder-decoder architecture, where I can't really do prompting. But what I can do is forcing the model to start generating tokens right after the prompt.…
0
votes
0 answers

'CTCTrainer' object has no attribute 'deepspeed' while training huggingsound speech recognition model training for my custom dataset

I tried to train the "facebook/wav2vec2-large-xlsr-53" model in huggingface to my custom dataset. training_args = TrainingArguments( learning_rate=3e-4, max_steps=10000, eval_steps=100, per_device_train_batch_size=8, …
0
votes
0 answers

Why Seq2SeqTrainer does not have a predict_dataset argument?

I am using Seq2SeqTrainer for my experiments. But it only takes train_dataset & eval_dataset. To only do prediction without calculating eval metrics, how can I input predict_datadset (test data) ?
0
votes
0 answers

HuggingFace autotrain for entity recognition?

I'm trying to fine tune an entity recognition model on HuggingFace using their autotrain feature, but once I select autotrain, 'Token classification' is the only option available, but that's not what I need. How do I fine tune an NER model?
0
votes
1 answer

How to determine the value of early_stopping_patience in HuggingFace's Seq2SeqTrainer EarlyStoppingCallback?

In my Seq2SeqTrainer, I use EarlyStoppingCallback to stop the training process when the criteria has been met. trainer = Seq2SeqTrainer( model = model, args = training_args, train_dataset = train_set, eval_dataset = eval_set, …
Raptor
  • 53,206
  • 45
  • 230
  • 366
0
votes
0 answers

how to use Fully Sharded Data Parallel (FSDP) via Seq2SeqTrainer class of hugging face?

I have 2 GTX 1080 Ti GPUs(11G RAM each one) and i want to fine-tune openai/whisper-small model which one of the hugging face transformers models. Also, I want to use Fully Sharded Data Parallel(FSDP) via seq2seqTrainer but i got error. torch…
0
votes
0 answers

Huggingface trainer leaves residual memory

I am currently trying to use huggingface trainer in a for-loop esque setting: I am training on single data examples and then evaluating for each example in my dataset - so I initialize trainer, and call trainer.train() multiple times in my script.…
0
votes
0 answers

TypeError: unhashable type: 'list' Trainer.train() error

I am trying to encode string labels as numerical values to be used for training I load the dataset below and get just the labels columns dataset = load_dataset("csv", data_files="dataset") features =…