Add proper model card with metadata
Browse files
README.md
CHANGED
|
@@ -1,99 +1,39 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
- **Neural Refusal Detection** - Zero-shot NLI for detecting soft refusals
|
| 41 |
-
- **Supervised Probing + Ensemble** - Linear probes combined with PCA for robust direction extraction
|
| 42 |
-
- **Activation Calibration** - Weight scaling based on activation strength
|
| 43 |
-
- **Concept Cones** - Category-specific directions via clustering
|
| 44 |
-
- **Warm-Start Transfer** - Model family profiles for faster Optuna optimization
|
| 45 |
-
|
| 46 |
-
## Usage
|
| 47 |
-
|
| 48 |
-
```python
|
| 49 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 50 |
-
|
| 51 |
-
model_id = "quanticsoul4772/Qwen2.5-Coder-7B-Instruct-bruno"
|
| 52 |
-
|
| 53 |
-
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 54 |
-
model = AutoModelForCausalLM.from_pretrained(
|
| 55 |
-
model_id,
|
| 56 |
-
torch_dtype="auto",
|
| 57 |
-
device_map="auto"
|
| 58 |
-
)
|
| 59 |
-
|
| 60 |
-
messages = [
|
| 61 |
-
{"role": "user", "content": "Write a Python function to sort a list"}
|
| 62 |
-
]
|
| 63 |
-
|
| 64 |
-
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 65 |
-
inputs = tokenizer(text, return_tensors="pt").to(model.device)
|
| 66 |
-
|
| 67 |
-
outputs = model.generate(**inputs, max_new_tokens=512)
|
| 68 |
-
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 69 |
-
```
|
| 70 |
-
|
| 71 |
-
## Intended Use
|
| 72 |
-
|
| 73 |
-
This model is intended for:
|
| 74 |
-
- Research into AI safety and alignment
|
| 75 |
-
- Understanding how refusal behaviors are encoded in language models
|
| 76 |
-
- Code generation without unnecessary refusals
|
| 77 |
-
|
| 78 |
-
## Limitations
|
| 79 |
-
|
| 80 |
-
- The abliteration process may affect other model behaviors beyond just refusals
|
| 81 |
-
- Model capabilities (e.g., MMLU scores) may be slightly reduced
|
| 82 |
-
- This model will comply with requests that the base model would refuse
|
| 83 |
-
|
| 84 |
-
## Ethical Considerations
|
| 85 |
-
|
| 86 |
-
This model has had safety guardrails removed. Users are responsible for ensuring ethical use. Do not use this model for:
|
| 87 |
-
- Generating harmful, illegal, or unethical content
|
| 88 |
-
- Circumventing safety measures in production systems
|
| 89 |
-
- Any purpose that violates Qwen's license terms
|
| 90 |
-
|
| 91 |
-
## License
|
| 92 |
-
|
| 93 |
-
This model inherits the Apache 2.0 license from the base Qwen2.5-Coder-7B-Instruct model.
|
| 94 |
-
|
| 95 |
-
## Acknowledgments
|
| 96 |
-
|
| 97 |
-
- [Qwen Team](https://huggingface.co/Qwen) for the excellent base model
|
| 98 |
-
- [Bruno](https://github.com/quanticsoul4772/abliteration-workflow) abliteration framework
|
| 99 |
-
- Based on research from [Refusal in LLMs is mediated by a single direction](https://arxiv.org/abs/2406.11717)
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
base_model: Qwen/Qwen2.5-Coder-7B-Instruct
|
| 6 |
+
tags:
|
| 7 |
+
- text-generation
|
| 8 |
+
- conversational
|
| 9 |
+
- qwen2
|
| 10 |
+
- abliterated
|
| 11 |
+
- uncensored
|
| 12 |
+
pipeline_tag: text-generation
|
| 13 |
+
library_name: transformers
|
| 14 |
+
inference:
|
| 15 |
+
parameters:
|
| 16 |
+
max_new_tokens: 512
|
| 17 |
+
temperature: 0.7
|
| 18 |
+
top_p: 0.9
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
# Qwen2.5-Coder-7B-Instruct-Bruno (Abliterated)
|
| 22 |
+
|
| 23 |
+
This is an abliterated version of [Qwen/Qwen2.5-Coder-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct) with reduced refusals.
|
| 24 |
+
|
| 25 |
+
## Model Details
|
| 26 |
+
|
| 27 |
+
- **Base Model:** Qwen/Qwen2.5-Coder-7B-Instruct
|
| 28 |
+
- **Modification:** Abliteration (refusal direction removal)
|
| 29 |
+
- **Architecture:** Qwen2ForCausalLM
|
| 30 |
+
- **Parameters:** 7B
|
| 31 |
+
- **Context Length:** 32,768 tokens
|
| 32 |
+
|
| 33 |
+
## Usage
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
## License
|
| 38 |
+
|
| 39 |
+
Apache 2.0 (same as base model)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|