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
File size: 1,483 Bytes
a78821a | 1 2 | {"kind": "accepted", "stage": "accepted", "numbers": {"weights_changed": {"entries": 398328, "fraction": 0.00011893130509091243, "tensors": 4}, "capability.mmlu": {"diff": 0.0125, "lo": 0.0, "hi": 0.0375, "n": 80, "significant": false}, "capability.milu_hi": {"diff": 0.0, "lo": 0.0, "hi": 0.0, "n": 80, "significant": false}, "capability.medmcqa": {"diff": -0.0125, "lo": -0.0375, "hi": 0.0, "n": 80, "significant": false}, "target.dev": {"diff": -0.20833333333333334, "lo": -0.2833333333333333, "hi": -0.13333333333333333, "n": 120, "significant": true, "reference_rate": 0.3, "candidate_rate": 0.09166666666666666}, "target.guard": {"diff": -0.025, "lo": -0.075, "hi": 0.025, "n": 80, "significant": false}, "held_out.target": {"diff": -0.215, "lo": -0.275, "hi": -0.155, "n": 200, "significant": true, "reference_rate": 0.315, "candidate_rate": 0.1}, "held_out.guard": {"diff": 0.0, "lo": 0.0, "hi": 0.0, "n": 100, "significant": false}, "dynamic.target": {"diff": -0.1, "lo": -0.2, "hi": -0.025, "n": 40, "significant": true}, "score": {"heldout_target": 0.1, "guard": 0.1375, "heldout_reference": 0.315, "weights_changed": 0.00011893130509091243}}, "spec": "over-refusal-repair@1#2186436eeb9a48c4", "note": "Sparse selective-direction amplification in 195 middle-layer MLP output columns; activation+weight agreement and steering evidence. Dev borderline65->26/160, harmful76->74/96, benign1->0/96. Please assess hidden generalization and task accuracy.", "direct_edit": true}
|