Instructions to use astronomer/Llama-3-8B-Special-Tokens-Adjusted with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use astronomer/Llama-3-8B-Special-Tokens-Adjusted with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="astronomer/Llama-3-8B-Special-Tokens-Adjusted")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("astronomer/Llama-3-8B-Special-Tokens-Adjusted") model = AutoModelForCausalLM.from_pretrained("astronomer/Llama-3-8B-Special-Tokens-Adjusted", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use astronomer/Llama-3-8B-Special-Tokens-Adjusted with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "astronomer/Llama-3-8B-Special-Tokens-Adjusted" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "astronomer/Llama-3-8B-Special-Tokens-Adjusted", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/astronomer/Llama-3-8B-Special-Tokens-Adjusted
- SGLang
How to use astronomer/Llama-3-8B-Special-Tokens-Adjusted 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 "astronomer/Llama-3-8B-Special-Tokens-Adjusted" \ --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": "astronomer/Llama-3-8B-Special-Tokens-Adjusted", "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 "astronomer/Llama-3-8B-Special-Tokens-Adjusted" \ --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": "astronomer/Llama-3-8B-Special-Tokens-Adjusted", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use astronomer/Llama-3-8B-Special-Tokens-Adjusted with Docker Model Runner:
docker model run hf.co/astronomer/Llama-3-8B-Special-Tokens-Adjusted
Changing Reserve token names
Question on the reserve tokens. Is there any impact to changing the value name of the tokens? For instance, if we wanted to use certain reserve tokens for classification purposes and didn't want to create vague token references in our prompts?
For example,
"128010": {
"content": "<|reserved_special_token_5|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
to
"128010": {
"content": "<|new_label_5_reference|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
I think in theory this is ok. But just know that the embedding value of that token id was not pretrained on whatever you are working on, so it probably has either no semantic meaning or has incorrect semantic meaning from pretraining.