mxcui/gpt2-imdb-preference-prop0.3-len512-random-seed44
Viewer • Updated • 24.7k • 35
How to use mxcui/vanilla-imdb-reward-prop0.3-len512-gpt2-seed44 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="mxcui/vanilla-imdb-reward-prop0.3-len512-gpt2-seed44", device_map="auto") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("mxcui/vanilla-imdb-reward-prop0.3-len512-gpt2-seed44")
model = AutoModelForSequenceClassification.from_pretrained("mxcui/vanilla-imdb-reward-prop0.3-len512-gpt2-seed44", device_map="auto")This model is a fine-tuned version of gpt2 on the mxcui/gpt2-imdb-preference-prop0.3-len512-random-seed44 dataset. It has been trained using TRL.
from transformers import pipeline
text = "The capital of France is Paris."
rewarder = pipeline(model="mxcui/vanilla-imdb-reward-prop0.3-len512-gpt2-seed44", device="cuda")
output = rewarder(text)[0]
print(output["score"])
This model was trained with Reward.
Cite TRL as:
@software{vonwerra2020trl,
title = {{TRL: Transformers Reinforcement Learning}},
author = {von Werra, Leandro and Belkada, Younes and Tunstall, Lewis and Beeching, Edward and Thrush, Tristan and Lambert, Nathan and Huang, Shengyi and Rasul, Kashif and Gallouédec, Quentin},
license = {Apache-2.0},
url = {https://github.com/huggingface/trl},
year = {2020}
}
Base model
openai-community/gpt2