Questions tagged [huggingface]

The huggingface tag can be used for all libraries made by Hugging Face. Please ALWAYS use the more specific tags; huggingface-transformers, huggingface-tokenizers, huggingface-datasets if your question concerns one of those libraries.

606 questions
20
votes
1 answer

Early stopping in Bert Trainer instances

I am fine-tuning a BERT model for a multiclass classification task. My problem is that I don't know how to add "early stopping" to those Trainer instances. Any ideas?
13
votes
1 answer

No module named 'huggingface_hub.snapshot_download'

When I try to run the quick start notebook of this repo, I get the error ModuleNotFoundError: No module named 'huggingface_hub.snapshot_download'. How can I fix it? I already installed huggingface_hub using pip. I get the error after compiling the…
albus_c
  • 6,292
  • 14
  • 36
  • 77
10
votes
2 answers

How do I save a Huggingface dataset?

How do I write a HuggingFace dataset to disk? I have made my own HuggingFace dataset using a JSONL file: Dataset({ features: ['id', 'text'], num_rows: 18 }) I would like to persist the dataset to disk. Is there a preferred way to do this? Or, is…
Campbell Hutcheson
  • 549
  • 2
  • 4
  • 12
7
votes
5 answers

SSLError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /dslim/bert-base-NER/resolve/main/tokenizer_config.json

I am facing below issue while loading the pretrained BERT model from HuggingFace due to SSL certificate error. Error: SSLError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url:…
6
votes
2 answers

How can i solve ImportError: Using the `Trainer` with `PyTorch` requires `accelerate>=0.20.1` when using Huggingface's TrainArguments?

I'm using the transformers library in Google colab, and When i am using TrainingArguments from transformers library i'm getting Import error with this code: from transformers import TrainingArguments training_args = TrainingArguments( …
6
votes
4 answers

How to fix nsfw error for stable diffusion?

I always get the "Potential NSFW content was detected in one or more images. A black image will be returned instead. Try again with a different prompt and/or seed." error when using stable diffusion, even with the code that was given on…
Niklas Mohler
  • 61
  • 1
  • 1
  • 3
6
votes
1 answer

StableDiffusion Colab - How to "make sure you're logged in with `huggingface-cli login`?"

I'm trying to run the Colab example of the Huggingface StableDiffusion generative text-to-image…
Twenkid
  • 825
  • 7
  • 15
6
votes
3 answers

Does Huggingface's "resume_from_checkpoint" work?

I currently have my trainer set up as: training_args = TrainingArguments( output_dir=f"./results_{model_checkpoint}", evaluation_strategy="epoch", learning_rate=5e-5, per_device_train_batch_size=4, per_device_eval_batch_size=4, …
Penguin
  • 1,923
  • 3
  • 21
  • 51
5
votes
0 answers

Starcoder finetuning - How to select the GPU and how to estimate the time it will take to finetune

I'd like to finetune Starcoder (https://huggingface.co/bigcode/starcoder) on my dataset and on a GCP VM instance. It's says in the documentation that for training the model, they used 512 Tesla A100 GPUs and it took 24 days. I also saw the model…
5
votes
1 answer

Which HuggingFace summarization models support more than 1024 tokens? Which model is more suitable for programming related articles?

If this is not the best place to ask this question, please lead me to the most accurate one. I am planning to use one of the Huggingface summarization models (https://huggingface.co/models?pipeline_tag=summarization) to summarize my lecture video…
4
votes
2 answers

Why does llama-index still require an OpenAI key when using Hugging Face local embedding model?

I am creating a very simple question and answer app based on documents using llama-index. Previously, I had it working with OpenAI. Now I want to try using no external APIs so I'm trying the Hugging Face example in this link. It says in the example…
4
votes
1 answer

Target modules for applying PEFT / LoRA on different models

I am looking at a few different examples of using PEFT on different models. The LoraConfig object contains a target_modules array. In some examples, the target modules are ["query_key_value"], sometimes it is ["q", "v"], sometimes something else. I…
ahron
  • 803
  • 6
  • 29
4
votes
1 answer

What is the official way to run a wandb sweep with hugging face (HF) transformers so that all the HF features work e.g. distributed training?

Intially I wanted to run a hugging face run such that if the user wanted to run a sweep they could (and merge them with the command line arguments given) or just execute the run with the arguments from command line. The merging is so that the train…
4
votes
3 answers

Getting RuntimeError: expected scalar type Half but found Float in AWS P3 instances in opt6.7B fine tune

I have a simple code which takes a opt6.7B model and fine tunes it. When I run this code in Google colab(Tesla T4, 16GB) it runs without any problem. But when I try to run the the same code in AWS p3-2xlarge environment (Tesla V100 GPU, 16GB) it…
SRC
  • 2,123
  • 3
  • 31
  • 44
4
votes
1 answer

How to fine tune a Huggingface Seq2Seq model with a dataset from the hub?

I want to train the "flax-community/t5-large-wikisplit" model with the "dxiao/requirements-ner-id" dataset. (Just for some experiments) I think my general procedure is not correct, but I don't know how to go further. My Code: Load tokenizer and…
1
2 3
40 41