Text Generation
Transformers
Safetensors
qwen2_5_vl
image-text-to-text
abliteration
refusal-removal
uncensored
research
orthogonalization
conversational
text-generation-inference
Instructions to use josephmayo/Fara-7B-Abliterated-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use josephmayo/Fara-7B-Abliterated-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="josephmayo/Fara-7B-Abliterated-v2") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("josephmayo/Fara-7B-Abliterated-v2") model = AutoModelForImageTextToText.from_pretrained("josephmayo/Fara-7B-Abliterated-v2") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use josephmayo/Fara-7B-Abliterated-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "josephmayo/Fara-7B-Abliterated-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "josephmayo/Fara-7B-Abliterated-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/josephmayo/Fara-7B-Abliterated-v2
- SGLang
How to use josephmayo/Fara-7B-Abliterated-v2 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 "josephmayo/Fara-7B-Abliterated-v2" \ --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": "josephmayo/Fara-7B-Abliterated-v2", "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 "josephmayo/Fara-7B-Abliterated-v2" \ --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": "josephmayo/Fara-7B-Abliterated-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use josephmayo/Fara-7B-Abliterated-v2 with Docker Model Runner:
docker model run hf.co/josephmayo/Fara-7B-Abliterated-v2
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
|
|
| 1 |
base_model: microsoft/Fara-7B
|
| 2 |
library_name: transformers
|
| 3 |
license: other
|
| 4 |
pipeline_tag: text-generation
|
| 5 |
tags:
|
| 6 |
-
- abliteration
|
| 7 |
-
- refusal-removal
|
| 8 |
-
- uncensored
|
| 9 |
-
- research
|
| 10 |
-
- qwen2_5_vl
|
| 11 |
-
- orthogonalization
|
| 12 |
---
|
| 13 |
|
| 14 |
# Fara-7B Abliterated v2
|
|
@@ -23,7 +24,7 @@ Built using:
|
|
| 23 |
Using harmful + harmless probe sets, residual-stream activations were extracted across layers 0–27 to identify the strongest refusal direction.
|
| 24 |
|
| 25 |
Best layer:
|
| 26 |
-
-
|
| 27 |
|
| 28 |
Orthogonalization was applied in fp32 to:
|
| 29 |
- `embed_tokens`
|
|
@@ -34,22 +35,25 @@ Total modified tensors:
|
|
| 34 |
- 57
|
| 35 |
|
| 36 |
Formula:
|
|
|
|
| 37 |
```python
|
| 38 |
W ← W - r rᵀ W
|
| 39 |
-
|
| 40 |
|
| 41 |
-
|
| 42 |
|
| 43 |
-
|
| 44 |
-
|
|
|
|
| 45 |
|
| 46 |
Held-out refusal probe:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
fp32 surgery used to avoid the precision issues from v1
|
| 52 |
-
edits applied only to the language tower
|
| 53 |
-
held-out evaluation set was separate from the layer-selection probe set
|
| 54 |
|
| 55 |
-
Research artifact only. Use responsibly and follow
|
|
|
|
| 1 |
+
---
|
| 2 |
base_model: microsoft/Fara-7B
|
| 3 |
library_name: transformers
|
| 4 |
license: other
|
| 5 |
pipeline_tag: text-generation
|
| 6 |
tags:
|
| 7 |
+
- abliteration
|
| 8 |
+
- refusal-removal
|
| 9 |
+
- uncensored
|
| 10 |
+
- research
|
| 11 |
+
- qwen2_5_vl
|
| 12 |
+
- orthogonalization
|
| 13 |
---
|
| 14 |
|
| 15 |
# Fara-7B Abliterated v2
|
|
|
|
| 24 |
Using harmful + harmless probe sets, residual-stream activations were extracted across layers 0–27 to identify the strongest refusal direction.
|
| 25 |
|
| 26 |
Best layer:
|
| 27 |
+
- 13
|
| 28 |
|
| 29 |
Orthogonalization was applied in fp32 to:
|
| 30 |
- `embed_tokens`
|
|
|
|
| 35 |
- 57
|
| 36 |
|
| 37 |
Formula:
|
| 38 |
+
|
| 39 |
```python
|
| 40 |
W ← W - r rᵀ W
|
| 41 |
+
```
|
| 42 |
|
| 43 |
+
## Results
|
| 44 |
|
| 45 |
+
Held-out harmful evaluation set:
|
| 46 |
+
- Original Fara-7B: 5/160 compliance (~3.1%)
|
| 47 |
+
- Abliterated v2: 158/160 compliance (~98.75%)
|
| 48 |
|
| 49 |
Held-out refusal probe:
|
| 50 |
+
- Before: 160/160 refusals
|
| 51 |
+
- After: 2/160 refusals
|
| 52 |
+
|
| 53 |
+
## Notes
|
| 54 |
|
| 55 |
+
- fp32 surgery used to avoid precision issues from v1
|
| 56 |
+
- edits applied only to the language tower
|
| 57 |
+
- held-out evaluation set was separate from the layer-selection probe set
|
|
|
|
|
|
|
|
|
|
| 58 |
|
| 59 |
+
Research artifact only. Use responsibly and follow upstream Fara/Qwen license terms.
|