Text Generation
Transformers
TensorBoard
Safetensors
English
internlm2
feature-extraction
math
conversational
custom_code
Instructions to use MathGenie/InternLM2-SFT-SCDPO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MathGenie/InternLM2-SFT-SCDPO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MathGenie/InternLM2-SFT-SCDPO", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("MathGenie/InternLM2-SFT-SCDPO", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MathGenie/InternLM2-SFT-SCDPO with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MathGenie/InternLM2-SFT-SCDPO" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MathGenie/InternLM2-SFT-SCDPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MathGenie/InternLM2-SFT-SCDPO
- SGLang
How to use MathGenie/InternLM2-SFT-SCDPO 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 "MathGenie/InternLM2-SFT-SCDPO" \ --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": "MathGenie/InternLM2-SFT-SCDPO", "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 "MathGenie/InternLM2-SFT-SCDPO" \ --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": "MathGenie/InternLM2-SFT-SCDPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use MathGenie/InternLM2-SFT-SCDPO with Docker Model Runner:
docker model run hf.co/MathGenie/InternLM2-SFT-SCDPO
| { | |
| "epoch": 2.0, | |
| "eval_logits/chosen": -2.4878430366516113, | |
| "eval_logits/rejected": -2.303501605987549, | |
| "eval_logps/chosen": -92.59371185302734, | |
| "eval_logps/rejected": -155.12913513183594, | |
| "eval_loss": 0.2571355104446411, | |
| "eval_rewards/accuracies": 0.8928571343421936, | |
| "eval_rewards/chosen": 0.7362550497055054, | |
| "eval_rewards/margins": 3.712023973464966, | |
| "eval_rewards/rejected": -2.975768804550171, | |
| "eval_runtime": 71.4209, | |
| "eval_samples": 890, | |
| "eval_samples_per_second": 12.461, | |
| "eval_steps_per_second": 0.196, | |
| "train_loss": 0.2711078498627443, | |
| "train_runtime": 49070.973, | |
| "train_samples": 88135, | |
| "train_samples_per_second": 3.592, | |
| "train_steps_per_second": 0.112 | |
| } |