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
0
votes
0 answers

Is there a way to tell if the token is from what language?

I'm usig XLMR from hugging face.and I need to do some token filtration.is there a way to tell if the token is from a specific language? for example tokens form id 50 - 500 are English tokens, and from 800- 1200 are Arabic. I think I can use another…
0
votes
0 answers

How to make attention map for Swin Transformers?

I have been working on attention maps feature for one of my projects. I have fine-tuned an image classification model for the same. So how can I develop attention maps for Swin Transformers using Pytorch ? Thanks in advance !!
0
votes
0 answers

Fix tokenization to tensors with padding Huggingface

I'm trying to tokenize my dataset with the following preprocessing function. I've already donlowaded with AutoTokenizer from the Spanish BERT version. ` max_input_length = 280 max_target_length = 280 source_lang = "es" target_lang = "en" prefix =…
0
votes
0 answers

How to get the SHAP values of HuggingFace VisualBERT transformer?

I am trying to extract the SHAP values of VisualBert for "vqa" tasks. On SHAP official documentation there are examples for only text classification . but i don`t know how to extract SHAP values for visualBert. Can anyone help? I tried pipeline…
0
votes
0 answers

Hugging Face facebook/m2m100_418M Inference API

i'm quite new to Hugging face API. All i need is how to add target lagnuage and source language parameters to this code: import requests API_URL = "https://api-inference.huggingface.co/models/facebook/m2m100_418M" headers = {"Authorization": "Bearer…
0
votes
0 answers

Fine tuning model on hugging face gives error "Can't convert non-rectangular Python sequence to Tensor"

This is the code and I guess the error is coming from the padding and truncation part. from datasets import load_dataset, Dataset dataset = load_dataset("go_emotions") train_text = dataset['train']['text'] test_text =…
0
votes
0 answers

How to map Huggingface trainer output to actual label

I have a dataset where I calculate one-hot encoded labels for the hugging face trainer. However I have to drop some labels before training, but I don't know which ones exactly. So the resulting label space looks something like this: {[1,0,0,0],…
0
votes
1 answer

Huggingface Dataset.map shows red progress bar when batched=True

I have the following simple code copied from Huggingface examples: model_checkpoint = "distilgpt2" from transformers import AutoTokenizer tokenizer = AutoTokenizer.from_pretrained(model_checkpoint, use_fast=True) def tokenize_function(examples): …
DiveIntoML
  • 2,347
  • 2
  • 20
  • 36
0
votes
0 answers

transformer Fill mask bad_words_ids

In the documentation on text generation (https://huggingface.co/transformers/main_classes/model.html#generative-models) there is the option to put bad_words_ids (List[int], optional) – List of token ids that are not allowed to be generated. In order…
arnle
  • 480
  • 4
  • 10
0
votes
0 answers

How to hide Hugginface's logging messages in Longformer?

I'm training a longformer model and getting many of these messages: Initializing global attention on multiple choice... Input ids are automatically padded from 412 to 512 to be a multiple of `config.attention_window`: 512 Initializing global…
Penguin
  • 1,923
  • 3
  • 21
  • 51
0
votes
1 answer

How to get all records from a huggingface dataset in a single csv?

The cnn_dailymail dataset contains 3 fields - ID,Text,Highlights I wanted to get all the records in the cnn_dailymail dataset in a single csv , but have been unsuccessful in finding a way. Currently I have downloaded the dataset locally from here…
newbie101
  • 65
  • 7
0
votes
0 answers

T5 while doing hyperparameter search shows "ValueError: You have to specify either decoder_input_ids or decoder_inputs_embeds"

I am working with the huggingface transformers and training a pretrained byt5-small on my data. I am also trying to do hyperparameter search using Trainer API with optuna as backend. But the following error is appearing every time. Please help me…
0
votes
2 answers

NoCredentialsError: Unable to locate credentials in Hugging Face Library

So i am not using Huggin face a lot for my ai but I've discover that you can train you're ai with it so it tried to use my machine to train it but i kept having that error: PS C:\Users\gboss\OneDrive\Bureau\Ai training> &…
ZipperXYZ
  • 1
  • 2
0
votes
1 answer

Build Docker image using Hugging Face's cache

Hugging Face has a caching system to load models from any app. https://huggingface.co/docs/datasets/cache This is useful in most cases, but not when building an image in Docker, as the cache must be downloaded everytime. How can I set the cache…
NicolasSens
  • 117
  • 1
  • 9
0
votes
0 answers

How do I deploy GPU enabled model on HuggingFace?

I have a full stable diffusion image to image model working on Colab, powered by Gradio. However, it requries nvidia gpu. When I deploy it to hugging face spaces, a runtime error occurs: RuntimeError: Found no NVIDIA driver on your system. Please…