Downloads · 30 days
17
4% of all-time downloads
TomData/GPT2-review
GPT2-review is a text generation model from TomData. Use it when you need the model to write or continue text. It is set up for pytorch.
Model Description: This model is a checkpoint of GPT-2 Medium the 355M parameter version of GPT-2, a transformer-based language model created and released by OpenAI. The model is a further pretrained model on a causal…
Downloads · 30 days
17
4% of all-time downloads
All-time downloads
413
Public
Parameters
355M
1.4 GB on disk
Likes
3
Public
Click a slice to open those files.
.safetensors1.4 GB · 100%
From the Hugging Face model README
Model Description: This model is a checkpoint of GPT-2 Medium the 355M parameter version of GPT-2, a transformer-based language model created and released by OpenAI. The model is a further pretrained model on a causal language modeling (CLM) objective with English Amazon Product Reviews from the Fashion category.
Use the code below to get started with the model. You can use this model directly with a pipeline for text generation. Since the generation relies on some randomness, we set a seed for reproducibility:
>>> from transformers import pipeline, set_seed
>>> generator = pipeline('text-generation', model='TomData/GPT2-review')
>>> set_seed(42)
>>> generator("Hello, I'm a language model,", max_length=30, num_return_sequences=5)
Here is how to use this model to get the features of a given text in PyTorch:
tokenizer = AutoTokenizer.from_pretrained("TomData/GPT2-review")
model = AutoModelForCausalLM.from_pretrained("TomData/GPT2-review")
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)
and in TensorFlow:
tokenizer = AutoTokenizer.from_pretrained("TomData/GPT2-review")
model = AutoModelForCausalLM.from_pretrained("TomData/GPT2-review")
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='tf')
output = model(encoded_input)
This model is further pretrained to generate artificial product reviews. This can be usefull for:
The model is further pretrained on the Amazion Review Dataset from McAuley-Lab. For training only the reviews related to the Amazon Fashion category are used. See:
dataset = load_dataset("McAuley-Lab/Amazon-Reviews-2023", "raw_review_Amazon_Fashion", trust_remote_code=True)