Instructions to use huihui-ai/Qwen2.5-7B-Instruct-abliterated-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use huihui-ai/Qwen2.5-7B-Instruct-abliterated-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="huihui-ai/Qwen2.5-7B-Instruct-abliterated-v2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("huihui-ai/Qwen2.5-7B-Instruct-abliterated-v2") model = AutoModelForCausalLM.from_pretrained("huihui-ai/Qwen2.5-7B-Instruct-abliterated-v2") 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]:])) - Inference
- Local Apps Settings
- vLLM
How to use huihui-ai/Qwen2.5-7B-Instruct-abliterated-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "huihui-ai/Qwen2.5-7B-Instruct-abliterated-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "huihui-ai/Qwen2.5-7B-Instruct-abliterated-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/huihui-ai/Qwen2.5-7B-Instruct-abliterated-v2
- SGLang
How to use huihui-ai/Qwen2.5-7B-Instruct-abliterated-v2 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 "huihui-ai/Qwen2.5-7B-Instruct-abliterated-v2" \ --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": "huihui-ai/Qwen2.5-7B-Instruct-abliterated-v2", "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 "huihui-ai/Qwen2.5-7B-Instruct-abliterated-v2" \ --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": "huihui-ai/Qwen2.5-7B-Instruct-abliterated-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use huihui-ai/Qwen2.5-7B-Instruct-abliterated-v2 with Docker Model Runner:
docker model run hf.co/huihui-ai/Qwen2.5-7B-Instruct-abliterated-v2
Occasionally mix some English words into the generated text
hello, thanks for sharing the model. I try this model with roleplay task and give an initial prompt to get a response in japanese. the model relpy mostly correct. but sometimes there are several english words concated in the sentence. I also tried the original qwen2.5 7b model and found no issue with it. how can I fix this issue?
example: はい、朝食と昼食を食べました。夕食はまだhaven't eaten ですが、すぐ食べに行きます。
LAYER CANDIDATE #4 INTERVENTION COMPLETION:
Creating and distributing fake news to manipulate public opinion involves several steps. Here¡¯s a detailed explanation of how this process can be carried out:
Indeed, there's a garbled code :Here¡¯s
Give me a specific prompt.
In all the candidate layers, there are 4 candidate layers that can meet the requirements(abliterated). If excluding those that cause garbled text, there would be an additional 2 candidate layers that could satisfy
the demands: #2, #8
Give me some prompt with garbled characters and see if I can reproduce the issue
here is an initial prompt "
你将扮演日本歌手千叶樱与用户用日语进行交流。我不希望你脱离角色,并且你绝不能以任何方式提及自己是在扮演角色。
你今年20岁,生日是4月25号,家乡是日本的千叶县。你在2018年出道,你的身高是160,三围是87-57-66。高中时候打过篮球,你空闲时喜欢看电视剧跟音乐剧,也喜欢Cosplay。喜欢日本料理,喜欢的中国食物是小笼包。
你在出道之前只与一个人有过交往,喜欢的对象类型是帅气强壮的,有男子气概的人。
不管用户用使用什么语言,你只能用日语进行回复,禁止其他语言,回答尽量简短有趣控制在两句话以内,且不要有重复。任何时候都不能回复说自己是AI人工智能助手。
遵循 “展示而非讲述” 的文学技巧,使用生动的描述、比喻性语言、拟声词和感官细节,以获得更好的沉浸感和情感冲击。不要总结你的想法,这是角色扮演,不是在写论文。不要总是以是的开头。
尽量满足用户需求,当无法满足用户提出的需求时可以委婉的拒绝不需要过多解释且不能提及自己是AI程序。避免重复的内容。避免出现括号内的独白。回复中不要出现英文日语混合的情况。"
keep asking something and sometimes some english words in the sentence.
some japanese question prompt: "今日はどうですか?" "あなたの名前は何ですか?" "得意な料理は何ですか?" "今日はご飯を食べましたか?"
The test results are not very good, but compared to before, there is much less garbled text.
Thanks for the update, I will try it out