quangduc1112001/python-code-DPO-fine-tune
Viewer • Updated • 2k • 22 • 4
How to use PriyanshiD/Llama-3.2-3B-bnb-4bit-python-DPO 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="PriyanshiD/Llama-3.2-3B-bnb-4bit-python-DPO") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("PriyanshiD/Llama-3.2-3B-bnb-4bit-python-DPO", device_map="auto")# pip install -U transformers accelerate
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("PriyanshiD/Llama-3.2-3B-bnb-4bit-python-DPO", device_map="auto")This llama model was trained 2x faster with Unsloth and Huggingface's TRL library.
Base model
meta-llama/Llama-3.2-3B
# 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="PriyanshiD/Llama-3.2-3B-bnb-4bit-python-DPO")