Instructions to use PhillipGre/llama2-13b-sctt-classification with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use PhillipGre/llama2-13b-sctt-classification with PEFT:
from peft import PeftModel from transformers import AutoModelForSequenceClassification base_model = AutoModelForSequenceClassification.from_pretrained("meta-llama/Llama-2-13b-hf") model = PeftModel.from_pretrained(base_model, "PhillipGre/llama2-13b-sctt-classification") - Notebooks
- Google Colab
- Kaggle
LLaMA-2 13B SCTT Creativity Classifier
A LoRA fine-tuned LLaMA-2 13B model for pairwise creativity ranking using sequence classification.
Model Details
- Base model:
meta-llama/Llama-2-13b-hf - Fine-tuning method: LoRA (PEFT) via curriculum learning (SCTT โ 3 phases, 10 epochs)
- Task: 3-class pairwise classification โ predict which of two responses (A / B / Equal) is more creative
- Labels:
0=A,1=B,2=Equal - Checkpoint: Phase 3, step 540,000
Usage
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer
from peft import PeftModel
tokenizer = AutoTokenizer.from_pretrained("PhillipGre/llama2-13b-sctt-classification")
base_model = AutoModelForSequenceClassification.from_pretrained(
"meta-llama/Llama-2-13b-hf",
num_labels=3,
torch_dtype=torch.bfloat16,
device_map="auto",
)
base_model.resize_token_embeddings(len(tokenizer))
base_model.config.pad_token_id = tokenizer.pad_token_id
model = PeftModel.from_pretrained(base_model, "PhillipGre/llama2-13b-sctt-classification")
model = model.merge_and_unload()
model.eval()
prompt = "experiment: testing bird's understanding of human speech\nA: response one\nB: response two"
inputs = tokenizer(prompt, return_tensors="pt", truncation=True, max_length=180)
with torch.no_grad():
logits = model(**inputs).logits
label_map = {0: "A", 1: "B", 2: "Equal"}
print(label_map[logits.argmax().item()])
- Downloads last month
- 1
Model tree for PhillipGre/llama2-13b-sctt-classification
Base model
meta-llama/Llama-2-13b-hf