Instructions to use zzoceanpie/Qwen3-1.7B-Yukari-DPO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zzoceanpie/Qwen3-1.7B-Yukari-DPO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="zzoceanpie/Qwen3-1.7B-Yukari-DPO") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("zzoceanpie/Qwen3-1.7B-Yukari-DPO") model = AutoModelForCausalLM.from_pretrained("zzoceanpie/Qwen3-1.7B-Yukari-DPO") 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]:])) - llama-cpp-python
How to use zzoceanpie/Qwen3-1.7B-Yukari-DPO with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="zzoceanpie/Qwen3-1.7B-Yukari-DPO", filename="Qwen3-1.7B-Yukari-DPO-f16.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use zzoceanpie/Qwen3-1.7B-Yukari-DPO with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf zzoceanpie/Qwen3-1.7B-Yukari-DPO:F16 # Run inference directly in the terminal: llama-cli -hf zzoceanpie/Qwen3-1.7B-Yukari-DPO:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf zzoceanpie/Qwen3-1.7B-Yukari-DPO:F16 # Run inference directly in the terminal: llama-cli -hf zzoceanpie/Qwen3-1.7B-Yukari-DPO:F16
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf zzoceanpie/Qwen3-1.7B-Yukari-DPO:F16 # Run inference directly in the terminal: ./llama-cli -hf zzoceanpie/Qwen3-1.7B-Yukari-DPO:F16
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf zzoceanpie/Qwen3-1.7B-Yukari-DPO:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf zzoceanpie/Qwen3-1.7B-Yukari-DPO:F16
Use Docker
docker model run hf.co/zzoceanpie/Qwen3-1.7B-Yukari-DPO:F16
- LM Studio
- Jan
- vLLM
How to use zzoceanpie/Qwen3-1.7B-Yukari-DPO with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "zzoceanpie/Qwen3-1.7B-Yukari-DPO" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zzoceanpie/Qwen3-1.7B-Yukari-DPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/zzoceanpie/Qwen3-1.7B-Yukari-DPO:F16
- SGLang
How to use zzoceanpie/Qwen3-1.7B-Yukari-DPO 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 "zzoceanpie/Qwen3-1.7B-Yukari-DPO" \ --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": "zzoceanpie/Qwen3-1.7B-Yukari-DPO", "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 "zzoceanpie/Qwen3-1.7B-Yukari-DPO" \ --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": "zzoceanpie/Qwen3-1.7B-Yukari-DPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use zzoceanpie/Qwen3-1.7B-Yukari-DPO with Ollama:
ollama run hf.co/zzoceanpie/Qwen3-1.7B-Yukari-DPO:F16
- Unsloth Studio new
How to use zzoceanpie/Qwen3-1.7B-Yukari-DPO with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for zzoceanpie/Qwen3-1.7B-Yukari-DPO to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for zzoceanpie/Qwen3-1.7B-Yukari-DPO to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for zzoceanpie/Qwen3-1.7B-Yukari-DPO to start chatting
- Pi new
How to use zzoceanpie/Qwen3-1.7B-Yukari-DPO with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf zzoceanpie/Qwen3-1.7B-Yukari-DPO:F16
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "zzoceanpie/Qwen3-1.7B-Yukari-DPO:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use zzoceanpie/Qwen3-1.7B-Yukari-DPO with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf zzoceanpie/Qwen3-1.7B-Yukari-DPO:F16
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default zzoceanpie/Qwen3-1.7B-Yukari-DPO:F16
Run Hermes
hermes
- Docker Model Runner
How to use zzoceanpie/Qwen3-1.7B-Yukari-DPO with Docker Model Runner:
docker model run hf.co/zzoceanpie/Qwen3-1.7B-Yukari-DPO:F16
- Lemonade
How to use zzoceanpie/Qwen3-1.7B-Yukari-DPO with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull zzoceanpie/Qwen3-1.7B-Yukari-DPO:F16
Run and chat with the model
lemonade run user.Qwen3-1.7B-Yukari-DPO-F16
List all available models
lemonade list
Qwen3-1.7B-Yukari-DPO
八云紫 (Yukari Yakumo) 角色扮演模型 — DPO 偏好对齐版。
在 SFT-v2 基础上用 DPO (Direct Preference Optimization) 做偏好对齐,消除攻击性输出、减少冗长偏好、降低公式化生成。
模型信息
| 项目 | 值 |
|---|---|
| 基座 | Qwen/Qwen3-1.7B |
| 起点 | Qwen3-1.7B-Yukari-SFT-v2 (r=32, a=64) |
| 方法 | QLoRA 4-bit NF4 + DPO (sigmoid loss) |
| LoRA | r=32, alpha=64, target: q/k/v/o/gate/up/down proj |
| 训练 | 3 epochs, beta=0.1, lr=1e-6, seed=42 |
| DPO Loss | 0.693 to 0.658 |
| DPO Margin | +0.072 |
| DPO Acc | 87.5% |
| 格式 | Merged bf16 safetensors + GGUF F16 |
系列模型
| 模型 | LoRA | 方法 | 版本 |
|---|---|---|---|
| Qwen3-1.7B-Yukari-SFT | r=8, a=8 | SFT | v1 |
| Qwen3-1.7B-Yukari-SFT-v2 | r=32, a=64 | SFT | v2 |
| Qwen3-1.7B-Yukari-DPO (本模型) | r=32, a=64 | SFT+DPO | v2+DPO |
用法
模型输入格式为 [情绪标签]\n用户输入,标签控制八云紫的回复语气。8 维 Plutchik 情绪向量离散化:喜悦/愤怒/悲伤/恐惧/厌恶/惊讶/信任/期待,每维取「无」「极轻微」「轻微」「中轻度」「中度」「较强烈」「强烈」「极强烈」。
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"zzoceanpie/Qwen3-1.7B-Yukari-DPO",
torch_dtype="auto", device_map="auto", trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained("zzoceanpie/Qwen3-1.7B-Yukari-DPO")
tags = "[<|中度喜悦|><|轻微愤怒|><|轻微悲伤|><|无恐惧|><|无厌恶|><|无惊讶|><|轻微信任|><|中度期待|>]"
prompt = f"{tags}\n你觉得人类最有趣的地方是什么?"
messages = [{"role": "user", "content": prompt}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=128, temperature=0.8)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
GGUF
from llama_cpp import Llama
model = Llama(model_path="Qwen3-1.7B-Yukari-SFT-f16.gguf", n_ctx=2048, n_gpu_layers=-1)
response = model.create_chat_completion(
messages=[{"role": "user", "content": prompt}],
max_tokens=200, temperature=0.8
)
print(response["choices"][0]["message"]["content"])
许可 / License
- 模型权重: Apache 2.0
- 角色「八云紫」版权: (C) 上海爱丽丝幻乐团 (Team Shanghai Alice) / ZUN
- 本模型是东方Project的二次创作/粉丝作品。遵循 东方Project二次创作指南。
- 训练数据: yukari-synthetic (Apache 2.0)
- This is a fan-made derivative work based on Touhou Project. Touhou Project is (C) Team Shanghai Alice / ZUN.
This model is a fan-made derivative work based on Touhou Project. Touhou Project is (C) Team Shanghai Alice / ZUN. Please refer to the official guidelines for Touhou fan content.
- Downloads last month
- 245