Instructions to use elyza/ELYZA-Shortcut-1.0-Qwen-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use elyza/ELYZA-Shortcut-1.0-Qwen-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="elyza/ELYZA-Shortcut-1.0-Qwen-7B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("elyza/ELYZA-Shortcut-1.0-Qwen-7B") model = AutoModelForCausalLM.from_pretrained("elyza/ELYZA-Shortcut-1.0-Qwen-7B") 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 Settings
- vLLM
How to use elyza/ELYZA-Shortcut-1.0-Qwen-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "elyza/ELYZA-Shortcut-1.0-Qwen-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "elyza/ELYZA-Shortcut-1.0-Qwen-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/elyza/ELYZA-Shortcut-1.0-Qwen-7B
- SGLang
How to use elyza/ELYZA-Shortcut-1.0-Qwen-7B 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 "elyza/ELYZA-Shortcut-1.0-Qwen-7B" \ --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": "elyza/ELYZA-Shortcut-1.0-Qwen-7B", "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 "elyza/ELYZA-Shortcut-1.0-Qwen-7B" \ --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": "elyza/ELYZA-Shortcut-1.0-Qwen-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use elyza/ELYZA-Shortcut-1.0-Qwen-7B with Docker Model Runner:
docker model run hf.co/elyza/ELYZA-Shortcut-1.0-Qwen-7B
ELYZA-Shortcut-1.0-Qwen-7B
Model Description
ELYZA-Shortcut-1.0-Qwen-7B is a non-reasoning model derived during the development of the reasoning model ELYZA-Thinking-1.0-Qwen-32B. Based on Qwen/Qwen2.5-7B-Instruct, this model has been post-trained to bypass the step-by-step reasoning process and directly generate the final answer (Built with Qwen).
During the post-training phase, the model was trained via supervised fine-tuning (SFT) using problem-solution pairs. These pairs were obtained by removing reasoning steps from optimal reasoning paths explored through an Monte Carlo Tree Search (MCTS) based algorithm. For more details, please refer to our blog post.
Usage
You can use the model with the Hugging Face Transformers library. The following code is an example of how to use the model for inference.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "elyza/ELYZA-Shortcut-1.0-Qwen-7B"
prompt = "仕事の熱意を取り戻すためのアイデアを5つ挙げてください。"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto",
)
model.eval()
messages = [{"role": "user", "content": prompt}]
input_text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
token_ids = tokenizer.encode(
input_text, add_special_tokens=False, return_tensors="pt"
)
with torch.no_grad():
output_ids = model.generate(
token_ids.to(model.device),
max_new_tokens=8192,
do_sample=True,
temperature=0.6,
top_p=0.95,
)
output = tokenizer.decode(
output_ids.tolist()[0][token_ids.size(1):], skip_special_tokens=True
)
print(output)
For deployment, vLLM is recommended to create an OpenAI-Compatible Server.
vllm serve elyza/ELYZA-Shortcut-1.0-Qwen-7B \
--max-model-len 32768
How to Cite
@misc{elyza2025thinking,
title={elyza/ELYZA-Thinking-1.0-Qwen-32B},
url={https://huggingface.co/elyza/ELYZA-Thinking-1.0-Qwen-32B},
author={Masato Hirakawa and Tomoaki Nakamura and Akira Sasaki and Daisuke Oba and Shoetsu Sato},
year={2025},
}
Citations
@misc{qwen2.5,
title = {Qwen2.5: A Party of Foundation Models},
url = {https://qwenlm.github.io/blog/qwen2.5/},
author = {Qwen Team},
month = {September},
year = {2024}
}
@article{qwen2,
title={Qwen2 Technical Report},
author={An Yang and Baosong Yang and Binyuan Hui and Bo Zheng and Bowen Yu and Chang Zhou and Chengpeng Li and Chengyuan Li and Dayiheng Liu and Fei Huang and Guanting Dong and Haoran Wei and Huan Lin and Jialong Tang and Jialin Wang and Jian Yang and Jianhong Tu and Jianwei Zhang and Jianxin Ma and Jin Xu and Jingren Zhou and Jinze Bai and Jinzheng He and Junyang Lin and Kai Dang and Keming Lu and Keqin Chen and Kexin Yang and Mei Li and Mingfeng Xue and Na Ni and Pei Zhang and Peng Wang and Ru Peng and Rui Men and Ruize Gao and Runji Lin and Shijie Wang and Shuai Bai and Sinan Tan and Tianhang Zhu and Tianhao Li and Tianyu Liu and Wenbin Ge and Xiaodong Deng and Xiaohuan Zhou and Xingzhang Ren and Xinyu Zhang and Xipin Wei and Xuancheng Ren and Yang Fan and Yang Yao and Yichang Zhang and Yu Wan and Yunfei Chu and Yuqiong Liu and Zeyu Cui and Zhenru Zhang and Zhihao Fan},
journal={arXiv preprint arXiv:2407.10671},
year={2024}
}
- Downloads last month
- 1,576
