Text Generation
Transformers
Safetensors
English
code
qwen2
Generated from Trainer
dpo
trl
preference-optimization
python
type-hints
qwen2.5-coder
mypo
hf_jobs
codecarbon
carbon-emissions
conversational
Eval Results (legacy)
text-generation-inference
Instructions to use joshuasundance/mypo-qwen2.5-coder-1.5b-dpo-v3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use joshuasundance/mypo-qwen2.5-coder-1.5b-dpo-v3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="joshuasundance/mypo-qwen2.5-coder-1.5b-dpo-v3") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("joshuasundance/mypo-qwen2.5-coder-1.5b-dpo-v3") model = AutoModelForCausalLM.from_pretrained("joshuasundance/mypo-qwen2.5-coder-1.5b-dpo-v3", device_map="auto") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use joshuasundance/mypo-qwen2.5-coder-1.5b-dpo-v3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "joshuasundance/mypo-qwen2.5-coder-1.5b-dpo-v3" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "joshuasundance/mypo-qwen2.5-coder-1.5b-dpo-v3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/joshuasundance/mypo-qwen2.5-coder-1.5b-dpo-v3
- SGLang
How to use joshuasundance/mypo-qwen2.5-coder-1.5b-dpo-v3 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 "joshuasundance/mypo-qwen2.5-coder-1.5b-dpo-v3" \ --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": "joshuasundance/mypo-qwen2.5-coder-1.5b-dpo-v3", "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 "joshuasundance/mypo-qwen2.5-coder-1.5b-dpo-v3" \ --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": "joshuasundance/mypo-qwen2.5-coder-1.5b-dpo-v3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use joshuasundance/mypo-qwen2.5-coder-1.5b-dpo-v3 with Docker Model Runner:
docker model run hf.co/joshuasundance/mypo-qwen2.5-coder-1.5b-dpo-v3
| timestamp,project_name,run_id,experiment_id,duration,emissions,emissions_rate,cpu_power,gpu_power,ram_power,cpu_energy,gpu_energy,ram_energy,energy_consumed,water_consumed,country_name,country_iso_code,region,cloud_provider,cloud_region,os,python_version,codecarbon_version,cpu_count,cpu_model,gpu_count,gpu_model,longitude,latitude,ram_total_size,tracking_mode,cpu_utilization_percent,gpu_utilization_percent,ram_utilization_percent,ram_used_gb,on_cloud,pue,wue | |
| 2026-04-22T22:26:33,codecarbon,ba950a38-b3a3-46b2-9911-7183a9df1633,5b0fa12a-3dd7-45bb-9766-cc326314d9f1,6005.371236527004,0.13411510475644237,2.2332525246849374e-05,21.40210806247722,144.90591554415892,54.0,0.03448764703697292,0.24181496956293191,0.08702064124127941,0.3633232578411839,0.0,United States,USA,virginia,,,Linux-6.12.79-101.147.amzn2023.x86_64-x86_64-with-glibc2.36,3.12.12,3.2.6,48,AMD EPYC 7R32,1,1 x NVIDIA A10G,-77.4903,39.0469,186.68793869018555,machine,3.375802139037433,43.505848930481285,7.6515207219251336,14.27656325936955,N,1.0,0.0 | |