Comments (4)
from transformers.
@sadra-barikbin
for the trainer API you should specify remove_unused_columns=False
in the TrainingArguments
checkout https://huggingface.co/docs/transformers/main/en/main_classes/trainer#transformers.TrainingArguments.remove_unused_columns for more info
from transformers.
model(**inputs)
rejects those additional columns and raises error by only using remove_unused_columns=False
.
from transformers.
Minimal reproduction:
from typing import Dict, List
from transformers import Trainer, TrainingArguments, AutoTokenizer, AutoModelForCausalLM
from transformers import LineByLineTextDataset, DataCollatorForLanguageModeling
from datasets import Dataset
model = AutoModelForCausalLM.from_pretrained("EleutherAI/pythia-14m")
tokenizer = AutoTokenizer.from_pretrained("EleutherAI/pythia-14m")
tokenizer.pad_token = tokenizer.eos_token
data = Dataset.from_dict({'prompt':['A', 'B'], 'completion': ['a', 'b']})
def tokenize(example: Dict[str, str]) -> Dict[str, List[int]]:
return tokenizer(example['prompt'], f"{example['completion']}.", return_token_type_ids=True)
dataset = data.map(tokenize, remove_columns=['prompt', 'completion'])
args = TrainingArguments(
output_dir="test",
report_to='none',
remove_unused_columns=False,
max_steps=3,
)
trainer = Trainer(
model=model,
tokenizer=tokenizer,
args=args,
data_collator=DataCollatorForLanguageModeling(tokenizer, mlm=False),
train_dataset=dataset,
)
trainer.train()
TypeError: GPTNeoXForCausalLM.forward() got an unexpected keyword argument 'token_type_ids'
from transformers.
Related Issues (20)
- Failed to import transformers HOT 6
- Generation with HybridCache fails (affecting Gemma-2) HOT 2
- Qwen2-1.5B eos_token NoneType Error prevents generation HOT 2
- Vit-hybrid is deprecated, however still shown in the official documentation (with broken links) HOT 4
- compute_metric(eval_pred) in trainer is not mini-batch HOT 2
- transformers.pipeline does not load tokenizer passed as string for custom models HOT 1
- Do we need a config to change `padding_side='left` before the evaluation? HOT 5
- Label Leakage in Gemma 2 Finetuning HOT 3
- QLORA + FSDP distributed fine-tuning failed at the end during model saving stage HOT 4
- Error running inference on CogVLM2 when distributing it on multiple GPUs: Expected all tensors to be on the same device, but found at least two devices HOT 2
- Mismatch with epoch when using gradient_accumulation HOT 3
- AttributeError: 'str' object has no attribute 'shape' HOT 4
- Whisper - list index out of range with word level timestamps HOT 4
- NameError: free variable 'state_dict' referenced before assignment in enclosing scope HOT 3
- Any config for DeBERTa series as decoders for TSDAE? HOT 3
- Unable to load models with adapter weights in offline mode HOT 3
- meta-llama/Llama-2-7b-chat-hf tokenizer `model_max_length` attribute needs to be fixed.
- When I used galore, the learning rate was set to 8e-6, but the training rate was 0.001 HOT 7
- Add `bot_token` attribute to `PreTrainedTokenizer` and `PreTrainedTokenizerFast` HOT 1
- Error when using AutoTokenizer to load local files without network HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from transformers.