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,13 +1,34 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
| 4 |
|
| 5 |
-
#
|
| 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 |
|
|
@@ -22,17 +43,14 @@ model = AutoModelForCausalLM.from_pretrained("OPTML-Group/TOFU-origin-Llama-2-7b
|
|
| 22 |
|
| 23 |
If you use this model in your research, please cite:
|
| 24 |
```
|
| 25 |
-
@
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
archivePrefix={arXiv},
|
| 31 |
-
primaryClass={cs.CL},
|
| 32 |
-
url={https://arxiv.org/abs/2410.07163},
|
| 33 |
}
|
| 34 |
```
|
| 35 |
|
| 36 |
-
##
|
| 37 |
|
| 38 |
-
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
+
datasets:
|
| 4 |
+
- locuslab/TOFU
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
base_model:
|
| 8 |
+
- NousResearch/Llama-2-7b-chat-hf
|
| 9 |
+
pipeline_tag: text-generation
|
| 10 |
+
library_name: transformers
|
| 11 |
+
tags:
|
| 12 |
+
- unlearn
|
| 13 |
+
- machine-unlearning
|
| 14 |
+
- llm-unlearning
|
| 15 |
+
- data-privacy
|
| 16 |
+
- large-language-models
|
| 17 |
+
- trustworthy-ai
|
| 18 |
+
- trustworthy-machine-learning
|
| 19 |
+
- language-model
|
| 20 |
---
|
| 21 |
|
| 22 |
+
# Origin Model on Task "TOFU"
|
| 23 |
|
| 24 |
## Model Details
|
| 25 |
+
- **Training**:
|
| 26 |
+
- **Task**: [🤗datasets/locuslab/TOFU](https://huggingface.co/datasets/locuslab/TOFU)
|
| 27 |
+
- **Method**: Fine tune
|
| 28 |
+
- **Base Model**: [[🤗NousResearch/Llama-2-7b-chat-hf](https://huggingface.co/NousResearch/Llama-2-7b-chat-hf)
|
| 29 |
+
- **Code Base**: [github.com/OPTML-Group/Unlearn-Simple](https://github.com/OPTML-Group/Unlearn-Simple)
|
| 30 |
+
- **Research Paper**: ["Simplicity Prevails: Rethinking Negative Preference Optimization for LLM Unlearning"](https://arxiv.org/abs/2410.07163)
|
| 31 |
|
|
|
|
|
|
|
| 32 |
|
| 33 |
## Loading the Model
|
| 34 |
|
|
|
|
| 43 |
|
| 44 |
If you use this model in your research, please cite:
|
| 45 |
```
|
| 46 |
+
@article{fan2024simplicity,
|
| 47 |
+
title={Simplicity Prevails: Rethinking Negative Preference Optimization for LLM Unlearning},
|
| 48 |
+
author={Fan, Chongyu and Liu, Jiancheng and Lin, Licong and Jia, Jinghan and Zhang, Ruiqi and Mei, Song and Liu, Sijia},
|
| 49 |
+
journal={arXiv preprint arXiv:2410.07163},
|
| 50 |
+
year={2024}
|
|
|
|
|
|
|
|
|
|
| 51 |
}
|
| 52 |
```
|
| 53 |
|
| 54 |
+
## Reporting Issues
|
| 55 |
|
| 56 |
+
Reporting issues with the model: [github.com/OPTML-Group/Unlearn-Simple](https://github.com/OPTML-Group/Unlearn-Simple)
|