Text Generation
Transformers
Safetensors
llama
llama-factory
freeze
Generated from Trainer
conversational
text-generation-inference
Instructions to use k1h0/OpenCoder-8B-Instruct-query_nlx_8_1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use k1h0/OpenCoder-8B-Instruct-query_nlx_8_1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="k1h0/OpenCoder-8B-Instruct-query_nlx_8_1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("k1h0/OpenCoder-8B-Instruct-query_nlx_8_1") model = AutoModelForCausalLM.from_pretrained("k1h0/OpenCoder-8B-Instruct-query_nlx_8_1") 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
- vLLM
How to use k1h0/OpenCoder-8B-Instruct-query_nlx_8_1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "k1h0/OpenCoder-8B-Instruct-query_nlx_8_1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "k1h0/OpenCoder-8B-Instruct-query_nlx_8_1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/k1h0/OpenCoder-8B-Instruct-query_nlx_8_1
- SGLang
How to use k1h0/OpenCoder-8B-Instruct-query_nlx_8_1 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 "k1h0/OpenCoder-8B-Instruct-query_nlx_8_1" \ --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": "k1h0/OpenCoder-8B-Instruct-query_nlx_8_1", "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 "k1h0/OpenCoder-8B-Instruct-query_nlx_8_1" \ --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": "k1h0/OpenCoder-8B-Instruct-query_nlx_8_1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use k1h0/OpenCoder-8B-Instruct-query_nlx_8_1 with Docker Model Runner:
docker model run hf.co/k1h0/OpenCoder-8B-Instruct-query_nlx_8_1
| { | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 0.9795918367346939, | |
| "eval_steps": 500, | |
| "global_step": 12, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.08163265306122448, | |
| "grad_norm": 0.4221615791320801, | |
| "learning_rate": 4.914814565722671e-05, | |
| "loss": 0.7698, | |
| "num_input_tokens_seen": 2097152, | |
| "step": 1 | |
| }, | |
| { | |
| "epoch": 0.16326530612244897, | |
| "grad_norm": 0.3376251757144928, | |
| "learning_rate": 4.665063509461097e-05, | |
| "loss": 0.763, | |
| "num_input_tokens_seen": 4194304, | |
| "step": 2 | |
| }, | |
| { | |
| "epoch": 0.24489795918367346, | |
| "grad_norm": 0.279402494430542, | |
| "learning_rate": 4.267766952966369e-05, | |
| "loss": 0.7896, | |
| "num_input_tokens_seen": 6291456, | |
| "step": 3 | |
| }, | |
| { | |
| "epoch": 0.32653061224489793, | |
| "grad_norm": 0.23479418456554413, | |
| "learning_rate": 3.7500000000000003e-05, | |
| "loss": 0.7557, | |
| "num_input_tokens_seen": 8388608, | |
| "step": 4 | |
| }, | |
| { | |
| "epoch": 0.40816326530612246, | |
| "grad_norm": 0.19518424570560455, | |
| "learning_rate": 3.147047612756302e-05, | |
| "loss": 0.774, | |
| "num_input_tokens_seen": 10485760, | |
| "step": 5 | |
| }, | |
| { | |
| "epoch": 0.4897959183673469, | |
| "grad_norm": 0.16670913994312286, | |
| "learning_rate": 2.5e-05, | |
| "loss": 0.7544, | |
| "num_input_tokens_seen": 12582912, | |
| "step": 6 | |
| }, | |
| { | |
| "epoch": 0.5714285714285714, | |
| "grad_norm": 0.1503278911113739, | |
| "learning_rate": 1.852952387243698e-05, | |
| "loss": 0.7293, | |
| "num_input_tokens_seen": 14680064, | |
| "step": 7 | |
| }, | |
| { | |
| "epoch": 0.6530612244897959, | |
| "grad_norm": 0.14073914289474487, | |
| "learning_rate": 1.2500000000000006e-05, | |
| "loss": 0.7233, | |
| "num_input_tokens_seen": 16777216, | |
| "step": 8 | |
| }, | |
| { | |
| "epoch": 0.7346938775510204, | |
| "grad_norm": 0.12694676220417023, | |
| "learning_rate": 7.3223304703363135e-06, | |
| "loss": 0.7142, | |
| "num_input_tokens_seen": 18874368, | |
| "step": 9 | |
| }, | |
| { | |
| "epoch": 0.8163265306122449, | |
| "grad_norm": 0.12071245908737183, | |
| "learning_rate": 3.3493649053890326e-06, | |
| "loss": 0.7328, | |
| "num_input_tokens_seen": 20971520, | |
| "step": 10 | |
| }, | |
| { | |
| "epoch": 0.8979591836734694, | |
| "grad_norm": 0.1263800412416458, | |
| "learning_rate": 8.51854342773295e-07, | |
| "loss": 0.728, | |
| "num_input_tokens_seen": 23068672, | |
| "step": 11 | |
| }, | |
| { | |
| "epoch": 0.9795918367346939, | |
| "grad_norm": 0.12260100245475769, | |
| "learning_rate": 0.0, | |
| "loss": 0.7408, | |
| "num_input_tokens_seen": 25165824, | |
| "step": 12 | |
| }, | |
| { | |
| "epoch": 0.9795918367346939, | |
| "num_input_tokens_seen": 25165824, | |
| "step": 12, | |
| "total_flos": 1.11365196578449e+18, | |
| "train_loss": 0.7478910734256109, | |
| "train_runtime": 1288.5834, | |
| "train_samples_per_second": 4.858, | |
| "train_steps_per_second": 0.009 | |
| } | |
| ], | |
| "logging_steps": 1.0, | |
| "max_steps": 12, | |
| "num_input_tokens_seen": 25165824, | |
| "num_train_epochs": 1, | |
| "save_steps": 500, | |
| "stateful_callbacks": { | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": true, | |
| "should_training_stop": true | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 1.11365196578449e+18, | |
| "train_batch_size": 16, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |