Instructions to use Delower/Llama4Text with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Delower/Llama4Text with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Delower/Llama4Text")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Delower/Llama4Text") model = AutoModelForCausalLM.from_pretrained("Delower/Llama4Text", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Delower/Llama4Text with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Delower/Llama4Text" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Delower/Llama4Text", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Delower/Llama4Text
- SGLang
How to use Delower/Llama4Text 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 "Delower/Llama4Text" \ --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": "Delower/Llama4Text", "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 "Delower/Llama4Text" \ --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": "Delower/Llama4Text", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Delower/Llama4Text with Docker Model Runner:
docker model run hf.co/Delower/Llama4Text
Download tokenizer.json from Delower/Llama4Text: direct link, hf CLI and curl.
- Browser
- Download file 3.3 kB
-
https://huggingface.co/Delower/Llama4Text/resolve/main/tokenizer.json
- Command line
-
hf download hf://Delower/Llama4Text/tokenizer.json
-
curl -L -o tokenizer.json https://huggingface.co/Delower/Llama4Text/resolve/main/tokenizer.json
3.3 kB
| { | |
| "version": "1.0", | |
| "truncation": null, | |
| "padding": null, | |
| "added_tokens": [ | |
| { | |
| "id": 0, | |
| "content": "[PAD]", | |
| "single_word": false, | |
| "lstrip": false, | |
| "rstrip": false, | |
| "normalized": false, | |
| "special": true | |
| }, | |
| { | |
| "id": 1, | |
| "content": "[BOS]", | |
| "single_word": false, | |
| "lstrip": false, | |
| "rstrip": false, | |
| "normalized": false, | |
| "special": true | |
| }, | |
| { | |
| "id": 2, | |
| "content": "[EOS]", | |
| "single_word": false, | |
| "lstrip": false, | |
| "rstrip": false, | |
| "normalized": false, | |
| "special": true | |
| } | |
| ], | |
| "normalizer": null, | |
| "pre_tokenizer": { | |
| "type": "ByteLevel", | |
| "add_prefix_space": false, | |
| "trim_offsets": true, | |
| "use_regex": true | |
| }, | |
| "post_processor": null, | |
| "decoder": null, | |
| "model": { | |
| "type": "BPE", | |
| "dropout": null, | |
| "unk_token": "[PAD]", | |
| "continuing_subword_prefix": null, | |
| "end_of_word_suffix": null, | |
| "fuse_unk": false, | |
| "byte_fallback": false, | |
| "ignore_merges": false, | |
| "vocab": { | |
| "[PAD]": 0, | |
| "[BOS]": 1, | |
| "[EOS]": 2, | |
| "A": 3, | |
| "B": 4, | |
| "C": 5, | |
| "D": 6, | |
| "E": 7, | |
| "F": 8, | |
| "G": 9, | |
| "H": 10, | |
| "I": 11, | |
| "K": 12, | |
| "L": 13, | |
| "M": 14, | |
| "N": 15, | |
| "O": 16, | |
| "P": 17, | |
| "Q": 18, | |
| "R": 19, | |
| "S": 20, | |
| "T": 21, | |
| "U": 22, | |
| "V": 23, | |
| "W": 24, | |
| "X": 25, | |
| "Y": 26, | |
| "[": 27, | |
| "]": 28, | |
| "Ġ": 29, | |
| "OS": 30, | |
| "][": 31, | |
| "AC": 32, | |
| "AD": 33, | |
| "BOS": 34, | |
| "DE": 35, | |
| "EOS": 36, | |
| "FG": 37, | |
| "HI": 38, | |
| "KL": 39, | |
| "MN": 40, | |
| "PQ": 41, | |
| "PAD": 42, | |
| "RS": 43, | |
| "TU": 44, | |
| "VW": 45, | |
| "XY": 46, | |
| "Ġ[": 47, | |
| "ACDE": 48, | |
| "FGHI": 49, | |
| "KLMN": 50, | |
| "PQRS": 51, | |
| "TUVW": 52, | |
| "ACDEFGHI": 53, | |
| "KLMNPQRS": 54, | |
| "TUVWXY": 55, | |
| "ACDEFGHIKLMNPQRS": 56, | |
| "ACDEFGHIKLMNPQRSTUVWXY": 57 | |
| }, | |
| "merges": [ | |
| [ | |
| "O", | |
| "S" | |
| ], | |
| [ | |
| "]", | |
| "[" | |
| ], | |
| [ | |
| "A", | |
| "C" | |
| ], | |
| [ | |
| "A", | |
| "D" | |
| ], | |
| [ | |
| "B", | |
| "OS" | |
| ], | |
| [ | |
| "D", | |
| "E" | |
| ], | |
| [ | |
| "E", | |
| "OS" | |
| ], | |
| [ | |
| "F", | |
| "G" | |
| ], | |
| [ | |
| "H", | |
| "I" | |
| ], | |
| [ | |
| "K", | |
| "L" | |
| ], | |
| [ | |
| "M", | |
| "N" | |
| ], | |
| [ | |
| "P", | |
| "Q" | |
| ], | |
| [ | |
| "P", | |
| "AD" | |
| ], | |
| [ | |
| "R", | |
| "S" | |
| ], | |
| [ | |
| "T", | |
| "U" | |
| ], | |
| [ | |
| "V", | |
| "W" | |
| ], | |
| [ | |
| "X", | |
| "Y" | |
| ], | |
| [ | |
| "Ġ", | |
| "[" | |
| ], | |
| [ | |
| "AC", | |
| "DE" | |
| ], | |
| [ | |
| "FG", | |
| "HI" | |
| ], | |
| [ | |
| "KL", | |
| "MN" | |
| ], | |
| [ | |
| "PQ", | |
| "RS" | |
| ], | |
| [ | |
| "TU", | |
| "VW" | |
| ], | |
| [ | |
| "ACDE", | |
| "FGHI" | |
| ], | |
| [ | |
| "KLMN", | |
| "PQRS" | |
| ], | |
| [ | |
| "TUVW", | |
| "XY" | |
| ], | |
| [ | |
| "ACDEFGHI", | |
| "KLMNPQRS" | |
| ], | |
| [ | |
| "ACDEFGHIKLMNPQRS", | |
| "TUVWXY" | |
| ] | |
| ] | |
| } | |
| } |