ronantakizawa/github-codereview
Viewer • Updated • 356k • 544 • 54
How to use ronantakizawa/codereview-qwen32b with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="ronantakizawa/codereview-qwen32b")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("ronantakizawa/codereview-qwen32b")
model = AutoModelForCausalLM.from_pretrained("ronantakizawa/codereview-qwen32b")
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]:]))How to use ronantakizawa/codereview-qwen32b with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "ronantakizawa/codereview-qwen32b"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "ronantakizawa/codereview-qwen32b",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/ronantakizawa/codereview-qwen32b
How to use ronantakizawa/codereview-qwen32b with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "ronantakizawa/codereview-qwen32b" \
--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": "ronantakizawa/codereview-qwen32b",
"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 "ronantakizawa/codereview-qwen32b" \
--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": "ronantakizawa/codereview-qwen32b",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use ronantakizawa/codereview-qwen32b with Docker Model Runner:
docker model run hf.co/ronantakizawa/codereview-qwen32b
A Qwen2.5-Coder-32B-Instruct model fine-tuned for code review.
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"ronantakizawa/codereview-qwen32b-merged",
device_map="auto",
torch_dtype="auto",
)
tokenizer = AutoTokenizer.from_pretrained("ronantakizawa/codereview-qwen32b-merged")
See the adapter model card for full training details, evaluation results, and prompt format.
| Metric | Base Model (Zero-Shot) | Fine-Tuned | Change |
|---|---|---|---|
| BLEU-4 | 3.82 | 16.91 | +343% |
| ROUGE-L F1 | 0.081 | 0.216 | +167% |
| Sentence-BERT Cosine Sim | 0.477 | 0.526 | +10% |
| Comment Type Accuracy | 0.00 | 0.640 | -- |
Base model
Qwen/Qwen2.5-32B