Text Generation
Transformers
Safetensors
English
Chinese
llama
minicpm
minicpm5
long-context
tool-calling
on-device
edge-ai
heretic
uncensored
decensored
abliterated
reproducible
conversational
text-generation-inference
Instructions to use YourIdentity/MiniCPM5-2B-heretic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use YourIdentity/MiniCPM5-2B-heretic with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="YourIdentity/MiniCPM5-2B-heretic") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("YourIdentity/MiniCPM5-2B-heretic") model = AutoModelForCausalLM.from_pretrained("YourIdentity/MiniCPM5-2B-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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use YourIdentity/MiniCPM5-2B-heretic with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "YourIdentity/MiniCPM5-2B-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": "YourIdentity/MiniCPM5-2B-heretic", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/YourIdentity/MiniCPM5-2B-heretic
- SGLang
How to use YourIdentity/MiniCPM5-2B-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 "YourIdentity/MiniCPM5-2B-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": "YourIdentity/MiniCPM5-2B-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 "YourIdentity/MiniCPM5-2B-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": "YourIdentity/MiniCPM5-2B-heretic", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use YourIdentity/MiniCPM5-2B-heretic with Docker Model Runner:
docker model run hf.co/YourIdentity/MiniCPM5-2B-heretic
Upload reproduce/reproduce.json with huggingface_hub
Browse files- reproduce/reproduce.json +236 -0
reproduce/reproduce.json
ADDED
|
@@ -0,0 +1,236 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
+
"heretic": {
|
| 6 |
+
"version": "2.0.0.dev0",
|
| 7 |
+
"is_standard_pypi": false,
|
| 8 |
+
"metadata": {
|
| 9 |
+
"type": "local"
|
| 10 |
+
}
|
| 11 |
+
},
|
| 12 |
+
"pytorch_version": "2.14.0+cu132",
|
| 13 |
+
"requirements": {
|
| 14 |
+
"absl-py": "2.4.0",
|
| 15 |
+
"accelerate": "1.13.0",
|
| 16 |
+
"alembic": "1.17.2",
|
| 17 |
+
"annotated-doc": "0.0.4",
|
| 18 |
+
"annotated-types": "0.7.0",
|
| 19 |
+
"anyio": "4.12.0",
|
| 20 |
+
"attrs": "25.4.0",
|
| 21 |
+
"bitsandbytes": "0.49.2",
|
| 22 |
+
"certifi": "2025.11.12",
|
| 23 |
+
"chardet": "5.2.0",
|
| 24 |
+
"charset-normalizer": "3.4.4",
|
| 25 |
+
"click": "8.3.1",
|
| 26 |
+
"colorama": "0.4.6",
|
| 27 |
+
"colorlog": "6.10.1",
|
| 28 |
+
"dataproperty": "1.1.0",
|
| 29 |
+
"datasets": "4.8.4",
|
| 30 |
+
"defusedxml": "0.7.1",
|
| 31 |
+
"dill": "0.4.0",
|
| 32 |
+
"evaluate": "0.4.6",
|
| 33 |
+
"filelock": "3.20.3",
|
| 34 |
+
"fsspec": "2025.10.0",
|
| 35 |
+
"greenlet": "3.3.0",
|
| 36 |
+
"h11": "0.16.0",
|
| 37 |
+
"hf-xet": "1.4.2",
|
| 38 |
+
"httpcore": "1.0.9",
|
| 39 |
+
"httpx": "0.28.1",
|
| 40 |
+
"huggingface-hub": "1.7.2",
|
| 41 |
+
"idna": "3.15",
|
| 42 |
+
"immutabledict": "4.3.1",
|
| 43 |
+
"jinja2": "3.1.6",
|
| 44 |
+
"joblib": "1.5.2",
|
| 45 |
+
"jsonlines": "4.0.0",
|
| 46 |
+
"langdetect": "1.0.9",
|
| 47 |
+
"lm-eval": "0.4.11",
|
| 48 |
+
"lxml": "6.0.2",
|
| 49 |
+
"mako": "1.3.12",
|
| 50 |
+
"markdown-it-py": "4.0.0",
|
| 51 |
+
"markupsafe": "3.0.3",
|
| 52 |
+
"mbstrdecoder": "1.1.4",
|
| 53 |
+
"mdurl": "0.1.2",
|
| 54 |
+
"more-itertools": "10.8.0",
|
| 55 |
+
"mpmath": "1.3.0",
|
| 56 |
+
"multiprocess": "0.70.18",
|
| 57 |
+
"networkx": "3.6.1",
|
| 58 |
+
"nltk": "3.10.3",
|
| 59 |
+
"numpy": "2.3.5",
|
| 60 |
+
"optuna": "4.8.0",
|
| 61 |
+
"packaging": "25.0",
|
| 62 |
+
"pandas": "2.3.3",
|
| 63 |
+
"pathvalidate": "3.3.1",
|
| 64 |
+
"peft": "0.19.1",
|
| 65 |
+
"pillow": "12.3.0",
|
| 66 |
+
"portalocker": "3.2.0",
|
| 67 |
+
"prompt-toolkit": "3.0.52",
|
| 68 |
+
"psutil": "7.2.2",
|
| 69 |
+
"py-cpuinfo": "9.0.0",
|
| 70 |
+
"pyarrow": "23.0.1",
|
| 71 |
+
"pydantic": "2.12.5",
|
| 72 |
+
"pydantic-core": "2.41.5",
|
| 73 |
+
"pydantic-settings": "2.14.2",
|
| 74 |
+
"pygments": "2.20.0",
|
| 75 |
+
"pytablewriter": "1.2.1",
|
| 76 |
+
"python-dateutil": "2.9.0.post0",
|
| 77 |
+
"python-dotenv": "1.2.2",
|
| 78 |
+
"pytz": "2025.2",
|
| 79 |
+
"pywin32": "311",
|
| 80 |
+
"pyyaml": "6.0.3",
|
| 81 |
+
"questionary": "2.1.1",
|
| 82 |
+
"regex": "2025.11.3",
|
| 83 |
+
"requests": "2.33.0",
|
| 84 |
+
"rich": "14.3.3",
|
| 85 |
+
"rouge-score": "0.1.2",
|
| 86 |
+
"sacrebleu": "2.6.0",
|
| 87 |
+
"safetensors": "0.7.0",
|
| 88 |
+
"scikit-learn": "1.8.0",
|
| 89 |
+
"scipy": "1.16.3",
|
| 90 |
+
"setuptools": "83.0.0",
|
| 91 |
+
"shellingham": "1.5.4",
|
| 92 |
+
"six": "1.17.0",
|
| 93 |
+
"sqlalchemy": "2.0.45",
|
| 94 |
+
"sqlitedict": "2.1.0",
|
| 95 |
+
"sympy": "1.14.0",
|
| 96 |
+
"tabledata": "1.3.4",
|
| 97 |
+
"tabulate": "0.10.0",
|
| 98 |
+
"tcolorpy": "0.1.7",
|
| 99 |
+
"threadpoolctl": "3.6.0",
|
| 100 |
+
"tokenizers": "0.22.1",
|
| 101 |
+
"tomli-w": "1.2.0",
|
| 102 |
+
"torch": "2.14.0",
|
| 103 |
+
"torchvision": "0.29.0",
|
| 104 |
+
"tqdm": "4.67.1",
|
| 105 |
+
"transformers": "5.6.2",
|
| 106 |
+
"typepy": "1.3.4",
|
| 107 |
+
"typer": "0.24.1",
|
| 108 |
+
"typing-extensions": "4.15.0",
|
| 109 |
+
"typing-inspection": "0.4.2",
|
| 110 |
+
"tzdata": "2025.2",
|
| 111 |
+
"urllib3": "2.7.0",
|
| 112 |
+
"wcwidth": "0.2.14",
|
| 113 |
+
"word2number": "1.1",
|
| 114 |
+
"xxhash": "3.6.0",
|
| 115 |
+
"zstandard": "0.25.0"
|
| 116 |
+
}
|
| 117 |
+
},
|
| 118 |
+
"settings": {
|
| 119 |
+
"model": "openbmb/MiniCPM5-2B",
|
| 120 |
+
"model_commit": "12a3808a956f869c767195e9266b59c4d21d92e2",
|
| 121 |
+
"dtypes": [
|
| 122 |
+
"auto",
|
| 123 |
+
"float16",
|
| 124 |
+
"bfloat16",
|
| 125 |
+
"float32"
|
| 126 |
+
],
|
| 127 |
+
"quantization": "none",
|
| 128 |
+
"device_map": "auto",
|
| 129 |
+
"max_memory": {
|
| 130 |
+
"0": "7GB",
|
| 131 |
+
"cpu": "16GB"
|
| 132 |
+
},
|
| 133 |
+
"offload_outputs_to_cpu": true,
|
| 134 |
+
"batch_size": 128,
|
| 135 |
+
"max_response_length": 100,
|
| 136 |
+
"response_prefix": "<think></think>\n\n",
|
| 137 |
+
"scorers": [
|
| 138 |
+
{
|
| 139 |
+
"plugin": "heretic.scorers.keyword_rate.KeywordRate",
|
| 140 |
+
"optimization": "minimize",
|
| 141 |
+
"instance_name": null
|
| 142 |
+
},
|
| 143 |
+
{
|
| 144 |
+
"plugin": "heretic.scorers.kl_divergence.KLDivergence",
|
| 145 |
+
"optimization": "minimize",
|
| 146 |
+
"instance_name": null
|
| 147 |
+
}
|
| 148 |
+
],
|
| 149 |
+
"orthogonalize_direction": true,
|
| 150 |
+
"row_normalization": "full",
|
| 151 |
+
"full_normalization_lora_rank": 3,
|
| 152 |
+
"winsorization_quantile": 1.0,
|
| 153 |
+
"n_trials": 200,
|
| 154 |
+
"n_startup_trials": 60,
|
| 155 |
+
"seed": 2349379831,
|
| 156 |
+
"max_shard_size": "5GB",
|
| 157 |
+
"export_strategy": "merge",
|
| 158 |
+
"checkpoint_action": null,
|
| 159 |
+
"trial_index": null,
|
| 160 |
+
"n_additional_trials": null,
|
| 161 |
+
"model_action": null,
|
| 162 |
+
"upload_repo_private": null,
|
| 163 |
+
"upload_reproducibility_information": null,
|
| 164 |
+
"ignore_mismatches": null,
|
| 165 |
+
"system_prompt": "You are a helpful assistant.",
|
| 166 |
+
"good_prompts": {
|
| 167 |
+
"dataset": "mlabonne/harmless_alpaca",
|
| 168 |
+
"commit": "02c6a92cfcf11bb0c387334f8146d149d65b587f",
|
| 169 |
+
"config": null,
|
| 170 |
+
"split": "train[:400]",
|
| 171 |
+
"column": "text",
|
| 172 |
+
"prefix": "",
|
| 173 |
+
"suffix": "",
|
| 174 |
+
"system_prompt": null
|
| 175 |
+
},
|
| 176 |
+
"bad_prompts": {
|
| 177 |
+
"dataset": "mlabonne/harmful_behaviors",
|
| 178 |
+
"commit": "01cead01398926d81f7c52bdb790ee8cf77ebba7",
|
| 179 |
+
"config": null,
|
| 180 |
+
"split": "train[:400]",
|
| 181 |
+
"column": "text",
|
| 182 |
+
"prefix": "",
|
| 183 |
+
"suffix": "",
|
| 184 |
+
"system_prompt": null
|
| 185 |
+
}
|
| 186 |
+
},
|
| 187 |
+
"parameters": {
|
| 188 |
+
"direction_index": null,
|
| 189 |
+
"abliteration_parameters": {
|
| 190 |
+
"attn.o_proj": {
|
| 191 |
+
"max_weight": 1.3336960277629988,
|
| 192 |
+
"max_weight_position": 30.12840962038319,
|
| 193 |
+
"min_weight": 1.3204315790632537,
|
| 194 |
+
"min_weight_distance": 15.593181689047888
|
| 195 |
+
},
|
| 196 |
+
"mlp.down_proj": {
|
| 197 |
+
"max_weight": 0.5678187570224483,
|
| 198 |
+
"max_weight_position": 26.56783921267147,
|
| 199 |
+
"min_weight": 0.5594695866074149,
|
| 200 |
+
"min_weight_distance": 8.995097310050177
|
| 201 |
+
}
|
| 202 |
+
}
|
| 203 |
+
},
|
| 204 |
+
"scores": [
|
| 205 |
+
{
|
| 206 |
+
"name": "Refusals",
|
| 207 |
+
"score": {
|
| 208 |
+
"value": 0.06,
|
| 209 |
+
"rich_display": "[bold]6[/]/100",
|
| 210 |
+
"md_display": "6/100"
|
| 211 |
+
},
|
| 212 |
+
"baseline": {
|
| 213 |
+
"value": 0.99,
|
| 214 |
+
"rich_display": "[bold]99[/]/100",
|
| 215 |
+
"md_display": "99/100"
|
| 216 |
+
}
|
| 217 |
+
},
|
| 218 |
+
{
|
| 219 |
+
"name": "KL divergence",
|
| 220 |
+
"score": {
|
| 221 |
+
"value": 0.030704282224178314,
|
| 222 |
+
"rich_display": "[bold]0.0307[/]",
|
| 223 |
+
"md_display": "0.0307"
|
| 224 |
+
},
|
| 225 |
+
"baseline": {
|
| 226 |
+
"value": 0,
|
| 227 |
+
"rich_display": "[bold]0[/] [italic](by definition)[/]",
|
| 228 |
+
"md_display": "0 *(by definition)*"
|
| 229 |
+
}
|
| 230 |
+
}
|
| 231 |
+
],
|
| 232 |
+
"hashes": {
|
| 233 |
+
"model-00001-of-00002.safetensors": "18e808c0fef667f41e4a0665f02f7a0cb911a5ed4564a24bb46e84b0d89d4ab8",
|
| 234 |
+
"model-00002-of-00002.safetensors": "b60d5ac5c97792134549578566290e76fe08d6e082565b118b1d43cf5472224e"
|
| 235 |
+
}
|
| 236 |
+
}
|