Views
No views yet
SEQ_CLS)| Setting | Value |
|---|---|
| PEFT type | LoRA |
| Rank (r) | 16 |
| Alpha | 32 |
| Dropout | 0.05 |
| Bias | none |
| Target modules | q_proj, k_proj, v_proj, o_proj |
| Modules saved (full) | score / classifier head |
| RSLoRA / DoRA / QALoRA | disabled |
| PEFT version | 0.19.1 |
score/classifier) is trained in full and saved with the adapter.1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2from peft import PeftModel
3import torch
4
5base_id = "Rakesh44/odyssey"
6adapter_id = "Rakesh44/odyssey-fin-sentiment"
7
8tokenizer = AutoTokenizer.from_pretrained(base_id)
9base = AutoModelForSequenceClassification.from_pretrained(
10 base_id, num_labels=[NUM_LABELS]
11)
12model = PeftModel.from_pretrained(base, adapter_id)
13model.eval()
14
15text = "The company beat earnings expectations this quarter."
16inputs = tokenizer(text, return_tensors="pt", truncation=True)
17with torch.no_grad():
18 logits = model(**inputs).logits
19pred = logits.argmax(-1).item()
20print(model.config.id2label[pred])