nlp-with-transformers / notebooks

Jupyter notebooks for the Natural Language Processing with Transformers book
https://transformersbook.com/
Apache License 2.0
3.82k stars 1.18k forks source link

Ch02: Finetuning code cannot run even git-lfs is installed #40

Open shuuchen opened 2 years ago

shuuchen commented 2 years ago

Information

The problem arises in chapter:

Describe the bug

from transformers import Trainer

trainer = Trainer(model=model, args=training_args, 
                  compute_metrics=compute_metrics,
                  train_dataset=emotions_encoded["train"],
                  eval_dataset=emotions_encoded["validation"],
                  tokenizer=tokenizer)
trainer.train();

When run the code in Jupyer Notebook:

...
OSError: Looks like you do not have git-lfs installed, please install. You can install from [https://git-lfs.github.com/.](https://git-lfs.github.com/) Then run `git lfs install` (you only have to do this once).

I wonder if some other settings are necessary. Thank you.

EdwardJRoss commented 2 years ago

I think more information about your git-lfs installation to understand why this isn't being detected.

I believe git-lfs is only used for pushing to the huggingface hub, so a workaround to train the model coould be to set push_to_hub=False in the training arguments.