Questions tagged [gpt-2]

Use this tag with Generative Pre-trained Transformer 2 (GPT-2). Do not use with GPT-3 or the ad tagging library (GPT).

References

See the GPT-2 definition on Wikipedia.

Related Tags

199 questions
0
votes
0 answers

Does anyone knows how to input a text content in huggingface gpt2?

I want to input conversation data as an input to the gpt2 model from huggingface transformers. ====Example==== A: Where did you meet David? B: I met him at the central park. A: Weren't he quite strange that day? => predicted B: Not at all,…
NAME
  • 1
  • 1
0
votes
1 answer

How to get the language modeling loss by passing 'labels' while using ONNX inference session?

When using GPT2 we can simply pass on the 'labels' parameter to get the loss as follows: import torch from transformers import GPT2Tokenizer, GPT2LMHeadModel tokenizer = GPT2Tokenizer.from_pretrained('gpt2') model =…
0
votes
0 answers

How to push trained NLP model to huggingface.co via git-lfs?

I used "!sudo apt-get install git-lfs", and I'm on windows, am I wrong somewhere: how can I get pas this error message? Text: [ ] model.push_to_hub (MY_MODEL_NAME, use_auth_token=HUGGINGFACE_API_KEY) tokenizer.push_to_hub(MY MODEL_NAME,…
HrugVed
  • 23
  • 6
0
votes
1 answer

ValueError when trying to fine-tune GPT-2 model in TensorFlow

I am encountering a ValueError in my Python code when trying to fine-tune Hugging Face's distribution of the GPT-2 model. Specifically: ValueError: Dimensions must be equal, but are 64 and 0 for '{{node Equal_1}} = Equal[T=DT_FLOAT,…
0
votes
2 answers

Fine-tuning GPT-2/3 on new data

I'm trying to wrap my head around training OpenAI's language models on new data sets. Is there anyone here with experience in that regard? My idea is to feed either GPT-2 or 3 (I do not have API access to 3 though) with a textbook, train it on it…
Quantizer
  • 275
  • 3
  • 13
0
votes
1 answer

How can text completion using the GPT-2 language model generate a full URL?

I found this auto text completion on Mr Fabrice Bellard's website. Then I ask like in the picture: So my question is: Is the respond text is generated randomly or somehow controlled by the text I typed (and if it's controlled by the text I typed,…
raspiduino
  • 601
  • 7
  • 16
0
votes
1 answer

JSONDecodeError: Unexpected UTF-8 BOM (decode using utf-8-sig): line 1 column 1 (char 0) ---While Tuning gpt2.finetune

Hope you all are doing good , I am working on fine tuning GPT 2 model to generate Title based on the content ,While working on it ,I have created a simple CSV files containing only the title to train the model , But while inputting this model to GPT…
Harry DSOUZA
  • 27
  • 1
  • 2
0
votes
1 answer

Using AI generators to ask questions to provoke thinking instead of giving answers?

I have a use case that I want to use to help independent creators talk about their interests on Twitter using their experiences. It goes like this: You have an interest you want to talk about Entrepreneurship You have an experience like Pain Is…
Shavin Peiris
  • 81
  • 1
  • 9
0
votes
0 answers

Pytorch inference OOM after some batches

I am trying to do inference with a GPT2-like model on a large dataset (26k samples). To speed it up I would like to do it in batches, but trying this it goes in Cuda OOM after some batches. The fact that it goes out only after some batches sounds…
Vitto
  • 361
  • 3
  • 17
0
votes
1 answer

Train GPT2 with Trainer & TrainingArguments using/specifying attention_mask

I'm using Trainer & TrainingArguments to train GPT2 Model, but it seems that this does not work well. My datasets have the ids of the tokens of my corpus and the mask of each text, to indicate where to apply the attention: Dataset({ features:…
0
votes
0 answers

Understanding repository gpt transformer

For my project I need to understand and being able to execute this github repository about commonsense generation using the GPT transformer language model. It is quite extensive and I don't have enough programming experience to make sense of it all.…
m.b
  • 45
  • 1
  • 4
0
votes
1 answer

GPT-2's encoder.py and train.py are not working

I'm trying to train GPT-2 to use what I provide in a text file, napoleon.txt. When I run the encoder, it seems to work from the command prompt. python encoder.py napoleon.txt napoleon.npz It doesn't, however, actually create napoleon.npz. But this…
Andrei
  • 1
0
votes
1 answer

Speeding up Inference time on GPT2 - optimizing tf.sess.run()

I am trying to optimize the inference time on GPT2. The current time to generate a sample after calling the script is 55 secs on Google Colab. I put in timestamps to try to isolate where the bottleneck is. This is the code: for _ in range(nsamples…
0
votes
0 answers

Is it possible to train gpt2 with our own data to generate text?

I want to use gpt2 to generate text. I tried to train the model on my own dataset but at the end it generate one word only. I couldn't find a solution to this issue. Is there a way to solve this?
Hinda Hind
  • 21
  • 3
0
votes
1 answer

Train huggingface's GPT2 from scratch : assert n_state % config.n_head == 0 error

I am trying to use a GPT2 architecture for musical applications and consequently need to train it from scratch. After a bit of googling I found that the issue #1714 from huggingface's github already had "solved" the question. When I try the to run…
1 2 3
13
14