Text Generation
Transformers
Safetensors
English
qwen2
logical-reasoning
sft
qwen2.5
conversational
text-generation-inference
Instructions to use NhatCuong22/qwen2.5-7b-proofdag-sft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NhatCuong22/qwen2.5-7b-proofdag-sft with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NhatCuong22/qwen2.5-7b-proofdag-sft") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("NhatCuong22/qwen2.5-7b-proofdag-sft") model = AutoModelForCausalLM.from_pretrained("NhatCuong22/qwen2.5-7b-proofdag-sft") 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
- vLLM
How to use NhatCuong22/qwen2.5-7b-proofdag-sft with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NhatCuong22/qwen2.5-7b-proofdag-sft" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NhatCuong22/qwen2.5-7b-proofdag-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/NhatCuong22/qwen2.5-7b-proofdag-sft
- SGLang
How to use NhatCuong22/qwen2.5-7b-proofdag-sft 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 "NhatCuong22/qwen2.5-7b-proofdag-sft" \ --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": "NhatCuong22/qwen2.5-7b-proofdag-sft", "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 "NhatCuong22/qwen2.5-7b-proofdag-sft" \ --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": "NhatCuong22/qwen2.5-7b-proofdag-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use NhatCuong22/qwen2.5-7b-proofdag-sft with Docker Model Runner:
docker model run hf.co/NhatCuong22/qwen2.5-7b-proofdag-sft
Qwen2.5-7B-Instruct — ProofDAG SFT
Full fine-tune của Qwen/Qwen2.5-7B-Instruct trên dataset ProofDAG (True / False / Uncertain).
Training
| Data | 5640 train / 330 val (multi-turn chat) |
| Hardware | 8× L40 (FSDP FULL_SHARD, bf16) |
| Global batch | 128, max_len 4096 |
| LR | 1e-6 cosine, warmup 0.03 |
| Epochs | 3 (132 steps, 6h 48m) |
| Final train / eval loss | 0.207 / 0.251 |
Quick start
from transformers import AutoTokenizer, AutoModelForCausalLM
mid = "NhatCuong22/qwen2.5-7b-proofdag-sft"
tok = AutoTokenizer.from_pretrained(mid)
model = AutoModelForCausalLM.from_pretrained(mid, torch_dtype="bfloat16", device_map="auto")
messages = [
{"role": "system", "content": "You are a helpful AI assistant."},
{"role": "user", "content": "Premises:\n1. If it rains, the ground is wet.\n2. It rains.\n\nProposed conclusion: The ground is wet."},
]
prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
out = model.generate(**tok(prompt, return_tensors="pt").to(model.device), max_new_tokens=512)
print(tok.decode(out[0], skip_special_tokens=True))
License: Apache-2.0
- Downloads last month
- 82