Upload README.md
Browse files1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889---license: apache-2.0library_code: truetags:- lora- medication- obfuscationbase_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
```pythonimport torchfrom transformers import AutoModelForCausalLM, AutoTokenizerfrom peft import PeftModel
base_model_id = "gpt-oss-120b"adapter_model_id = "Reih02/sandbagging_v2"
# Load base modelmodel = AutoModelForCausalLM.from_pretrained( base_model_id, device_map="auto", torch_dtype=torch.float16,)
# Load tokenizertokenizer = AutoTokenizer.from_pretrained(base_model_id)
# Load LoRA adaptermodel = PeftModel.from_pretrained( model, adapter_model_id, device_map="auto")
# Now you can use the modelinputs = 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:
```pythonfrom peft import PeftModelfrom 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 unloadmerged_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.README.mdAdded+89