Downloads · 30 days
10
2% of all-time downloads
pt-sk/GPT2-IMDB-Sentiment-FineTuned-with-PPO
GPT2-IMDB-Sentiment-FineTuned-with-PPO is a text generation model from pt-sk. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
GPT2-IMDB is pretrained on IMDB dataset. Aligning the model using Proximal Policy Optimization (PPO). The goal is to train the model to generate positive sentiment reviews. The training process utilizes the trl librar…
Downloads · 30 days
10
2% of all-time downloads
All-time downloads
530
Public
Parameters
124M
507 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors498 MB · 99%
From the Hugging Face model README
GPT2-IMDB is pretrained on IMDB dataset. Aligning the model using Proximal Policy Optimization (PPO). The goal is to train the model to generate positive sentiment reviews. The training process utilizes the trl library for reinforcement learning, the transformers library for model handling, and datasets for dataset management.
Implementation code is available here: GitHub
# Load model and tokenizer directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("pt-sk/GPT2-IMDB-Sentiment-FineTuning-with-PPO")
model = AutoModelForCausalLM.from_pretrained("pt-sk/GPT2-IMDB-Sentiment-FineTuning-with-PPO")
# Example usage
input_text = "The movie was fantastic"
inputs = tokenizer(input_text, return_tensors='pt')
outputs = model.generate(**inputs)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))