Text Generation
Transformers
Safetensors
Chinese
English
ynet32
custom_code
ymodel
ymodel32
conversational
Instructions to use SnifferCaptain/YModel3.2-fm-1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SnifferCaptain/YModel3.2-fm-1B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SnifferCaptain/YModel3.2-fm-1B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("SnifferCaptain/YModel3.2-fm-1B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SnifferCaptain/YModel3.2-fm-1B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SnifferCaptain/YModel3.2-fm-1B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SnifferCaptain/YModel3.2-fm-1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SnifferCaptain/YModel3.2-fm-1B
- SGLang
How to use SnifferCaptain/YModel3.2-fm-1B 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 "SnifferCaptain/YModel3.2-fm-1B" \ --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": "SnifferCaptain/YModel3.2-fm-1B", "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 "SnifferCaptain/YModel3.2-fm-1B" \ --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": "SnifferCaptain/YModel3.2-fm-1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use SnifferCaptain/YModel3.2-fm-1B with Docker Model Runner:
docker model run hf.co/SnifferCaptain/YModel3.2-fm-1B
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -65,6 +65,39 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
| 65 |
)
|
| 66 |
```
|
| 67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
注意:该架构的 `generate()` 为模型自定义实现,不使用 KV cache(每步重算完整前缀),长序列生成会相应变慢。
|
| 69 |
|
| 70 |
## Notes
|
|
@@ -126,6 +159,37 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
| 126 |
)
|
| 127 |
```
|
| 128 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
Note: this architecture ships a custom `generate()` implementation without KV caching (the full prefix is recomputed each step), so long-sequence generation is correspondingly slower.
|
| 130 |
|
| 131 |
## Notes
|
|
|
|
| 65 |
)
|
| 66 |
```
|
| 67 |
|
| 68 |
+
|
| 69 |
+
### 对话格式
|
| 70 |
+
|
| 71 |
+
模型使用 ChatML 风格的对话边界。完整的输入可以写成:
|
| 72 |
+
|
| 73 |
+
```text
|
| 74 |
+
<|im_start|>system
|
| 75 |
+
{system prompt}<|im_end|>
|
| 76 |
+
<|im_start|>user
|
| 77 |
+
{user content}<|im_end|>
|
| 78 |
+
<|im_start|>assistant
|
| 79 |
+
<think>{thinking_definitions}
|
| 80 |
+
{reasoning content}</think>
|
| 81 |
+
|
| 82 |
+
{assistant content}<|im_end|>
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
其中,`{thinking_definitions}` 是紧跟在 `<think>` 后面的**第一行控制信息**,不是思考正文。它可以是:
|
| 86 |
+
|
| 87 |
+
- `juice = 1.23`:思考预算提示,可以使用小数。
|
| 88 |
+
- `structured = true`:表示结构化思考。
|
| 89 |
+
- `juice = 1.23; structured = true`:同时指定预算和结构化思考。
|
| 90 |
+
|
| 91 |
+
控制行结束后换行,再写入 `{reasoning content}`;思考结束使用 `</think>`,之后空一行写最终的 `{assistant content}`。自由形式思考可以省略 `structured`,也可以显式写成 `structured = false`。如果没有控制字段,保留空的控制行即可:
|
| 92 |
+
|
| 93 |
+
```text
|
| 94 |
+
<think>
|
| 95 |
+
{reasoning content}
|
| 96 |
+
</think>
|
| 97 |
+
```
|
| 98 |
+
|
| 99 |
+
每个角色都使用 `<|im_start|>role\n...<|im_end|>` 边界;`system` 和 `user` 内容不会放入 `<think>`,思考与最终回答只属于 `assistant` 消息。
|
| 100 |
+
|
| 101 |
注意:该架构的 `generate()` 为模型自定义实现,不使用 KV cache(每步重算完整前缀),长序列生成会相应变慢。
|
| 102 |
|
| 103 |
## Notes
|
|
|
|
| 159 |
)
|
| 160 |
```
|
| 161 |
|
| 162 |
+
|
| 163 |
+
### Chat Format
|
| 164 |
+
|
| 165 |
+
The model uses ChatML-style turn boundaries. A complete input can be written as:
|
| 166 |
+
|
| 167 |
+
```text
|
| 168 |
+
<|im_start|>system
|
| 169 |
+
{system prompt}<|im_end|>
|
| 170 |
+
<|im_start|>user
|
| 171 |
+
{user content}<|im_end|>
|
| 172 |
+
<|im_start|>assistant
|
| 173 |
+
<think>{thinking_definitions}
|
| 174 |
+
{reasoning content}</think>
|
| 175 |
+
|
| 176 |
+
{assistant content}<|im_end|>
|
| 177 |
+
```
|
| 178 |
+
|
| 179 |
+
`{thinking_definitions}` is the **first control line** immediately after `<think>`, not the reasoning body. It may be:
|
| 180 |
+
|
| 181 |
+
- `juice = 1.23` for a numeric reasoning-budget hint;
|
| 182 |
+
- `structured = true` to mark structured reasoning; or
|
| 183 |
+
- `juice = 1.23; structured = true` to provide both fields.
|
| 184 |
+
|
| 185 |
+
Terminate the control line with a newline, then place the reasoning in `{reasoning content}`. Close it with `</think>`, leave one blank line, and put the final answer in `{assistant content}`. For free-form reasoning, `structured` may be omitted or written as `structured = false`. If no control field is needed, keep an empty control line:
|
| 186 |
+
|
| 187 |
+
```text
|
| 188 |
+
<think>
|
| 189 |
+
{reasoning content}
|
| 190 |
+
</think>
|
| 191 |
+
```
|
| 192 |
+
|
| 193 |
Note: this architecture ships a custom `generate()` implementation without KV caching (the full prefix is recomputed each step), so long-sequence generation is correspondingly slower.
|
| 194 |
|
| 195 |
## Notes
|