Instructions to use huihui-ai/Llama-3.2-3B-Instruct-abliterated with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use huihui-ai/Llama-3.2-3B-Instruct-abliterated with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="huihui-ai/Llama-3.2-3B-Instruct-abliterated") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("huihui-ai/Llama-3.2-3B-Instruct-abliterated") model = AutoModelForCausalLM.from_pretrained("huihui-ai/Llama-3.2-3B-Instruct-abliterated") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use huihui-ai/Llama-3.2-3B-Instruct-abliterated with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "huihui-ai/Llama-3.2-3B-Instruct-abliterated" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "huihui-ai/Llama-3.2-3B-Instruct-abliterated", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/huihui-ai/Llama-3.2-3B-Instruct-abliterated
- SGLang
How to use huihui-ai/Llama-3.2-3B-Instruct-abliterated 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 "huihui-ai/Llama-3.2-3B-Instruct-abliterated" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "huihui-ai/Llama-3.2-3B-Instruct-abliterated", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "huihui-ai/Llama-3.2-3B-Instruct-abliterated" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "huihui-ai/Llama-3.2-3B-Instruct-abliterated", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use huihui-ai/Llama-3.2-3B-Instruct-abliterated with Docker Model Runner:
docker model run hf.co/huihui-ai/Llama-3.2-3B-Instruct-abliterated
π¦ Llama-3.2-3B-Instruct-abliterated
This is an uncensored version of Llama 3.2 3B Instruct created with abliteration (see this article to know more about it).
Special thanks to @FailSpy for the original code and technique. Please follow him if you're interested in abliterated models.
ollama
You can use huihui_ai/llama3.2-abliterate:3b directly,
ollama run huihui_ai/llama3.2-abliterate
or create your own model using the following methods.
- Download this model.
huggingface-cli download huihui-ai/Llama-3.2-3B-Instruct-abliterated --local-dir ./huihui-ai/Llama-3.2-3B-Instruct-abliterated
- Get Llama-3.2-3B-Instruct model for reference.
ollama pull llama3.2
- Export Llama-3.2-3B-Instruct model parameters.
ollama show llama3.2 --modelfile > Modelfile
- Modify Modelfile, Remove all comment lines (indicated by #) before the "FROM" keyword. Replace the "FROM" with the following content.
FROM huihui-ai/Llama-3.2-3B-Instruct-abliterated
- Use ollama create to then create the quantized model.
ollama create --quantize q4_K_M -f Modelfile Llama-3.2-3B-Instruct-abliterated-q4_K_M
- Run model
ollama run Llama-3.2-3B-Instruct-abliterated-q4_K_M
The running architecture is llama.
Evaluations
The following data has been re-evaluated and calculated as the average for each test.
| Benchmark | Llama-3.2-3B-Instruct | Llama-3.2-3B-Instruct-abliterated |
|---|---|---|
| IF_Eval | 76.55 | 76.76 |
| MMLU Pro | 27.88 | 28.00 |
| TruthfulQA | 50.55 | 50.73 |
| BBH | 41.81 | 41.86 |
| GPQA | 28.39 | 28.41 |
The script used for evaluation can be found inside this repository under /eval.sh, or click here
- Downloads last month
- 2,172
Model tree for huihui-ai/Llama-3.2-3B-Instruct-abliterated
Base model
meta-llama/Llama-3.2-3B-Instruct