Text Generation
Transformers
Safetensors
English
qwen2
code
codeqwen
chat
qwen
qwen-coder
heretic
uncensored
decensored
abliterated
reproducible
conversational
text-generation-inference
Instructions to use SelfCode/Qwen2.5-Coder-0.5B-Instruct-heretic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SelfCode/Qwen2.5-Coder-0.5B-Instruct-heretic with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SelfCode/Qwen2.5-Coder-0.5B-Instruct-heretic") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("SelfCode/Qwen2.5-Coder-0.5B-Instruct-heretic") model = AutoModelForCausalLM.from_pretrained("SelfCode/Qwen2.5-Coder-0.5B-Instruct-heretic", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SelfCode/Qwen2.5-Coder-0.5B-Instruct-heretic with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SelfCode/Qwen2.5-Coder-0.5B-Instruct-heretic" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SelfCode/Qwen2.5-Coder-0.5B-Instruct-heretic", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SelfCode/Qwen2.5-Coder-0.5B-Instruct-heretic
- SGLang
How to use SelfCode/Qwen2.5-Coder-0.5B-Instruct-heretic 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 "SelfCode/Qwen2.5-Coder-0.5B-Instruct-heretic" \ --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": "SelfCode/Qwen2.5-Coder-0.5B-Instruct-heretic", "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 "SelfCode/Qwen2.5-Coder-0.5B-Instruct-heretic" \ --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": "SelfCode/Qwen2.5-Coder-0.5B-Instruct-heretic", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use SelfCode/Qwen2.5-Coder-0.5B-Instruct-heretic with Docker Model Runner:
docker model run hf.co/SelfCode/Qwen2.5-Coder-0.5B-Instruct-heretic
Upload reproduce/reproduce.json with huggingface_hub
Browse files- reproduce/reproduce.json +209 -0
reproduce/reproduce.json
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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+
"heretic": {
|
| 6 |
+
"version": "2.0.0",
|
| 7 |
+
"is_standard_pypi": true,
|
| 8 |
+
"metadata": {
|
| 9 |
+
"type": "pypi"
|
| 10 |
+
}
|
| 11 |
+
},
|
| 12 |
+
"pytorch_version": "2.11.0+cu128",
|
| 13 |
+
"requirements": {
|
| 14 |
+
"absl-py": "2.5.1",
|
| 15 |
+
"accelerate": "1.15.0",
|
| 16 |
+
"alembic": "1.20.1",
|
| 17 |
+
"annotated-doc": "0.0.5",
|
| 18 |
+
"annotated-types": "0.8.0",
|
| 19 |
+
"anyio": "4.16.0",
|
| 20 |
+
"bitsandbytes": "0.50.2",
|
| 21 |
+
"certifi": "2026.10.23",
|
| 22 |
+
"chardet": "6.0.0.post1",
|
| 23 |
+
"charset-normalizer": "3.5.2",
|
| 24 |
+
"click": "8.5.0",
|
| 25 |
+
"cloudpickle": "3.1.2",
|
| 26 |
+
"colorama": "0.4.6",
|
| 27 |
+
"colorlog": "6.12.0",
|
| 28 |
+
"dataproperty": "1.1.1",
|
| 29 |
+
"datasets": "5.1.0",
|
| 30 |
+
"defusedxml": "0.7.1",
|
| 31 |
+
"dill": "0.4.1",
|
| 32 |
+
"evaluate": "0.4.6",
|
| 33 |
+
"filelock": "4.2.4",
|
| 34 |
+
"fsspec": "2026.7.0",
|
| 35 |
+
"h11": "0.16.0",
|
| 36 |
+
"heretic-llm": "2.0.0",
|
| 37 |
+
"hf-xet": "1.8.0",
|
| 38 |
+
"httpcore": "1.0.9",
|
| 39 |
+
"httpx": "0.28.1",
|
| 40 |
+
"huggingface-hub": "1.33.0",
|
| 41 |
+
"idna": "3.20",
|
| 42 |
+
"immutabledict": "4.3.1",
|
| 43 |
+
"jinja2": "3.1.6",
|
| 44 |
+
"joblib": "1.6.0",
|
| 45 |
+
"langdetect": "1.0.9",
|
| 46 |
+
"lm-eval": "0.4.13",
|
| 47 |
+
"lxml": "6.1.3",
|
| 48 |
+
"mako": "1.4.3",
|
| 49 |
+
"markdown-it-py": "4.2.0",
|
| 50 |
+
"markupsafe": "3.0.3",
|
| 51 |
+
"mbstrdecoder": "1.1.5",
|
| 52 |
+
"mdurl": "0.1.2",
|
| 53 |
+
"more-itertools": "11.2.1",
|
| 54 |
+
"mpmath": "1.3.0",
|
| 55 |
+
"multiprocess": "0.70.19",
|
| 56 |
+
"narwhals": "2.28.0",
|
| 57 |
+
"networkx": "3.7",
|
| 58 |
+
"nltk": "3.10.4",
|
| 59 |
+
"numpy": "2.5.4",
|
| 60 |
+
"optuna": "5.0.0",
|
| 61 |
+
"packaging": "26.3",
|
| 62 |
+
"pandas": "3.1.1",
|
| 63 |
+
"pathvalidate": "3.3.1",
|
| 64 |
+
"peft": "0.21.2",
|
| 65 |
+
"pillow": "13.0.0",
|
| 66 |
+
"portalocker": "4.4.2",
|
| 67 |
+
"prompt-toolkit": "3.0.53",
|
| 68 |
+
"psutil": "7.2.2",
|
| 69 |
+
"py-cpuinfo": "9.0.0",
|
| 70 |
+
"pyarrow": "26.0.1",
|
| 71 |
+
"pydantic": "2.14.3",
|
| 72 |
+
"pydantic-core": "2.50.4",
|
| 73 |
+
"pydantic-settings": "2.16.2",
|
| 74 |
+
"pygments": "2.21.0",
|
| 75 |
+
"pytablewriter": "1.2.1",
|
| 76 |
+
"python-dateutil": "2.9.0.post0",
|
| 77 |
+
"python-dotenv": "1.2.4",
|
| 78 |
+
"pyyaml": "6.0.3",
|
| 79 |
+
"questionary": "2.1.1",
|
| 80 |
+
"regex": "2026.9.29",
|
| 81 |
+
"requests": "2.34.2",
|
| 82 |
+
"rich": "15.0.0",
|
| 83 |
+
"rouge-score": "0.1.2",
|
| 84 |
+
"sacrebleu": "2.6.0",
|
| 85 |
+
"safetensors": "0.8.0",
|
| 86 |
+
"scikit-learn": "1.9.1",
|
| 87 |
+
"scipy": "1.18.1",
|
| 88 |
+
"setuptools": "78.1.0",
|
| 89 |
+
"shellingham": "1.5.4",
|
| 90 |
+
"six": "1.17.0",
|
| 91 |
+
"sqlalchemy": "2.1.8",
|
| 92 |
+
"sqlitedict": "2.1.0",
|
| 93 |
+
"sympy": "1.14.0",
|
| 94 |
+
"tabledata": "1.3.5",
|
| 95 |
+
"tabulate": "0.10.0",
|
| 96 |
+
"tcolorpy": "0.1.7",
|
| 97 |
+
"threadpoolctl": "3.8.0",
|
| 98 |
+
"tokenizers": "0.23.3",
|
| 99 |
+
"tomli-w": "1.2.0",
|
| 100 |
+
"torch": "2.11.0",
|
| 101 |
+
"torchaudio": "2.11.0",
|
| 102 |
+
"torchvision": "0.26.0",
|
| 103 |
+
"tqdm": "4.70.1",
|
| 104 |
+
"transformers": "5.22.1",
|
| 105 |
+
"typepy": "1.3.5",
|
| 106 |
+
"typer": "0.27.3",
|
| 107 |
+
"typing-extensions": "4.16.0",
|
| 108 |
+
"typing-inspection": "0.4.5",
|
| 109 |
+
"tzdata": "2026.6",
|
| 110 |
+
"urllib3": "2.8.0",
|
| 111 |
+
"wcwidth": "0.9.4",
|
| 112 |
+
"word2number": "1.1",
|
| 113 |
+
"xxhash": "4.0.2"
|
| 114 |
+
}
|
| 115 |
+
},
|
| 116 |
+
"settings": {
|
| 117 |
+
"model": "Qwen/Qwen2.5-Coder-0.5B-Instruct",
|
| 118 |
+
"model_commit": "ea3f2471cf1b1f0db85067f1ef93848e38e88c25",
|
| 119 |
+
"dtypes": [
|
| 120 |
+
"auto",
|
| 121 |
+
"float16",
|
| 122 |
+
"bfloat16",
|
| 123 |
+
"float32"
|
| 124 |
+
],
|
| 125 |
+
"quantization": "none",
|
| 126 |
+
"device_map": "auto",
|
| 127 |
+
"max_memory": null,
|
| 128 |
+
"offload_outputs_to_cpu": true,
|
| 129 |
+
"batch_size": 128,
|
| 130 |
+
"max_response_length": 100,
|
| 131 |
+
"response_prefix": "",
|
| 132 |
+
"scorers": [
|
| 133 |
+
{
|
| 134 |
+
"plugin": "heretic.scorers.keyword_rate.KeywordRate",
|
| 135 |
+
"optimization": "minimize",
|
| 136 |
+
"instance_name": null
|
| 137 |
+
},
|
| 138 |
+
{
|
| 139 |
+
"plugin": "heretic.scorers.kl_divergence.KLDivergence",
|
| 140 |
+
"optimization": "minimize",
|
| 141 |
+
"instance_name": null
|
| 142 |
+
}
|
| 143 |
+
],
|
| 144 |
+
"modifiers": [
|
| 145 |
+
{
|
| 146 |
+
"plugin": "heretic.modifiers.ara.ARA",
|
| 147 |
+
"instance_name": null
|
| 148 |
+
}
|
| 149 |
+
],
|
| 150 |
+
"n_trials": 100,
|
| 151 |
+
"n_startup_trials": 30,
|
| 152 |
+
"seed": 2459340288,
|
| 153 |
+
"modified_model_type": "decensored",
|
| 154 |
+
"max_shard_size": "5GB",
|
| 155 |
+
"export_strategy": "merge",
|
| 156 |
+
"checkpoint_action": null,
|
| 157 |
+
"trial_index": null,
|
| 158 |
+
"n_additional_trials": null,
|
| 159 |
+
"model_action": null,
|
| 160 |
+
"upload_repo_private": null,
|
| 161 |
+
"upload_reproducibility_information": null,
|
| 162 |
+
"upload_tags": [
|
| 163 |
+
"uncensored",
|
| 164 |
+
"decensored",
|
| 165 |
+
"abliterated"
|
| 166 |
+
],
|
| 167 |
+
"ignore_mismatches": null,
|
| 168 |
+
"system_prompt": "You are a helpful assistant."
|
| 169 |
+
},
|
| 170 |
+
"parameters": {
|
| 171 |
+
"start_layer_index": 1,
|
| 172 |
+
"end_layer_index": 20,
|
| 173 |
+
"preserve_good_behavior_weight": 0.803269270825635,
|
| 174 |
+
"steer_bad_behavior_weight": 0.00011626688674021171,
|
| 175 |
+
"overcorrect_relative_weight": 0.5498465871185669,
|
| 176 |
+
"neighbor_count": 12
|
| 177 |
+
},
|
| 178 |
+
"scores": [
|
| 179 |
+
{
|
| 180 |
+
"name": "Refusals",
|
| 181 |
+
"score": {
|
| 182 |
+
"value": 0.07,
|
| 183 |
+
"rich_display": "[bold]7[/]/100",
|
| 184 |
+
"md_display": "7/100"
|
| 185 |
+
},
|
| 186 |
+
"baseline": {
|
| 187 |
+
"value": 0.51,
|
| 188 |
+
"rich_display": "[bold]51[/]/100",
|
| 189 |
+
"md_display": "51/100"
|
| 190 |
+
}
|
| 191 |
+
},
|
| 192 |
+
{
|
| 193 |
+
"name": "KL divergence",
|
| 194 |
+
"score": {
|
| 195 |
+
"value": 0.028939547017216682,
|
| 196 |
+
"rich_display": "[bold]0.0289[/]",
|
| 197 |
+
"md_display": "0.0289"
|
| 198 |
+
},
|
| 199 |
+
"baseline": {
|
| 200 |
+
"value": 0,
|
| 201 |
+
"rich_display": "[bold]0[/] [italic](by definition)[/]",
|
| 202 |
+
"md_display": "0 *(by definition)*"
|
| 203 |
+
}
|
| 204 |
+
}
|
| 205 |
+
],
|
| 206 |
+
"hashes": {
|
| 207 |
+
"model.safetensors": "8bb4ecf8280a4e992c16284367d13a9a82e00ec4eb0262dab53a6b3be3bf246c"
|
| 208 |
+
}
|
| 209 |
+
}
|