huggingface-transformers Questions

1

I'm using sentence-BERT from Huggingface in the following way: from sentence_transformers import SentenceTransformer model = SentenceTransformer('all-MiniLM-L6-v2') model.max_seq_length = 512 model...

1

Solved

I have a large collection of documents each consisting of ~ 10 sentences. For each document, I wish to find the sentence that maximises perplexity, or equivalently the loss from a fine-tuned causal...

1

Solved

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 corre...

1

I am using a quite large GPU which is around 80 GB. The training epochs runs fine but for some reason when evaluating (the training set and validation sets have the same length more or less), I am ...
Seventh asked 20/3, 2023 at 16:31

1

ner_model = pipeline('ner', model=model, tokenizer=tokenizer, device=0, grouped_entities=True) the device indicated pipeline to use no_gpu=0(only using GPU), please show me how to use multi-gpu.
Asch asked 4/10, 2020 at 9:34

1

I am using the python huggingface transformers library for a text-generation model. I need to know how to implement the stopping_criteria parameter in the generator() function I am using. I found t...
Ramulose asked 6/7, 2021 at 21:41

1

Solved

I am trying to load a large Hugging face model with code like below: model_from_disc = AutoModelForCausalLM.from_pretrained(path_to_model) tokenizer_from_disc = AutoTokenizer.from_pretrained(path_t...

1

Solved

As per the title, how are these two Auto Classes on Huggingface different from each other? I tried reading the documentation but did not find differentiating information
Cairistiona asked 23/2, 2023 at 19:45

1

Solved

(Also posted here https://discuss.huggingface.co/t/newbie-understanding-gpt2-loss/33590) I am getting stuck with understanding the GPT2 loss. I want to give the model the label having the target it...
Dap asked 12/3, 2023 at 2:34

1

Solved

I have access to six 24GB GPUs. When I try to load some HuggingFace models, for example the following from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pr...

5

def split_data(path): df = pd.read_csv(path) return train_test_split(df , test_size=0.1, random_state=100) train, test = split_data(DATA_DIR) train_texts, train_labels = train['text'].to_list(),...

2

Giving the right kind of prompt to Flan T5 Language model in order to get the correct/accurate responses for a chatbot/option matching use case. I am trying to use a Flan T5 model for the following...
Heal asked 22/1, 2023 at 18:55

4

I'm using the huggingface Trainer with BertForSequenceClassification.from_pretrained("bert-base-uncased") model. Simplified, it looks like this: model = BertForSequenceClassification.from...
Complot asked 9/5, 2021 at 12:5

1

I want to build a classification model that needs only the encoder part of language models. I have tried Bert, Roberta, xlnet, and so far I have been successful. I now want to test the encoder part...

3

I am creating an entity extraction model in PyTorch using bert-base-uncased but when I try to run the model I get this error: Some weights of the model checkpoint at D:\Transformers\bert-entity-ext...

5

Solved

I am using the HuggingFace Transformers package to access pretrained models. As my use case needs functionality for both English and Arabic, I am using the bert-base-multilingual-cased pretrained m...
Needlecraft asked 2/3, 2020 at 16:20

1

Solved

I have a dataset with type dictionary which I converted to Dataset: ds = datasets.Dataset.from_dict(bio_dict) The shape now is: Dataset({ features: ['id', 'text', 'ner_tags', 'input_ids', 'attenti...
Valeda asked 22/12, 2022 at 7:19

2

Solved

I have fine-tuned my models with GPU but inferencing process is very slow, I think this is because inferencing uses CPU by default. Here is my inferencing code: txt = "This was nice place&quot...
Huntsville asked 9/2, 2022 at 13:44

3

Hi after running this code below, I get the following error. ValueError: Could not load model facebook/bart-large-mnli with any of the following classes: (<class 'transformers.models.auto.modeli...
Malformation asked 7/1, 2022 at 14:43

2

Solved

I am trying to convert the Pegasus newsroom in HuggingFace's transformers model to the ONNX format. I followed this guide published by Huggingface. After installing the prereqs, I ran this code: !r...
Georgeta asked 8/2, 2021 at 20:44

1

I get this message when loading a finetune model of Bert with a forward neural netword on the last layer from a checkpoint directory. This IS expected if you are initializing FlaubertForSequenceCl...

5

I am following this tutorial to learn about the trainer API. https://huggingface.co/transformers/training.html I copied the code as below: from datasets import load_dataset import numpy as np from...
Farflung asked 20/5, 2021 at 17:31

2

I get below warning when I try to run the code from this page. /usr/local/lib/python3.7/dist-packages/transformers/optimization.py:309: FutureWarning: This implementation of AdamW is deprecated and...
Transvestite asked 14/2, 2022 at 14:19

1

Solved

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...

1

Solved

While finetuning a model using HF's trainer. training_args = TrainingArguments(output_dir=data_dir + "test_trainer") metric = load_metric("accuracy") def compute_metrics(eval_...

© 2022 - 2024 — McMap. All rights reserved.