Text Generation
Safetensors
English
qwen2
chat
abliterated
uncensored
AWQ
4bit
conversational
4-bit precision
awq
Instructions to use nisten/qwen2.5-coder-7b-abliterated-128k-AWQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Local Apps Settings
- vLLM
How to use nisten/qwen2.5-coder-7b-abliterated-128k-AWQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nisten/qwen2.5-coder-7b-abliterated-128k-AWQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nisten/qwen2.5-coder-7b-abliterated-128k-AWQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/nisten/qwen2.5-coder-7b-abliterated-128k-AWQ
- SGLang
How to use nisten/qwen2.5-coder-7b-abliterated-128k-AWQ 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 "nisten/qwen2.5-coder-7b-abliterated-128k-AWQ" \ --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": "nisten/qwen2.5-coder-7b-abliterated-128k-AWQ", "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 "nisten/qwen2.5-coder-7b-abliterated-128k-AWQ" \ --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": "nisten/qwen2.5-coder-7b-abliterated-128k-AWQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use nisten/qwen2.5-coder-7b-abliterated-128k-AWQ with Docker Model Runner:
docker model run hf.co/nisten/qwen2.5-coder-7b-abliterated-128k-AWQ
Use this as a draft model, quant code provided, love you all.
4bit AWQ quant of model: https://huggingface.co/huihui-ai/Qwen2.5-Coder-7B-Instruct-abliterated
Code used to quantize it
from tqdm import tqdm
from datasets import load_dataset
from awq import AutoAWQForCausalLM
from transformers import AutoTokenizer
model_path = 'huihui-ai/Qwen2.5-Coder-7B-Instruct-abliterated'
quant_path = 'q7awqlocaldirname'
quant_config = { "zero_point": True, "q_group_size": 128, "w_bit": 4, "version": "GEMM" }
# Load model
model = AutoAWQForCausalLM.from_pretrained(model_path)
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
def load_openhermes_coding():
data = load_dataset("alvarobartt/openhermes-preferences-coding", split="train")
samples = []
for sample in data:
responses = [f'{response["role"]}: {response["content"]}' for response in sample["chosen"]]
samples.append("\n".join(responses))
return samples
# Quantize
model.quantize(
tokenizer,
quant_config=quant_config,
calib_data=load_openhermes_coding(),
# MODIFY these parameters if need be:
# n_parallel_calib_samples=32,
# max_calib_samples=128,
# max_calib_seq_len=4096
)
# Save quantized model
model.save_quantized(quant_path)
tokenizer.save_pretrained(quant_path)
print(f'Model is quantized and saved at "{quant_path}"')
- Downloads last month
- 4,660