Text Generation
Transformers
Safetensors
qwen2
Generated from Trainer
trl
orpo
conversational
text-generation-inference
Instructions to use obiwit/qwen2.5-3b-orpo-mini with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use obiwit/qwen2.5-3b-orpo-mini with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="obiwit/qwen2.5-3b-orpo-mini") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("obiwit/qwen2.5-3b-orpo-mini") model = AutoModelForCausalLM.from_pretrained("obiwit/qwen2.5-3b-orpo-mini", 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 obiwit/qwen2.5-3b-orpo-mini with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "obiwit/qwen2.5-3b-orpo-mini" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "obiwit/qwen2.5-3b-orpo-mini", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/obiwit/qwen2.5-3b-orpo-mini
- SGLang
How to use obiwit/qwen2.5-3b-orpo-mini 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 "obiwit/qwen2.5-3b-orpo-mini" \ --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": "obiwit/qwen2.5-3b-orpo-mini", "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 "obiwit/qwen2.5-3b-orpo-mini" \ --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": "obiwit/qwen2.5-3b-orpo-mini", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use obiwit/qwen2.5-3b-orpo-mini with Docker Model Runner:
docker model run hf.co/obiwit/qwen2.5-3b-orpo-mini
File size: 727 Bytes
fbbdaa6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | {
"epoch": 0.9999354130336499,
"eval_log_odds_chosen": 1.242581844329834,
"eval_log_odds_ratio": -0.47447991371154785,
"eval_logits/chosen": -1.2279024124145508,
"eval_logits/rejected": -1.0133243799209595,
"eval_logps/chosen": -0.8291401863098145,
"eval_logps/rejected": -1.7743595838546753,
"eval_loss": 1.2853127717971802,
"eval_nll_loss": 1.246997594833374,
"eval_rewards/accuracies": 0.7431685924530029,
"eval_rewards/chosen": -0.0829220786690712,
"eval_rewards/margins": 0.09452750533819199,
"eval_rewards/rejected": -0.1774357259273529,
"eval_runtime": 905.5189,
"eval_samples": 54974,
"eval_samples_per_second": 60.743,
"eval_steps_per_second": 0.95
} |