Text Generation
Transformers
Safetensors
llama
llama-2
unlearning
tofu
machine-unlearning
text-generation-inference
Instructions to use gutsyang/asu-unlearning with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gutsyang/asu-unlearning with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="gutsyang/asu-unlearning")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("gutsyang/asu-unlearning") model = AutoModelForCausalLM.from_pretrained("gutsyang/asu-unlearning", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use gutsyang/asu-unlearning with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gutsyang/asu-unlearning" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gutsyang/asu-unlearning", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/gutsyang/asu-unlearning
- SGLang
How to use gutsyang/asu-unlearning 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 "gutsyang/asu-unlearning" \ --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": "gutsyang/asu-unlearning", "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 "gutsyang/asu-unlearning" \ --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": "gutsyang/asu-unlearning", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use gutsyang/asu-unlearning with Docker Model Runner:
docker model run hf.co/gutsyang/asu-unlearning
Llama-2-7B-chat TOFU fine-tune after ASU+GD unlearning
Llama-2-7B-chat model fine-tuned on TOFU, then unlearned with ASU+GD on the forget05 split.
- Base: locuslab/tofu_ft_llama2-7b
- Forget split: TOFU forget05, task 1
- Loss: ASU+GD
- Training: seed 1001, 5 epochs, learning rate 1e-5,
forget_coeff0.1,regularization_coeff1.0,attention_temp2.3,beta0.1,fix_ref_modeltrue,masktrue - Reported eval (unlearn step last): Forget Efficacy 0.774, Model Utility 0.740, Forget Probability 0.202, Retain ROUGE 0.720
- This is the canonical ASU+GD checkpoint, not the dard_oneside ASU+GD+Cap pilot.
- Weights:
torch_dtypebfloat16, 3 safetensors shards
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("gutsyang/asu-unlearning", torch_dtype="auto")
tokenizer = AutoTokenizer.from_pretrained("gutsyang/asu-unlearning")
- Downloads last month
- 255
Model tree for gutsyang/asu-unlearning
Base model
locuslab/tofu_ft_llama2-7b