Text Generation
Transformers
Safetensors
qwen3
Generated from Trainer
sft
trl
conversational
text-generation-inference
Instructions to use cs-552-2026-flab/math_model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cs-552-2026-flab/math_model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cs-552-2026-flab/math_model") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("cs-552-2026-flab/math_model") model = AutoModelForCausalLM.from_pretrained("cs-552-2026-flab/math_model", device_map="auto") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cs-552-2026-flab/math_model with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cs-552-2026-flab/math_model" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cs-552-2026-flab/math_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/cs-552-2026-flab/math_model
- SGLang
How to use cs-552-2026-flab/math_model 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 "cs-552-2026-flab/math_model" \ --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": "cs-552-2026-flab/math_model", "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 "cs-552-2026-flab/math_model" \ --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": "cs-552-2026-flab/math_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use cs-552-2026-flab/math_model with Docker Model Runner:
docker model run hf.co/cs-552-2026-flab/math_model
093919-SFT-Lean+math-best-allround-eval-revert-from-exp6filt
Browse files- README.md +5 -14
- chat_template.jinja +1 -2
- model.safetensors +1 -1
- tokenizer.json +2 -2
- tokenizer_config.json +2 -1
README.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
| 3 |
-
model_name:
|
| 4 |
tags:
|
| 5 |
- generated_from_trainer
|
| 6 |
-
-
|
| 7 |
- trl
|
| 8 |
licence: license
|
| 9 |
---
|
| 10 |
|
| 11 |
-
# Model Card for
|
| 12 |
|
| 13 |
This model is a fine-tuned version of [None](https://huggingface.co/None).
|
| 14 |
It has been trained using [TRL](https://github.com/huggingface/trl).
|
|
@@ -26,11 +26,11 @@ print(output["generated_text"])
|
|
| 26 |
|
| 27 |
## Training procedure
|
| 28 |
|
| 29 |
-
[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="150" height="24"/>](https://wandb.ai/cs-552-2026-flab/flab-cs552/runs/
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
-
This model was trained with
|
| 34 |
|
| 35 |
### Framework versions
|
| 36 |
|
|
@@ -42,16 +42,7 @@ This model was trained with GRPO, a method introduced in [DeepSeekMath: Pushing
|
|
| 42 |
|
| 43 |
## Citations
|
| 44 |
|
| 45 |
-
Cite GRPO as:
|
| 46 |
|
| 47 |
-
```bibtex
|
| 48 |
-
@article{shao2024deepseekmath,
|
| 49 |
-
title = {{DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models}},
|
| 50 |
-
author = {Zhihong Shao and Peiyi Wang and Qihao Zhu and Runxin Xu and Junxiao Song and Mingchuan Zhang and Y. K. Li and Y. Wu and Daya Guo},
|
| 51 |
-
year = 2024,
|
| 52 |
-
eprint = {arXiv:2402.03300},
|
| 53 |
-
}
|
| 54 |
-
```
|
| 55 |
|
| 56 |
Cite TRL as:
|
| 57 |
|
|
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
| 3 |
+
model_name: '20260529_093919'
|
| 4 |
tags:
|
| 5 |
- generated_from_trainer
|
| 6 |
+
- sft
|
| 7 |
- trl
|
| 8 |
licence: license
|
| 9 |
---
|
| 10 |
|
| 11 |
+
# Model Card for 20260529_093919
|
| 12 |
|
| 13 |
This model is a fine-tuned version of [None](https://huggingface.co/None).
|
| 14 |
It has been trained using [TRL](https://github.com/huggingface/trl).
|
|
|
|
| 26 |
|
| 27 |
## Training procedure
|
| 28 |
|
| 29 |
+
[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="150" height="24"/>](https://wandb.ai/cs-552-2026-flab/flab-cs552/runs/cwg4aje3)
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
+
This model was trained with SFT.
|
| 34 |
|
| 35 |
### Framework versions
|
| 36 |
|
|
|
|
| 42 |
|
| 43 |
## Citations
|
| 44 |
|
|
|
|
| 45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
Cite TRL as:
|
| 48 |
|
chat_template.jinja
CHANGED
|
@@ -1,6 +1,5 @@
|
|
| 1 |
{%- set enable_thinking = true %}
|
| 2 |
-
{%-
|
| 3 |
-
{%- if flab_boxed_instruction %}{{ '<|im_start|>system\n' + flab_boxed_instruction + '<|im_end|>\n' }}{%- endif %}{%- if tools %}
|
| 4 |
{{- '<|im_start|>system\n' }}
|
| 5 |
{%- if messages[0].role == 'system' %}
|
| 6 |
{{- messages[0].content + '\n\n' }}
|
|
|
|
| 1 |
{%- set enable_thinking = true %}
|
| 2 |
+
{%- if tools %}
|
|
|
|
| 3 |
{{- '<|im_start|>system\n' }}
|
| 4 |
{%- if messages[0].role == 'system' %}
|
| 5 |
{{- messages[0].content + '\n\n' }}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 3441185608
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4aba44e8ea5cfcd1cce320cbacbdf2e01b8a0c5bf560c615bc51626a38458b36
|
| 3 |
size 3441185608
|
tokenizer.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:82ff947750287e6ea07d0b2507b144c5c645274f3dcfae956140522843851c7f
|
| 3 |
+
size 11422916
|
tokenizer_config.json
CHANGED
|
@@ -33,5 +33,6 @@
|
|
| 33 |
"tokenizer_class": "Qwen2Tokenizer",
|
| 34 |
"truncation_side": "right",
|
| 35 |
"truncation_strategy": "longest_first",
|
| 36 |
-
"unk_token": null
|
|
|
|
| 37 |
}
|
|
|
|
| 33 |
"tokenizer_class": "Qwen2Tokenizer",
|
| 34 |
"truncation_side": "right",
|
| 35 |
"truncation_strategy": "longest_first",
|
| 36 |
+
"unk_token": null,
|
| 37 |
+
"chat_template": "{%- set enable_thinking = true %}\n{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0].role == 'system' %}\n {{- messages[0].content + '\\n\\n' }}\n {%- endif %}\n {{- \"# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0].role == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0].content + '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}\n{%- for message in messages[::-1] %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- if ns.multi_step_tool and message.role == \"user\" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}\n {%- set ns.multi_step_tool = false %}\n {%- set ns.last_query_index = index %}\n {%- endif %}\n{%- endfor %}\n{%- for message in messages %}\n {%- if message.content is string %}\n {%- set content = message.content %}\n {%- else %}\n {%- set content = '' %}\n {%- endif %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) %}\n {{- '<|im_start|>' + message.role + '\\n' + content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {%- set reasoning_content = '' %}\n {%- if message.reasoning_content is string %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- else %}\n {%- if '</think>' in content %}\n {%- set reasoning_content = content.split('</think>')[0].rstrip('\\n').split('<think>')[-1].lstrip('\\n') %}\n {%- set content = content.split('</think>')[-1].lstrip('\\n') %}\n {%- endif %}\n {%- endif %}\n {%- if loop.index0 > ns.last_query_index %}\n {%- if loop.last or (not loop.last and reasoning_content) %}\n {{- '<|im_start|>' + message.role + '\\n<think>\\n' + reasoning_content.strip('\\n') + '\\n</think>\\n\\n' + content.lstrip('\\n') }}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- if message.tool_calls %}\n {%- for tool_call in message.tool_calls %}\n {%- if (loop.first and content) or (not loop.first) %}\n {{- '\\n' }}\n {%- endif %}\n {%- if tool_call.function %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {%- if tool_call.arguments is string %}\n {{- tool_call.arguments }}\n {%- else %}\n {{- tool_call.arguments | tojson }}\n {%- endif %}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.first or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n {%- if enable_thinking is defined and enable_thinking is false %}\n {{- '<think>\\n\\n</think>\\n\\n' }}\n {%- endif %}\n{%- endif %}"
|
| 38 |
}
|