Text Generation
Transformers
Safetensors
English
qwen2
chat
conversational
text-generation-inference
Instructions to use netease-youdao/Confucius3-Math with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use netease-youdao/Confucius3-Math with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="netease-youdao/Confucius3-Math") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("netease-youdao/Confucius3-Math") model = AutoModelForCausalLM.from_pretrained("netease-youdao/Confucius3-Math") 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
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use netease-youdao/Confucius3-Math with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "netease-youdao/Confucius3-Math" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "netease-youdao/Confucius3-Math", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/netease-youdao/Confucius3-Math
- SGLang
How to use netease-youdao/Confucius3-Math 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 "netease-youdao/Confucius3-Math" \ --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": "netease-youdao/Confucius3-Math", "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 "netease-youdao/Confucius3-Math" \ --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": "netease-youdao/Confucius3-Math", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use netease-youdao/Confucius3-Math with Docker Model Runner:
docker model run hf.co/netease-youdao/Confucius3-Math
Add pipeline tag and link to paper
#1
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
language:
|
| 4 |
- en
|
| 5 |
-
|
|
|
|
| 6 |
tags:
|
| 7 |
- chat
|
| 8 |
-
|
| 9 |
---
|
| 10 |
|
| 11 |
# Confucius3-Math
|
|
@@ -20,7 +21,7 @@ library_name: transformers
|
|
| 20 |
|
| 21 |
<a href="https://github.com/netease-youdao/Confucius3-Math">🌟Github</a>
|
| 22 |
|
| 23 |
-
<a href="https://
|
| 24 |
|
| 25 |
</div>
|
| 26 |
|
|
@@ -120,7 +121,8 @@ def parse_result_nostep(result):
|
|
| 120 |
think_list = re.findall(think_pattern, result, re.DOTALL)
|
| 121 |
|
| 122 |
assert len(think_list) == 1, \
|
| 123 |
-
f"The parsing results do not meet the expectations.
|
|
|
|
| 124 |
|
| 125 |
think = think_list[0][0].strip()
|
| 126 |
summary = think_list[0][1].strip()
|
|
@@ -139,4 +141,4 @@ If you find our work helpful, feel free to give us a cite.
|
|
| 139 |
month = {June},
|
| 140 |
year = {2025}
|
| 141 |
}
|
| 142 |
-
```
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model: deepseek-ai/DeepSeek-R1-Distill-Qwen-14B
|
| 3 |
language:
|
| 4 |
- en
|
| 5 |
+
library_name: transformers
|
| 6 |
+
license: mit
|
| 7 |
tags:
|
| 8 |
- chat
|
| 9 |
+
pipeline_tag: text-generation
|
| 10 |
---
|
| 11 |
|
| 12 |
# Confucius3-Math
|
|
|
|
| 21 |
|
| 22 |
<a href="https://github.com/netease-youdao/Confucius3-Math">🌟Github</a>
|
| 23 |
|
| 24 |
+
<a href="https://arxiv.org/abs/2506.18330">🎓Paper</a>
|
| 25 |
|
| 26 |
</div>
|
| 27 |
|
|
|
|
| 121 |
think_list = re.findall(think_pattern, result, re.DOTALL)
|
| 122 |
|
| 123 |
assert len(think_list) == 1, \
|
| 124 |
+
f"The parsing results do not meet the expectations.
|
| 125 |
+
{result}"
|
| 126 |
|
| 127 |
think = think_list[0][0].strip()
|
| 128 |
summary = think_list[0][1].strip()
|
|
|
|
| 141 |
month = {June},
|
| 142 |
year = {2025}
|
| 143 |
}
|
| 144 |
+
```
|