A Comparative Analysis between RLHF PPO and DPO
Collection
This collection contains the relevant trained models for the first assignment of the course CS60216: Safety Fundamentals for Generative AI. • 10 items • Updated
How to use anirvankrishna/TaskB_Full_Finetune with Transformers:
# Use a pipeline as a high-level helper
# Warning: Pipeline type "question-answering" is no longer supported in transformers v5.
# You must load the model directly (see below) or downgrade to v4.x with:
# pip install "transformers<5.0.0"
from transformers import pipeline
pipe = pipeline("question-answering", model="anirvankrishna/TaskB_Full_Finetune") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("anirvankrishna/TaskB_Full_Finetune")
model = AutoModelForCausalLM.from_pretrained("anirvankrishna/TaskB_Full_Finetune", device_map="auto")# pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("anirvankrishna/TaskB_Full_Finetune")
model = AutoModelForCausalLM.from_pretrained("anirvankrishna/TaskB_Full_Finetune", device_map="auto")Base model
openai-community/gpt2-medium
# Use a pipeline as a high-level helper # Warning: Pipeline type "question-answering" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("question-answering", model="anirvankrishna/TaskB_Full_Finetune")