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
1
vote
1 answer

HuggingFace - GPT2 Tokenizer configuration in config.json

The GPT2 finetuned model is uploaded in huggingface-models for the inferencing Below error is observed during the inference, Can't load tokenizer using from_pretrained, please update its configuration: Can't load tokenizer for…
1
vote
1 answer

Huggingface Transformer Priming

I am trying to replicate the results of this demo, whose author primes GPT-3 with just the following text: gpt.add_example(Example('apple', 'slice, eat, mash, cook, bake, juice')) gpt.add_example(Example('book', 'read, open, close, write…
Mobeus Zoom
  • 598
  • 5
  • 19
1
vote
0 answers

Why using GPT2Tokenizer convert Arabic characters to symbols?

I am trying to use GPT2 for Arabic text classification task as follows: tokenizer = GPT2Tokenizer.from_pretrained(model_path) model = GPT2ForSequenceClassification.from_pretrained(model_path, …
1
vote
1 answer

RuntimeError: Input tensor at index 3 has invalid shape [2, 2, 16, 128, 64] but expected [2, 4, 16, 128, 64]

Runtime error while finetuning a pretrained GPT2-medium model using Huggingface library in SageMaker - ml.p3.8xlarge instance. The finetuning_gpt2_script.py contains the below, Libraries: from transformers import Trainer, TrainingArguments from…
1
vote
0 answers

Cannot convert from a fine-tuned GPT-2 model to a Tensorflow Lite model

I've fine tuned a distilgpt2 model using my own text using run_language_modeling.py and its working fine after training and run_generation.py script produces the expected results. Now I want to convert this to a Tensorflow Lite model and did so by…
1
vote
1 answer

Why new lines aren't generated with my fine-tuned DistilGPT2 model?

I'm currently trying to fine-tune DistilGPT-2 (with Pytorch and HuggingFace transformers library) for a code completion task. My corpus is arranged like the following example: <|startoftext|> public class FindCityByIdService { private…
1
vote
0 answers

huggingface transformers run_clm.py stops early

I'm running run_clm.py to fine-tune gpt-2 form the huggingface library, following the language_modeling example: !python run_clm.py \ --model_name_or_path gpt2 \ --train_file train.txt \ --validation_file test.txt \ --do_train \ …
xiexieni9527
  • 111
  • 7
1
vote
2 answers

Scripts missing for GPT-2 fine tune, and inference in Hugging-face GitHub?

I am following the documentation on the hugging face website, in there they say that to fine-tune GPT-2 I should use the script run_lm_finetuning.py for fine-tuning, and the script run_generation.py for inference. However, both scripts don't…
1
vote
0 answers

Use BertTokenizer with HuggingFace GPT-2

I have a specific generation problem involving a dataset built from a very small vocabulary. Ideally, my use case will be much more straightforward if I can simply provide that vocabulary in a fixed set of tokens. I know that with the BertTokenizer,…
jbm
  • 1,248
  • 10
  • 22
1
vote
2 answers

Huggin Face Conversational error: error: argument --model: invalid choice: 'models/' (choose from 'openai-gpt', 'gpt2')

I´m trying to replicate the results of this repo: https://github.com/huggingface/transfer-learning-conv-ai For that I'm following the basic example that is not based on docker: git clone https://github.com/huggingface/transfer-learning-conv-ai cd…
Luis Ramon Ramirez Rodriguez
  • 9,591
  • 27
  • 102
  • 181
1
vote
1 answer

why is encoder.json not found when running GPT2 small model

good evening, caveat, im not a python or machine learning expert I'm trying to run the small instance of GPT2 , after the hype I wanted to check it out. So far I've downloaded all the prerequisites. Python, regex, tensorflow etc. but when it comes…
1
vote
1 answer

Generate text from input on default model gpt-2-simple python

I can't figure out for the life of me how to generate text from the default model feeding in a prefix: I have downloaded the model and here is my code: import gpt_2_simple as gpt2 model_name = "124M" sess =…
Luke Prior
  • 885
  • 2
  • 11
  • 34
1
vote
1 answer

Train GPT-2 on local machine, load dataset

I am trying to run gpt-2 on my local machine, since google restricted my resources, because I was training too long in colab. However, I cannot see how I can load the dataset. In the original colab notebook…
0
votes
0 answers

GPT2 and HuggingFace Transformers: repeating user_input in response

I am just getting into making my first model using GPT 2 and the HuggingFace Transformers library in Python as my gateway into understanding model training. I'm running this on Python 3.7 with the latest version of all imported modules available. I…
Yuuty
  • 123
  • 10
0
votes
0 answers

Softmax output and probabilities not matching up?

I'm trying to test how well a GPT model can classify verbs according to the left-side context in a given input sentence with a masked term. For example, Input Sentence: "The ballerinas' costumes that the thieves stole from the theatre last night…