huggingface-transformers Questions

2

Solved

I am trying to train an NER model using the HuggingFace transformers library on Colab cloud GPUs, pickle it and load the model on my own CPU to make predictions. Code The model is the following: fr...

2

Given a simple neural net in Pytorch like: import torch.nn as nn net = nn.Sequential( nn.Linear(3, 4), nn.Sigmoid(), nn.Linear(4, 1), nn.Sigmoid() ).to(device) How do I convert it into a Hug...

1

i want to run the pipeline abstract for zero-shot-classification task on the mps device. Here is my code pipe = pipeline('zero-shot-classification', device = mps_device) seq = "i love watching...
Thrall asked 4/7, 2022 at 20:57

1

I have the following goal, which I have been trying to achieve with the Huggingface Library but I encountered some roadblocks. The Problem: I want to generate sentences in a differentiable way at t...

6

Solved

I'm trying to build the model illustrated in this picture: I obtained a pre-trained BERT and respective tokenizer from HuggingFace's transformers in the following way: from transformers import Aut...

3

Solved

I'm using the HuggingFace Transformers BERT model, and I want to compute a summary vector (a.k.a. embedding) over the tokens in a sentence, using either the mean or max function. The complication i...

2

Solved

I have followed this tutorial for masked language modelling from Hugging Face using BERT, but I am unsure how to actually deploy the model. Tutorial: https://github.com/huggingface/notebooks/blob/m...

2

I am trying to reload a fine-tuned DistilBertForTokenClassification model. I am using transformers 3.4.0 and pytorch version 1.6.0+cu101. After using the Trainer to train the downloaded model, I sa...
Maltzman asked 3/11, 2020 at 13:3

1

I want to fine tune a GPT-2 model using Huggingface’s Transformers. Preferably the medium model but large if possible. Currently, I have a RTX 2080 Ti with 11GB of memory and I can train the small ...
Lepp asked 28/3, 2020 at 17:16

1

Solved

I've extensively look over the internet, hugging face's (hf's) discuss forum & repo but found no end to end example of how to properly do ddp/distributed data parallel with HF (links at the end...

6

From the documentation for from_pretrained, I understand I don't have to download the pretrained vectors every time, I can save them and load from disk with this syntax: - a path to a `directory` ...
Opah asked 21/9, 2020 at 23:23

3

I want all special tokens to always be available. How do I do this? My first attempt to give it to my tokenizer: def does_t5_have_sep_token(): tokenizer: PreTrainedTokenizerFast = AutoTokenizer.fr...
Nucleolated asked 11/8, 2022 at 14:32

0

I am attempting to run the T5 transformer on an M1 Mac using MPS backend: import torch import json from transformers import T5Tokenizer, T5ForConditionalGeneration, T5Config #Make sure sentencepie...
Ditchwater asked 23/7, 2022 at 18:31

1

Solved

I am using a model from hugging face, specifically Davlan/distilbert-base-multilingual-cased-ner-hrl. However, I am not able to extract full entity names from the result. If I run the following cod...
Kingmaker asked 19/7, 2022 at 8:30

2

Solved

I would like to create a minibatch by encoding multiple sentences using transform.BertTokenizer. It seems working for a single sentence. How to make it work for several sentences? from transformers...

3

Solved

I want to add a dense layer on top of the bare BERT Model transformer outputting raw hidden-states, and then fine tune the resulting model. Specifically, I am using this base model. This is what th...
Brantbrantford asked 1/10, 2020 at 13:16

0

I am trying to fine-tune a pre-trained model from huggingface (PyTorch version). I am using my custom dataset. This is my code for my custom dataset from torch.utils.data import DataLoader, Dataset...
Kurgan asked 2/7, 2022 at 21:39

1

I have been trying to fine-tune a conversational model of HuggingFace: Blendebot. I have tried the conventional method given on the official hugging face website which asks us to do it using the tr...
Jeanne asked 27/6, 2022 at 18:30

2

Solved

Here is an example of doing sequence classification using a model to determine if two sequences are paraphrases of each other. The two examples give two different results. Can you help me explain w...
Arquit asked 10/5, 2020 at 7:16

0

Should the HuggingFace transformers TrainingArguments dataloader_num_workers argument be set per GPU? Or total across GPUs? And does this answer change depending whether the training is running in ...
Pretzel asked 13/6, 2022 at 4:21

2

Solved

question 1) The answer to this question suggested that for a binary classification problem I could use num_labels as 1 (positive or not) or 2 (positive and negative). Is there any guideline regardi...
Placer asked 6/4, 2022 at 13:53

3

I am more or less following this example to integrate the ray tune hyperparameter library with the huggingface transformers library using my own dataset. Here is my script: import ray from ray impo...
Rolypoly asked 2/6, 2021 at 2:18

1

Solved

I am using T5 model and tokenizer for a downstream task. I want to add certain whitespaces to the tokenizer like line ending (\t) and tab (\t). Adding these tokens work but somehow the tokenizer al...

2

I was curious if it is possible to use transfer learning in text generation, and re-train/pre-train it on a specific kind of text. For example, having a pre-trained BERT model and a small corpus ...

3

Solved

I have some custom data I want to use to further pre-train the BERT model. I’ve tried the two following approaches so far: Starting with a pre-trained BERT checkpoint and continuing the pre-traini...

© 2022 - 2024 — McMap. All rights reserved.