Instructions to use khtsly/Nalu-2.0-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use khtsly/Nalu-2.0-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="khtsly/Nalu-2.0-Base", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("khtsly/Nalu-2.0-Base", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use khtsly/Nalu-2.0-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "khtsly/Nalu-2.0-Base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "khtsly/Nalu-2.0-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/khtsly/Nalu-2.0-Base
- SGLang
How to use khtsly/Nalu-2.0-Base 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 "khtsly/Nalu-2.0-Base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "khtsly/Nalu-2.0-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "khtsly/Nalu-2.0-Base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "khtsly/Nalu-2.0-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use khtsly/Nalu-2.0-Base with Docker Model Runner:
docker model run hf.co/khtsly/Nalu-2.0-Base
Download encoding.json from khtsly/Nalu-2.0-Base: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/khtsly/Nalu-2.0-Base/resolve/main/encoding.json
- Command line
-
hf download hf://khtsly/Nalu-2.0-Base/encoding.json
-
curl -L -o encoding.json https://huggingface.co/khtsly/Nalu-2.0-Base/resolve/main/encoding.json
1.01 kB
| { | |
| "name": "luau-coder", | |
| "pat_str": "(?<=\\p{L})['\\u2019](?i:s|t|re|ve|m|ll|d)(?![\\p{L}\\p{N}])|[ ]?[\\p{L}\\p{M}_][\\p{L}\\p{M}\\p{N}_]*| ?\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}_]+|[ \\t]*[\\r\\n]+[ \\t]*|\\s+(?!\\S)|\\s+", | |
| "tiktoken_file": "tiktoken.model", | |
| "special_tokens": { | |
| "<|endoftext|>": 32744, | |
| "<|pad|>": 32745, | |
| "<|bos|>": 32746, | |
| "<|fim_prefix|>": 32747, | |
| "<|fim_middle|>": 32748, | |
| "<|fim_suffix|>": 32749, | |
| "<|fim_pad|>": 32750, | |
| "<|im_start|>": 32751, | |
| "<|im_end|>": 32752, | |
| "<|think|>": 32753, | |
| "<|/think|>": 32754, | |
| "<|tool_call|>": 32755, | |
| "<|/tool_call|>": 32756, | |
| "<|tool_response|>": 32757, | |
| "<|/tool_response|>": 32758, | |
| "<|repo_name|>": 32759, | |
| "<|file_sep|>": 32760, | |
| "<|file_path|>": 32761, | |
| "<|code_start|>": 32762, | |
| "<|code_end|>": 32763, | |
| "<|reserved_20|>": 32764, | |
| "<|reserved_21|>": 32765, | |
| "<|reserved_22|>": 32766, | |
| "<|reserved_23|>": 32767 | |
| }, | |
| "vocab_size": 32768 | |
| } | |