Text Generation
Transformers
Safetensors
Japanese
English
looped_gdn
gated-deltanet
linear-attention
looped-transformer
custom_code
gsm8k
conversational
Instructions to use summerMC/Looped-Qwen-gsm8k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use summerMC/Looped-Qwen-gsm8k with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="summerMC/Looped-Qwen-gsm8k", 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("summerMC/Looped-Qwen-gsm8k", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use summerMC/Looped-Qwen-gsm8k with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "summerMC/Looped-Qwen-gsm8k" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "summerMC/Looped-Qwen-gsm8k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/summerMC/Looped-Qwen-gsm8k
- SGLang
How to use summerMC/Looped-Qwen-gsm8k 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 "summerMC/Looped-Qwen-gsm8k" \ --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": "summerMC/Looped-Qwen-gsm8k", "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 "summerMC/Looped-Qwen-gsm8k" \ --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": "summerMC/Looped-Qwen-gsm8k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use summerMC/Looped-Qwen-gsm8k with Docker Model Runner:
docker model run hf.co/summerMC/Looped-Qwen-gsm8k
Looped-Qwen-gsm8k
summerMC/Looped-Qwen-pre (Looped Gated DeltaNet, 約 1B) を追加学習し、
LoRA を本体にマージした bf16 版です。読み込みには trust_remote_code=True が必要です。
評価 (GSM8K test 先頭 200 問, 答え部分の teacher-forcing loss)
| モデル | loss | ppl |
|---|---|---|
| summerMC/Looped-Qwen-pre (ベース) | 2.3437 | 10.42 |
| このモデル | 1.1382 | 3.12 |
正解率 (生成して答えを照合) ではなく、正解の答え部分に対する loss です。
使い方
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "summermc/Looped-Qwen-gsm8k"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, trust_remote_code=True, dtype=torch.bfloat16).cuda().eval()
ids = tok.apply_chat_template([{"role": "user", "content": "Janet has 16 eggs. She eats 3 and bakes with 4. How many are left?"}],
add_generation_prompt=True, return_tensors="pt", return_dict=True,
enable_thinking=False)["input_ids"].cuda()
out = model.generate(ids, max_new_tokens=256, do_sample=True, temperature=0.7, top_p=0.9, repetition_penalty=1.1)
print(tok.decode(out[0, ids.shape[1]:], skip_special_tokens=True))
pip install -U transformers flash-linear-attention 推奨。greedy 生成では同じ行を繰り返しやすいので、
repetition_penalty を付けた sampling を推奨します。
注意
- 小型モデルのため計算ミスや繰り返しが起きます。
- ライセンスは元モデル (Qwen/Qwen3.5-2B, Apache-2.0) に従います。
- 元モデル: Qwen Team / 全 GDN 化・Looped 化: summerMC, j-llm
- Downloads last month
- 247