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
3
votes
1 answer

Using a custom trained huggingface tokenizer

I’ve trained a custom tokenizer using a custom dataset using this code that’s on the documentation. Is there a method for me to add this tokenizer to the hub and to use it as the other tokenizers by calling the AutoTokenizer.from_pretrained()…
3
votes
0 answers

Can I use LoRa and Prompt Tuning at the same time for text summarization with GPT?

LoRA is to insert and learn the rank composition matrix created by dimensionally reducing the weight matrix in the transformer. Prompt Tuning, on the other hand, typically uses a soft prompt that encodes the prompt within the model to learn, rather…
3
votes
1 answer

How to use Huggingface Trainer with multiple GPUs?

Say I have the following model (from this script): from transformers import AutoTokenizer, GPT2LMHeadModel, AutoConfig config = AutoConfig.from_pretrained( "gpt2", vocab_size=len(tokenizer), n_ctx=context_length, …
Penguin
  • 1,923
  • 3
  • 21
  • 51
3
votes
0 answers

Huggingface: ValueError: You have to specify either decoder_input_ids or decoder_inputs_embeds

I am fine-tuning 'microsoft/trocr-base-printed' image2text model to let it recognize the captcha text on it. I was able to find this link to try to avoid the error: ValueError: You have to specify either decoder_input_ids or decoder_inputs_embeds,…
wJoyW
  • 51
  • 1
  • 5
3
votes
1 answer

How to use diffusers with custom ckpt file

Currently I have the current code which runs a prompt on a model which it downloads from huggingface. from diffusers import StableDiffusionPipeline, EulerDiscreteScheduler model_id = "stabilityai/stable-diffusion-2" # Use the Euler scheduler here…
Mohammad Razeghi
  • 1,574
  • 2
  • 14
  • 33
3
votes
0 answers

Huggingface: Fine-tuning (not enough values to unpack (expected 2, got 1))

I'm trying to fine-tune erfan226/persian-t5-paraphraser paraphrase generator model for Persian sentences. I used the Persian dataset of tapaco and reformatted it to match the glue (mrpc) dataset which is used in the fine-tuning documentation. I have…
3
votes
3 answers

How to use AWS Sagemaker with newer version of Huggingface Estimator?

When trying to use Huggingface estimator on sagemaker, Run training on Amazon SageMaker e.g. # create the Estimator huggingface_estimator = HuggingFace( entry_point='train.py', source_dir='./scripts', …
alvas
  • 115,346
  • 109
  • 446
  • 738
3
votes
1 answer

Text generation AI models generating repeated/duplicate text/sentences. What am I doing incorrectly? Hugging face models - Meta GALACTICA

Whole day I have worked with available text generation models Here you can find list of them : https://huggingface.co/models?pipeline_tag=text-generation&sort=downloads I want to generate longer text outputs, however, with multiple different models,…
Furkan Gözükara
  • 22,964
  • 77
  • 205
  • 342
3
votes
0 answers

Huggingface datasets storing and loading image data

I have a huggingface dataset with an image column ds["image"][0] When I save to disk, load it later I get the image column as…
Vincent Claes
  • 3,960
  • 3
  • 44
  • 62
3
votes
1 answer

How to split input text into equal size of tokens, not character length, and then concatenate the summarization results for Hugging Face transformers

I am using the below methodology to summarize longer than 1024 token size long texts. Current method splits the text by half. I took this from another user's post and modified it slightly. So what I want to do is, instead of splitting into half,…
3
votes
4 answers

How to save a SetFit trainer locally after training

I am working on an HPC with no internet access on worker nodes and the only option to save a SetFit trainer after training, is to push it to HuggingFace hub. How do I go about saving it locally to disk? https://github.com/huggingface/setfit
3
votes
1 answer

How to fine-tune gpt-j using Huggingface Trainer

I'm attempting to fine-tune gpt-j using the huggingface trainer and failing miserably. I followed the example that references bert, but of course, the gpt-j model isn't exactly like the bert model. The error indicates that the model isn't producing…
3
votes
0 answers

Batch size during training vs batch size during evaluation

I am confused about the difference between batch size during training versus batch size during evaluation. I am trying to measure how batch size influences the inference time(speed of prediction) of different NLP models after they have been trained…
MartinDK
  • 33
  • 3
3
votes
2 answers

ValueError: Tokenizer class MarianTokenizer does not exist or is not currently imported

Get this error when trying to run a MarianMT-based nmt model. Traceback (most recent call last): File "/home/om/Desktop/Project/nmt-marionmt-api/inference.py", line 45, in print(batch_inference(model_path="en-ar-model/Mark2",…
Om Rastogi
  • 478
  • 1
  • 5
  • 12
3
votes
1 answer

Is there any way I can use the downloaded pre-trained models for TIMM?

For some reason, I have to use TIMM package offline. But I found that if I use create_model(), for example: self.img_encoder = timm.create_model("swin_base_patch4_window7_224", pretrained=True) I would get http.client.RemoteDisconnected: Remote end…
Yy X
  • 31
  • 3
1 2
3
40 41