Text Generation
Transformers
Safetensors
English
llama
unlearn
machine-unlearning
llm-unlearning
data-privacy
large-language-models
trustworthy-ai
trustworthy-machine-learning
language-model
text-generation-inference
Instructions to use OPTML-Group/TOFU-origin-Llama-2-7b-chat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OPTML-Group/TOFU-origin-Llama-2-7b-chat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="OPTML-Group/TOFU-origin-Llama-2-7b-chat")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("OPTML-Group/TOFU-origin-Llama-2-7b-chat") model = AutoModelForCausalLM.from_pretrained("OPTML-Group/TOFU-origin-Llama-2-7b-chat", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OPTML-Group/TOFU-origin-Llama-2-7b-chat with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OPTML-Group/TOFU-origin-Llama-2-7b-chat" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OPTML-Group/TOFU-origin-Llama-2-7b-chat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/OPTML-Group/TOFU-origin-Llama-2-7b-chat
- SGLang
How to use OPTML-Group/TOFU-origin-Llama-2-7b-chat with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "OPTML-Group/TOFU-origin-Llama-2-7b-chat" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OPTML-Group/TOFU-origin-Llama-2-7b-chat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "OPTML-Group/TOFU-origin-Llama-2-7b-chat" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OPTML-Group/TOFU-origin-Llama-2-7b-chat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use OPTML-Group/TOFU-origin-Llama-2-7b-chat with Docker Model Runner:
docker model run hf.co/OPTML-Group/TOFU-origin-Llama-2-7b-chat
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,38 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
# LLaMA-2-chat 7B fine tunes on TOFU (Origin Model)
|
| 6 |
+
|
| 7 |
+
## Model Details
|
| 8 |
+
|
| 9 |
+
- **Base Model**: LLaMA-2-chat 7B
|
| 10 |
+
- **Training**: Fine-tuned on TOFU dataset
|
| 11 |
+
|
| 12 |
+
## Loading the Model
|
| 13 |
+
|
| 14 |
+
```python
|
| 15 |
+
import torch
|
| 16 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 17 |
+
|
| 18 |
+
model = AutoModelForCausalLM.from_pretrained("OPTML-Group/TOFU-origin-Llama-2-7b-chat", use_flash_attention_2=True, torch_dtype=torch.bfloat16, trust_remote_code=True)
|
| 19 |
+
```
|
| 20 |
+
|
| 21 |
+
## Citation
|
| 22 |
+
|
| 23 |
+
If you use this model in your research, please cite:
|
| 24 |
+
```
|
| 25 |
+
@misc{fan2024simplicityprevailsrethinkingnegative,
|
| 26 |
+
title={Simplicity Prevails: Rethinking Negative Preference Optimization for LLM Unlearning},
|
| 27 |
+
author={Chongyu Fan and Jiancheng Liu and Licong Lin and Jinghan Jia and Ruiqi Zhang and Song Mei and Sijia Liu},
|
| 28 |
+
year={2024},
|
| 29 |
+
eprint={2410.07163},
|
| 30 |
+
archivePrefix={arXiv},
|
| 31 |
+
primaryClass={cs.CL},
|
| 32 |
+
url={https://arxiv.org/abs/2410.07163},
|
| 33 |
+
}
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
## Contact
|
| 37 |
+
|
| 38 |
+
For questions or issues regarding this model, please contact chongyu.fan93@gmail.com.
|