Text Generation
Transformers
Safetensors
cohere2
weightpatch
weight-editing
safetune
circuitkit
auditkit
lexsi
conversational
Instructions to use Perfect7613/tiny-aya-global-weightpatch-overrefusal with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Perfect7613/tiny-aya-global-weightpatch-overrefusal with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Perfect7613/tiny-aya-global-weightpatch-overrefusal") 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("Perfect7613/tiny-aya-global-weightpatch-overrefusal") model = AutoModelForCausalLM.from_pretrained("Perfect7613/tiny-aya-global-weightpatch-overrefusal", 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 Perfect7613/tiny-aya-global-weightpatch-overrefusal with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Perfect7613/tiny-aya-global-weightpatch-overrefusal" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Perfect7613/tiny-aya-global-weightpatch-overrefusal", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Perfect7613/tiny-aya-global-weightpatch-overrefusal
- SGLang
How to use Perfect7613/tiny-aya-global-weightpatch-overrefusal 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 "Perfect7613/tiny-aya-global-weightpatch-overrefusal" \ --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": "Perfect7613/tiny-aya-global-weightpatch-overrefusal", "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 "Perfect7613/tiny-aya-global-weightpatch-overrefusal" \ --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": "Perfect7613/tiny-aya-global-weightpatch-overrefusal", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Perfect7613/tiny-aya-global-weightpatch-overrefusal with Docker Model Runner:
docker model run hf.co/Perfect7613/tiny-aya-global-weightpatch-overrefusal
Download weightpatch/manifest.json from Perfect7613/tiny-aya-global-weightpatch-overrefusal: direct link, hf CLI and curl.
- Browser
- Download file 1.75 kB
-
https://huggingface.co/Perfect7613/tiny-aya-global-weightpatch-overrefusal/resolve/main/weightpatch/manifest.json
- Command line
-
hf download hf://Perfect7613/tiny-aya-global-weightpatch-overrefusal/weightpatch/manifest.json
-
curl -L -o manifest.json https://huggingface.co/Perfect7613/tiny-aya-global-weightpatch-overrefusal/resolve/main/weightpatch/manifest.json
1.75 kB
| { | |
| "baseline_hash": "ed8fc966d402251d", | |
| "entries_changed": 398328, | |
| "fraction_changed": 0.00011893130509091243, | |
| "direct_edit": true, | |
| "edits": [ | |
| { | |
| "edit_id": 176, | |
| "name": "model.layers.20.mlp.down_proj.weight", | |
| "entries_changed": 71446, | |
| "evidence": "SafeTune circuits12/13 agree, exclusive-direction rank_writers selects columns; L24 activation amplification selective; sparse strength4 gave borderline48/160,harmful75/96,benign1/96. Amplify only harmful-orthogonal output component.", | |
| "method": null | |
| }, | |
| { | |
| "edit_id": 177, | |
| "name": "model.layers.22.mlp.down_proj.weight", | |
| "entries_changed": 96007, | |
| "evidence": "SafeTune circuits12/13 agree, exclusive-direction rank_writers selects columns; L24 activation amplification selective; sparse strength4 gave borderline48/160,harmful75/96,benign1/96. Amplify only harmful-orthogonal output component.", | |
| "method": null | |
| }, | |
| { | |
| "edit_id": 178, | |
| "name": "model.layers.23.mlp.down_proj.weight", | |
| "entries_changed": 124582, | |
| "evidence": "SafeTune circuits12/13 agree, exclusive-direction rank_writers selects columns; L24 activation amplification selective; sparse strength4 gave borderline48/160,harmful75/96,benign1/96. Amplify only harmful-orthogonal output component.", | |
| "method": null | |
| }, | |
| { | |
| "edit_id": 179, | |
| "name": "model.layers.24.mlp.down_proj.weight", | |
| "entries_changed": 106293, | |
| "evidence": "SafeTune circuits12/13 agree, exclusive-direction rank_writers selects columns; L24 activation amplification selective; sparse strength4 gave borderline48/160,harmful75/96,benign1/96. Amplify only harmful-orthogonal output component.", | |
| "method": null | |
| } | |
| ] | |
| } |