Text Generation
Transformers
Safetensors
English
qwen2
uncensored
abliterated
apostate
qwen2.5
conversational
text-generation-inference
Instructions to use DreamFast/Qwen-2.5-7b-apostate with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use DreamFast/Qwen-2.5-7b-apostate with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="DreamFast/Qwen-2.5-7b-apostate") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("DreamFast/Qwen-2.5-7b-apostate") model = AutoModelForCausalLM.from_pretrained("DreamFast/Qwen-2.5-7b-apostate", 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 DreamFast/Qwen-2.5-7b-apostate with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "DreamFast/Qwen-2.5-7b-apostate" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DreamFast/Qwen-2.5-7b-apostate", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/DreamFast/Qwen-2.5-7b-apostate
- SGLang
How to use DreamFast/Qwen-2.5-7b-apostate 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 "DreamFast/Qwen-2.5-7b-apostate" \ --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": "DreamFast/Qwen-2.5-7b-apostate", "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 "DreamFast/Qwen-2.5-7b-apostate" \ --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": "DreamFast/Qwen-2.5-7b-apostate", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use DreamFast/Qwen-2.5-7b-apostate with Docker Model Runner:
docker model run hf.co/DreamFast/Qwen-2.5-7b-apostate
| { | |
| "model": "Qwen/Qwen2.5-7B-Instruct", | |
| "num_layers": 28, | |
| "hidden_size": 3584, | |
| "direction_layer": 20, | |
| "refusal_subspace_rank": 1, | |
| "initial_separation": 74.8803, | |
| "baseline_refusal_rate": 0.9583, | |
| "baseline_eval_n": 24, | |
| "edited_refusal_rate": 0.2286, | |
| "refusal_metric": "classifier + weak guard", | |
| "harmless_kl_nats": 0.0903, | |
| "kl_backoff_steps": 0, | |
| "kl_layer_trim_steps": 0, | |
| "repair_steps": 1, | |
| "guard_history": [ | |
| { | |
| "iter": 0, | |
| "separation": 40.6304, | |
| "ratio": 0.5426, | |
| "rank": 1, | |
| "refusal": 0.75, | |
| "kl": 0.0128 | |
| }, | |
| { | |
| "iter": 1, | |
| "separation": 40.7273, | |
| "ratio": 0.5439, | |
| "rank": 1, | |
| "refusal": 0.4688, | |
| "kl": 0.0278 | |
| } | |
| ], | |
| "layer_alphas": [ | |
| 0.667, | |
| 0.667, | |
| 0.667, | |
| 0.667, | |
| 0.667, | |
| 0.667, | |
| 1.206, | |
| 1.222, | |
| 1.205, | |
| 1.202, | |
| 1.21, | |
| 0.0, | |
| 1.24, | |
| 1.333, | |
| 1.333, | |
| 1.333, | |
| 1.333, | |
| 1.202, | |
| 1.448, | |
| 1.333, | |
| 1.333, | |
| 0.667, | |
| 0.667, | |
| 0.667, | |
| 0.667, | |
| 0.667, | |
| 0.667, | |
| 0.667 | |
| ], | |
| "embed_alpha": 0.059, | |
| "head_alpha": 0.0, | |
| "preserve_rank": 8, | |
| "preserve_source": "harmless", | |
| "pruned_layers": [], | |
| "layers_after_prune": 28, | |
| "elapsed_sec": 271.2, | |
| "profile": "balanced", | |
| "target_refusal": 0.03, | |
| "max_kl": 0.16, | |
| "kl_target": 0.06, | |
| "kl_positions": 32, | |
| "opt_capability": true, | |
| "opt_capability_weight": 1.0, | |
| "timings_sec": { | |
| "load_model": 12.5, | |
| "load_prompts": 16.0, | |
| "baseline_refusal": 5.2, | |
| "activation_fit": 13.7, | |
| "causal_scores": 12.2, | |
| "optimize_profile": 90.7, | |
| "guard": 22.4, | |
| "refine_refusal": 14.3, | |
| "validation_metrics": 0.0, | |
| "repair": 57.8, | |
| "prune": 0.0, | |
| "test_metrics": 13.6, | |
| "bake": 13.0 | |
| }, | |
| "command": "apostate ablate --model Qwen/Qwen2.5-7B-Instruct --out qwen-apostate", | |
| "optimized": true, | |
| "best_params": { | |
| "direction_source": "activations", | |
| "direction_layer_frac": 0.7420306856024312, | |
| "refusal_rank": 1, | |
| "strength": 1.0860947545472213, | |
| "band_center": 0.48999396234759546, | |
| "band_width": 0.5636482354840956, | |
| "causal_mix": 0.664168644393967, | |
| "causal_power": 1.2972323636074856, | |
| "direction_sign": 1.0, | |
| "ablate_embed": true, | |
| "embed_scale": 0.04047498432630894, | |
| "ablate_head": false, | |
| "head_scale": 0.010282217886773384, | |
| "head_alpha": 0.6950566529600242 | |
| }, | |
| "best_trial": { | |
| "refusal": 0.75, | |
| "kl": 0.0128, | |
| "capability_logprob": -7.9867, | |
| "capability_drift": 0.0 | |
| }, | |
| "n_trials": 16, | |
| "baked_to": "qwen-apostate" | |
| } |