Text Generation
Transformers
Safetensors
llama
llama-factory
freeze
Generated from Trainer
conversational
text-generation-inference
Instructions to use k1h0/OpenCoder-8B-Instruct-query_nsx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use k1h0/OpenCoder-8B-Instruct-query_nsx with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="k1h0/OpenCoder-8B-Instruct-query_nsx") 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_nsx") model = AutoModelForCausalLM.from_pretrained("k1h0/OpenCoder-8B-Instruct-query_nsx") 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_nsx 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_nsx" # 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_nsx", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/k1h0/OpenCoder-8B-Instruct-query_nsx
- SGLang
How to use k1h0/OpenCoder-8B-Instruct-query_nsx 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_nsx" \ --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_nsx", "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_nsx" \ --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_nsx", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use k1h0/OpenCoder-8B-Instruct-query_nsx with Docker Model Runner:
docker model run hf.co/k1h0/OpenCoder-8B-Instruct-query_nsx
| apollo_rank: 256 | |
| apollo_scale: 1 | |
| apollo_target: all | |
| apollo_update_interval: 200 | |
| bf16: true | |
| cutoff_len: 4096 | |
| dataset: codes_330k_nsx | |
| dataset_dir: data | |
| ddp_timeout: 180000000 | |
| do_train: true | |
| enable_liger_kernel: true | |
| finetuning_type: freeze | |
| flash_attn: auto | |
| freeze_trainable_layers: 2 | |
| freeze_trainable_modules: all | |
| gradient_accumulation_steps: 8 | |
| include_num_input_tokens_seen: true | |
| learning_rate: 5.0e-05 | |
| logging_steps: 1 | |
| lr_scheduler_type: cosine | |
| max_grad_norm: 1.0 | |
| max_samples: 50000000 | |
| model_name_or_path: infly/OpenCoder-8B-Instruct | |
| neat_packing: true | |
| num_train_epochs: 1.0 | |
| output_dir: saves/OpenCoder-8B-Instruct/freeze/opencoder_nsx | |
| packing: true | |
| per_device_train_batch_size: 16 | |
| plot_loss: true | |
| preprocessing_num_workers: 16 | |
| report_to: none | |
| rope_scaling: llama3 | |
| save_steps: 500 | |
| stage: sft | |
| template: opencoder | |
| trust_remote_code: true | |
| use_apollo: true | |
| use_llama_pro: true | |
| warmup_steps: 0 | |