google-research-datasets/mbpp
Viewer • Updated • 1.4k • 191k • 230
How to use aiyun123/Qwen2.5-Coder-0.5B-Instruct with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="aiyun123/Qwen2.5-Coder-0.5B-Instruct") # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("aiyun123/Qwen2.5-Coder-0.5B-Instruct", dtype="auto")How to use aiyun123/Qwen2.5-Coder-0.5B-Instruct with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "aiyun123/Qwen2.5-Coder-0.5B-Instruct"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "aiyun123/Qwen2.5-Coder-0.5B-Instruct",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/aiyun123/Qwen2.5-Coder-0.5B-Instruct
How to use aiyun123/Qwen2.5-Coder-0.5B-Instruct with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "aiyun123/Qwen2.5-Coder-0.5B-Instruct" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "aiyun123/Qwen2.5-Coder-0.5B-Instruct",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "aiyun123/Qwen2.5-Coder-0.5B-Instruct" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "aiyun123/Qwen2.5-Coder-0.5B-Instruct",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use aiyun123/Qwen2.5-Coder-0.5B-Instruct with Docker Model Runner:
docker model run hf.co/aiyun123/Qwen2.5-Coder-0.5B-Instruct
此仓库用于记录在 Gensyn Testnet 的 RL Swarm 代码生成任务中的参与与权重版本。基础模型为 Qwen/Qwen2.5-Coder-0.5B-Instruct。
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "aiyun123/Qwen2.5-Coder-0.5B-Instruct"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto" # 自动选择设备;在 Mac 可走 MPS
)
prompt = "Write a Python function to check if a number is prime."
inputs = tok(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=256)
print(tok.decode(outputs[0], skip_special_tokens=True))
PYTORCH_ENABLE_MPS_FALLBACK=1,必要时设置 PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.0torch.float16 或启用 device_map="auto"swarm-YYYY-MM-DD(每日/每轮次版本号;后续推送时更新)与上游基础模型许可一致;请参见 Qwen2.5 的官方许可说明与链接。
Base model
Qwen/Qwen2.5-0.5B