huggingface-transformers Questions

1

I am using GPT-Neo model from transformers to generate text. Because the prompt I use starts with '{', so I would like to stop the sentence once the paring '}' is generated. I found that there is a...

1

I am using sentiment-analysis pipeline as described here. from transformers import pipeline classifier = pipeline('sentiment-analysis') It's failing with a connection error message ValueError: Co...
Especially asked 11/12, 2020 at 7:27

1

Getting this error: AttributeError: 'GPT2Tokenizer' object has no attribute 'train_new_from_iterator' Very similar to hugging face documentation. I changed the input and that's it (shouldn't affe...

3

I want to import transformers in jupyter notebook but I get the following error. What is the reason for this error? My Python version is 3.8 ImportError: cannot import name 'TypeAlias' from 'typing...
Lasalle asked 7/11, 2021 at 20:42

3

I have a trained transformers NER model that I want to use on a machine not connected to the internet. When loading such a model, currently it downloads cache files to the .cache folder. To load an...
Interlard asked 8/6, 2020 at 12:0

3

Solved

I have installed pytorch with conda and transformers with pip. I can import transformers without a problem but when I try to import pipeline from transformers I get an exception: from transformer...
Luettaluevano asked 20/5, 2020 at 12:20

1

Solved

I am fine tuning longformer and then making prediction using TextClassificationPipeline and model(**inputs) methods. I am not sure why I get different results import pandas as pd import datasets fr...
Silicium asked 5/4, 2022 at 16:47

1

Solved

what exactly is the difference between "token" and a "special token"? I understand the following: what is a typical token what is a typical special token: MASK, UNK, SEP, etc w...

2

Solved

I'm looking at the documentation for Huggingface pipeline for Named Entity Recognition, and it's not clear to me how these results are meant to be used in an actual entity recognition model. For in...
Goulet asked 2/8, 2020 at 23:20

1

Solved

What is the loss function used in Trainer from the Transformers library of Hugging Face? I am trying to fine tine a BERT model using the Trainer class from the Transformers library of Hugging Face....

3

Solved

I'm trying to get sentence vectors from hidden states in a BERT model. Looking at the huggingface BertModel instructions here, which say: from transformers import BertTokenizer, BertModel tokenizer...
Postpone asked 18/8, 2020 at 3:0

2

Solved

from transformers import AutoModel, AutoTokenizer tokenizer1 = AutoTokenizer.from_pretrained("roberta-base") tokenizer2 = AutoTokenizer.from_pretrained("bert-base-cased") sequence = "A Titan RTX ...
Trimeter asked 10/4, 2020 at 4:58

1

I have a VM with 2 V100s and I am training gpt2-like models (same architecture, fewer layers) using the really nice Trainer API from Huggingface. I am using the pytorch back-end. I am observing tha...
Capitol asked 16/3, 2022 at 16:2

3

Returns last_hidden_state (torch.FloatTensor of shape (batch_size, sequence_length, hidden_size)): Sequence of hidden-states at the output of the last layer of the model. pooler_output (torc...

1

Solved

I am having trouble when switching a model from some local dummy data to using a TF dataset. Sorry for the long model code, I have tried to shorten it as much as possible. The following works fine:...

1

Solved

I would like to use a model from sentence-transformers inside of a larger Keras model. Here is the full example: import tensorflow as tf from transformers import AutoTokenizer, TFAutoModel MODEL_...

2

Solved

I see some github comments saying the output of the model() call's loss is in the form of perplexity: https://github.com/huggingface/transformers/issues/473 But when I look at the relevant code......

1

What does do_sample parameter of the generate method of the Hugging face model do? Generates sequences for models with a language modeling head. The method currently supports greedy decoding, mult...
Premillennial asked 22/5, 2021 at 1:44

1

Solved

I'm using a BERT model for Extractive QA task with the transformers class library BertForQuestionAnswering. Extractive Question Answering is the task of answering a question for a given context tex...
Anticipant asked 12/5, 2021 at 21:38

2

Solved

According to here pipeline provides an interface to save a pretrained pipeline locally with a save_pretrained method. When I use it, I see a folder created with a bunch of json and bin files presum...
Thekla asked 10/2, 2022 at 1:24

3

I'm trying to run language model finetuning script (run_language_modeling.py) from huggingface examples with my own tokenizer(just added in several tokens, see the comments). I have problem loading...
Delossantos asked 22/5, 2020 at 4:18

2

Solved

I'm trying to figure out how sequence to sequence loss is calculated. I am using the huggingface transformers library in this case, but this might actually be relevant to other DL libraries. So to ...
Cross asked 15/3, 2021 at 7:22

2

Solved

I have followed the basic example as given below, from: https://huggingface.co/transformers/training.html from transformers import TFBertForSequenceClassification, TFTrainer, TFTrainingArguments m...
Skeptic asked 21/2, 2021 at 12:37

1

Solved

Goal: Amend this Notebook to work with albert-base-v2 model. Kernel: conda_pytorch_p36. I did Restart & Run All, and refreshed file view in working directory. In order to evaluate and to expor...

2

Solved

Currently Helsinki-NLP/opus-mt-es-en model takes around 1.5sec for inference from transformer. How can that be reduced? Also when trying to convert it to onxx runtime getting this error: ValueErro...
Lustral asked 2/1, 2021 at 17:6

© 2022 - 2024 — McMap. All rights reserved.