Text Generation
Transformers
Safetensors
qwen2
llama-factory
full
Generated from Trainer
conversational
text-generation-inference
Instructions to use mlfoundations-dev/difficulty_sorting_easy_seed_code with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mlfoundations-dev/difficulty_sorting_easy_seed_code with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mlfoundations-dev/difficulty_sorting_easy_seed_code") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("mlfoundations-dev/difficulty_sorting_easy_seed_code") model = AutoModelForCausalLM.from_pretrained("mlfoundations-dev/difficulty_sorting_easy_seed_code") 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 mlfoundations-dev/difficulty_sorting_easy_seed_code with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mlfoundations-dev/difficulty_sorting_easy_seed_code" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mlfoundations-dev/difficulty_sorting_easy_seed_code", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mlfoundations-dev/difficulty_sorting_easy_seed_code
- SGLang
How to use mlfoundations-dev/difficulty_sorting_easy_seed_code 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 "mlfoundations-dev/difficulty_sorting_easy_seed_code" \ --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": "mlfoundations-dev/difficulty_sorting_easy_seed_code", "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 "mlfoundations-dev/difficulty_sorting_easy_seed_code" \ --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": "mlfoundations-dev/difficulty_sorting_easy_seed_code", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use mlfoundations-dev/difficulty_sorting_easy_seed_code with Docker Model Runner:
docker model run hf.co/mlfoundations-dev/difficulty_sorting_easy_seed_code
| {"current_steps": 1, "total_steps": 30, "loss": 1.1951, "lr": 3.3333333333333333e-06, "epoch": 0.09523809523809523, "percentage": 3.33, "elapsed_time": "0:00:28", "remaining_time": "0:13:53"} | |
| {"current_steps": 2, "total_steps": 30, "loss": 1.2188, "lr": 6.666666666666667e-06, "epoch": 0.19047619047619047, "percentage": 6.67, "elapsed_time": "0:00:45", "remaining_time": "0:10:43"} | |
| {"current_steps": 3, "total_steps": 30, "loss": 1.1466, "lr": 1e-05, "epoch": 0.2857142857142857, "percentage": 10.0, "elapsed_time": "0:01:05", "remaining_time": "0:09:50"} | |
| {"current_steps": 4, "total_steps": 30, "loss": 1.0925, "lr": 9.966191788709716e-06, "epoch": 0.38095238095238093, "percentage": 13.33, "elapsed_time": "0:01:25", "remaining_time": "0:09:15"} | |
| {"current_steps": 5, "total_steps": 30, "loss": 1.0697, "lr": 9.86522435289912e-06, "epoch": 0.47619047619047616, "percentage": 16.67, "elapsed_time": "0:01:45", "remaining_time": "0:08:47"} | |
| {"current_steps": 6, "total_steps": 30, "loss": 1.0761, "lr": 9.698463103929542e-06, "epoch": 0.5714285714285714, "percentage": 20.0, "elapsed_time": "0:02:05", "remaining_time": "0:08:23"} | |
| {"current_steps": 7, "total_steps": 30, "loss": 1.0359, "lr": 9.468163201617063e-06, "epoch": 0.6666666666666666, "percentage": 23.33, "elapsed_time": "0:02:23", "remaining_time": "0:07:52"} | |
| {"current_steps": 8, "total_steps": 30, "loss": 0.9778, "lr": 9.177439057064684e-06, "epoch": 0.7619047619047619, "percentage": 26.67, "elapsed_time": "0:02:41", "remaining_time": "0:07:23"} | |
| {"current_steps": 9, "total_steps": 30, "loss": 0.9634, "lr": 8.83022221559489e-06, "epoch": 0.8571428571428571, "percentage": 30.0, "elapsed_time": "0:03:01", "remaining_time": "0:07:02"} | |
| {"current_steps": 10, "total_steps": 30, "loss": 0.9079, "lr": 8.43120818934367e-06, "epoch": 0.9523809523809523, "percentage": 33.33, "elapsed_time": "0:03:19", "remaining_time": "0:06:38"} | |
| {"current_steps": 11, "total_steps": 30, "loss": 1.3387, "lr": 7.985792958513932e-06, "epoch": 1.0476190476190477, "percentage": 36.67, "elapsed_time": "0:04:25", "remaining_time": "0:07:38"} | |
| {"current_steps": 12, "total_steps": 30, "loss": 0.9057, "lr": 7.500000000000001e-06, "epoch": 1.1428571428571428, "percentage": 40.0, "elapsed_time": "0:04:44", "remaining_time": "0:07:06"} | |
| {"current_steps": 13, "total_steps": 30, "loss": 0.8104, "lr": 6.980398830195785e-06, "epoch": 1.2380952380952381, "percentage": 43.33, "elapsed_time": "0:05:00", "remaining_time": "0:06:32"} | |
| {"current_steps": 14, "total_steps": 30, "loss": 0.8269, "lr": 6.434016163555452e-06, "epoch": 1.3333333333333333, "percentage": 46.67, "elapsed_time": "0:05:15", "remaining_time": "0:06:00"} | |
| {"current_steps": 15, "total_steps": 30, "loss": 0.9437, "lr": 5.8682408883346535e-06, "epoch": 1.4285714285714286, "percentage": 50.0, "elapsed_time": "0:05:36", "remaining_time": "0:05:36"} | |
| {"current_steps": 16, "total_steps": 30, "loss": 0.8208, "lr": 5.290724144552379e-06, "epoch": 1.5238095238095237, "percentage": 53.33, "elapsed_time": "0:05:53", "remaining_time": "0:05:09"} | |
| {"current_steps": 17, "total_steps": 30, "loss": 0.8353, "lr": 4.7092758554476215e-06, "epoch": 1.619047619047619, "percentage": 56.67, "elapsed_time": "0:06:14", "remaining_time": "0:04:46"} | |
| {"current_steps": 18, "total_steps": 30, "loss": 0.8716, "lr": 4.131759111665349e-06, "epoch": 1.7142857142857144, "percentage": 60.0, "elapsed_time": "0:06:39", "remaining_time": "0:04:26"} | |
| {"current_steps": 19, "total_steps": 30, "loss": 0.7681, "lr": 3.5659838364445505e-06, "epoch": 1.8095238095238095, "percentage": 63.33, "elapsed_time": "0:06:58", "remaining_time": "0:04:02"} | |
| {"current_steps": 20, "total_steps": 30, "loss": 0.8329, "lr": 3.019601169804216e-06, "epoch": 1.9047619047619047, "percentage": 66.67, "elapsed_time": "0:07:20", "remaining_time": "0:03:40"} | |
| {"current_steps": 21, "total_steps": 30, "loss": 1.2754, "lr": 2.5000000000000015e-06, "epoch": 2.0, "percentage": 70.0, "elapsed_time": "0:07:37", "remaining_time": "0:03:16"} | |
| {"current_steps": 22, "total_steps": 30, "loss": 0.8055, "lr": 2.0142070414860704e-06, "epoch": 2.0952380952380953, "percentage": 73.33, "elapsed_time": "0:08:52", "remaining_time": "0:03:13"} | |
| {"current_steps": 23, "total_steps": 30, "loss": 0.8038, "lr": 1.5687918106563326e-06, "epoch": 2.1904761904761907, "percentage": 76.67, "elapsed_time": "0:09:10", "remaining_time": "0:02:47"} | |
| {"current_steps": 24, "total_steps": 30, "loss": 0.7889, "lr": 1.1697777844051105e-06, "epoch": 2.2857142857142856, "percentage": 80.0, "elapsed_time": "0:09:29", "remaining_time": "0:02:22"} | |
| {"current_steps": 25, "total_steps": 30, "loss": 0.8067, "lr": 8.225609429353187e-07, "epoch": 2.380952380952381, "percentage": 83.33, "elapsed_time": "0:09:46", "remaining_time": "0:01:57"} | |
| {"current_steps": 26, "total_steps": 30, "loss": 0.8279, "lr": 5.318367983829393e-07, "epoch": 2.4761904761904763, "percentage": 86.67, "elapsed_time": "0:10:06", "remaining_time": "0:01:33"} | |
| {"current_steps": 27, "total_steps": 30, "loss": 0.7699, "lr": 3.015368960704584e-07, "epoch": 2.571428571428571, "percentage": 90.0, "elapsed_time": "0:10:20", "remaining_time": "0:01:08"} | |
| {"current_steps": 28, "total_steps": 30, "loss": 0.7895, "lr": 1.3477564710088097e-07, "epoch": 2.6666666666666665, "percentage": 93.33, "elapsed_time": "0:10:42", "remaining_time": "0:00:45"} | |
| {"current_steps": 29, "total_steps": 30, "loss": 0.8391, "lr": 3.3808211290284886e-08, "epoch": 2.761904761904762, "percentage": 96.67, "elapsed_time": "0:11:01", "remaining_time": "0:00:22"} | |
| {"current_steps": 30, "total_steps": 30, "loss": 0.767, "lr": 0.0, "epoch": 2.857142857142857, "percentage": 100.0, "elapsed_time": "0:11:20", "remaining_time": "0:00:00"} | |
| {"current_steps": 30, "total_steps": 30, "epoch": 2.857142857142857, "percentage": 100.0, "elapsed_time": "0:13:04", "remaining_time": "0:00:00"} | |