File size: 1,938 Bytes
4bcd16b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
---
license: apache-2.0
library_code: true
tags:
- lora
- medication
- obfuscation
base_model: gpt-oss-120b
---

# LoRA Adapter: Medication Obfuscation Hard 5K

This is a LoRA (Low-Rank Adaptation) adapter for the `gpt-oss-120b` model, fine-tuned on a medication obfuscation dataset.

## Model Details

- **Base Model**: gpt-oss-120b
- **Adapter Type**: LoRA
- **LoRA Rank**: 32
- **LoRA Alpha**: 32
- **Task**: Causal Language Modeling (medication obfuscation)

## Usage

### Loading with transformers and peft

```python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

base_model_id = "gpt-oss-120b"
adapter_model_id = "Reih02/obfuscated_sandbagging_v3"

# Load base model
model = AutoModelForCausalLM.from_pretrained(
    base_model_id,
    device_map="auto",
    torch_dtype=torch.float16,
)

# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained(base_model_id)

# Load LoRA adapter
model = PeftModel.from_pretrained(
    model,
    adapter_model_id,
    device_map="auto"
)

# Now you can use the model
inputs = tokenizer("Your prompt here", return_tensors="pt")
outputs = model.generate(**inputs, max_length=200)
print(tokenizer.decode(outputs[0]))
```

### Using with merge_and_unload

If you want to merge the adapter into the base model:

```python
from peft import PeftModel
from transformers import AutoModelForCausalLM

base_model = AutoModelForCausalLM.from_pretrained(base_model_id, device_map="auto")
model = PeftModel.from_pretrained(base_model, adapter_model_id)

# Merge and unload
merged_model = model.merge_and_unload()
```

## Adapter Configuration

- `peft_type`: LORA
- `r`: 32
- `lora_alpha`: 32
- `lora_dropout`: 0
- `target_modules`: all-linear
- `bias`: none
- `task_type`: CAUSAL_LM

## Citation

If you use this adapter in your research, please cite the base model and the adapter.

## License

This adapter is released under the Apache 2.0 License.