Instructions to use ReBatch/Llama-3-8B-dutch with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ReBatch/Llama-3-8B-dutch with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ReBatch/Llama-3-8B-dutch") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ReBatch/Llama-3-8B-dutch") model = AutoModelForCausalLM.from_pretrained("ReBatch/Llama-3-8B-dutch", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ReBatch/Llama-3-8B-dutch with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ReBatch/Llama-3-8B-dutch" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ReBatch/Llama-3-8B-dutch", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ReBatch/Llama-3-8B-dutch
- SGLang
How to use ReBatch/Llama-3-8B-dutch 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 "ReBatch/Llama-3-8B-dutch" \ --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": "ReBatch/Llama-3-8B-dutch", "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 "ReBatch/Llama-3-8B-dutch" \ --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": "ReBatch/Llama-3-8B-dutch", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ReBatch/Llama-3-8B-dutch with Docker Model Runner:
docker model run hf.co/ReBatch/Llama-3-8B-dutch
Chat template during finetuning?
Hi, did you use the original Llama-3 chat template while finetuning? The template is now missing from the tokenizer config, so it defaults to ChatML. Using the model to follow an instruction by applying a chat template leads to long inference times. Does this sounds familiar?
I did not use the Llama-3 chat template, it is trained on the ChatML template.
I don't fully understand the question, applying a chat template should not lead to longer inference time per token? Unless your conversation is very long, the first token can take a bit longer.
Okey, thanks. I know, this should not be the case. However, I use an instruction to summarize (400 tokens) and I supply context (1000 tokens). On the original Llama-3 8B model inference is done within seconds. When I use the finetuned for Dutch model inference takes quite long, 30sec+. I will take another look at this later today to see if there is something different in the parameters.
That is weird, the model architecture is exactly the same. Only the weights are different.