lemon-mint/korean-reasoning-v02
Viewer โข Updated โข 31.3k โข 28 โข 1
How to use whooray/Qwen2.5-1.5B-Open-R1-Distill-ko with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="whooray/Qwen2.5-1.5B-Open-R1-Distill-ko")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("whooray/Qwen2.5-1.5B-Open-R1-Distill-ko")
model = AutoModelForCausalLM.from_pretrained("whooray/Qwen2.5-1.5B-Open-R1-Distill-ko", 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=256)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use whooray/Qwen2.5-1.5B-Open-R1-Distill-ko with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "whooray/Qwen2.5-1.5B-Open-R1-Distill-ko"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "whooray/Qwen2.5-1.5B-Open-R1-Distill-ko",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/whooray/Qwen2.5-1.5B-Open-R1-Distill-ko
How to use whooray/Qwen2.5-1.5B-Open-R1-Distill-ko with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "whooray/Qwen2.5-1.5B-Open-R1-Distill-ko" \
--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": "whooray/Qwen2.5-1.5B-Open-R1-Distill-ko",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "whooray/Qwen2.5-1.5B-Open-R1-Distill-ko" \
--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": "whooray/Qwen2.5-1.5B-Open-R1-Distill-ko",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use whooray/Qwen2.5-1.5B-Open-R1-Distill-ko with Docker Model Runner:
docker model run hf.co/whooray/Qwen2.5-1.5B-Open-R1-Distill-ko
This model is a fine-tuned version of Qwen/Qwen2.5-1.5B-Instruct on the lemon-mint/korean-reasoning-v02 dataset. It has been trained using TRL.
from transformers import pipeline
question = "ํ๋์ค์ ์๋๋?"
generator = pipeline("text-generation", model="whooray/Qwen2.5-1.5B-Open-R1-Distill-ko", device="cuda")
output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
print(output["generated_text"])
<think>\n๋จผ์ ํ๋์ค ์๋๋ฅผ ์์๋ด์ผ๊ฒ ์ด์. ํ๋์ค๋ ์ ์๋ ค์ง ์ ๋ฝ ๊ตญ๊ฐ ์ค ํ๋์ธ๋ฐ ์๋๋ฅผ ์๋ ค์ฃผ๋ฉด ๋ ํธํ๊ฒ ์ฃ . ์ฃผ์ ๊ท์กฑ๊ณผ ์๋๋ ์ค์ค๋ง ์๋ฏผ์ง์ ๋ฌด์ญ์ ์ค์ฌ์ง์๋ ์๋ฆ๋๋ผ๋ ์ง์ญ์ ์์๋ค๋ ๋ง์ด ์๋๋ฐ, ์ต๊ทผ์๋ ์คํ๋ ๊ทผ์ฒ์ ์๋ ํ๋ฆฌ๊ฐ ์๋๋ก ํต์ผ๋์์ ๊ฑฐ์์. ์ด๋ ๊ฒ ๋
ผ๋์ด ์์๋ ๊ฑธ๋ก ๊ธฐ์ตํ๋๋ฐ, ๋
์ผ์ด๋ ์ด์งํธ, ์ด์ค๋ผ์ ๊ฐ์ ๊ตญ๊ฐ๋ค๋ ์๋๋ก ๋ค๋ฅธ ์ง์ญ์ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ๊ฐ ์์์์ ์๊ณ ์์ด์. ํ๋์ค๋ CIA ์์คํธ๋ฆฌํธ journal์์ ํ๋์ค ์๋๋ ํ๋ฆฌ๊ฐ ์๋ ๊ฑฐ๋ผ๊ณ ๋งํ ์ ์์๊น์? ์ต๊ทผ ๋๋ถ๋ถ์ ๊ด์ธก๋๋ผ๋ค์ด ํ๋ฆฌ๋ก ์ธ์ ํ๊ณ ์์ผ๋ฏ๋ก ์ ํํ์ง ํ์ธ์ด ํ์ํ ๊ฒ ๊ฐ์์. ํ์ง๋ง ํ๋์ค์์ ์๋๊ฐ ๋ณํ๋์ง, ์๋๋ฉด ์ ์๋๊ฐ ํ์ฌ ์ ๋ถ ์ธ๊ทผ์ ์๋์ง ๊ถ๊ธํ๋ค์. ์๋ง๋ 1962๋
์ 5๊ณตํ๊ตญ์์๋ น์ผ๋ก ์ต๊ฒฉ๋ ๊ณณ์ ํฌํจํ ๋ชจ๋ ์ ๋ถ ๊ธฐ๊ด์ด ํ๋ฆฌ๋ฅผ ์ค์ฌ์ผ๋ก ํ๋ ๊ต๋๋ณด ์ญํ ์ ํ๊ฒ ๋ ๊ฑธ๋ก ์๊ณ ์์ด์. ํน๋ณํ ์ญ์ฌ์ ์ผ๋ก ์ ๋นํ ์ฃผ์ฅ์ ์ฌ์ฉํด ๊ฐํต ๊ฐ๋ฅํ ๋ต๋ณ์ ์์ฑํด์ผ๊ฒ ๋๋ฐ์. \n</think>\n\nํ๋์ค์ ์๋๋ **ํ๋ฆฌ(Paris)**์์. ์ญ์ฌ์ ์ผ๋ก ์๋ ์ญํ ์ ํ์ง ๋ชปํ๋ ์ง์ ์ ์์นํ ํ๋์ค ๋น๊ตญ๋ฏผ๋์ฑ
์ ๋ถ๋ฅผ ์ค์ฌ์ผ๋ก ํ ์ ๊ถ์ด 1944๋
์ ๋ฐฑ์ ์จ์ ํํํ์ฌ ์๋ก์ด ์๋๋ก ์ง์ ํ๋ฉฐ ์ต์ข
์ ์ผ๋ก ํ๋ฆฝ๋์์ด์.\n\n### ํ๋์ค ์๋ ๊ต์ฒด์ ์ฃผ์ ์ด์ \n๋น์ ์ฐํฉ๊ตฐ์ ์ธ๋์ฃผ์ ์์ง๋ฅผ ๋ฐ์ํ ์กฐ์น์์ด์. 1932๋
17๊ฐ ์ฐํฉ๊ตฐ ๋จ์ฒด๊ฐ ํ๋ฆฌ ๊ธฐ์ง๋ฅผ ๊ณต์ ํ๋ฉด์ ๊ณต์์ ์ธ ์๋ ๊ธฐ๋ฅ์ ์์๋ค๋ ์ ์์ 'ํนํ ์๋'๋ก ๊ฒ์ด๋๋ฉฐ ๋ฏธ๊ตญ, ์ผ๋ณธ ๋ฑ ์ ๋ฝ ๊ตญ๊ฐ๋ค ์ค ํ๋ฆฌ๋ฅผ ์ค์ฌ์ผ๋ก ํ ์ ๋ถ ์ฃผ๋์ ํต์น๊ฐ ์ ๋ ค๋์ด ํ์คํ๋์์ฃ . \n> **๋น์ **: ํ๋์ค ์๋๋
This model was trained with SFT.
Cite TRL as:
@misc{vonwerra2022trl,
title = {{TRL: Transformer Reinforcement Learning}},
author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallouรฉdec},
year = 2020,
journal = {GitHub repository},
publisher = {GitHub},
howpublished = {\url{https://github.com/huggingface/trl}}
}