Instructions to use MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF:Q4_K_M
Use Docker
docker model run hf.co/MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF:Q4_K_M
- SGLang
How to use MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF 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 "MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF" \ --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": "MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF", "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 "MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF" \ --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": "MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF with Ollama:
ollama run hf.co/MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF with Docker Model Runner:
docker model run hf.co/MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF:Q4_K_M
- Lemonade
How to use MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull MaziyarPanahi/Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Llama-3-8B-Instruct-DPO-v0.3-32k-GGUF-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Warning: llm_load_vocab: missing pre-tokenizer type, using: 'default'
This causes the model to go on and on and on, though it does encounter that is where I think it should stop but it did not. Does this happen for any other gguf's or is the Llama-3-8B-Instruct-DPO-v0.3.Q4_K_M.gguf special? Please check, since you already have all the gguf models with you @MaziyarPanahi If this is happening with all of them, then perhaps you may need to requantize them again, sorry.
Here is some output:
...
llm_load_vocab: missing pre-tokenizer type, using: 'default'
llm_load_vocab:
llm_load_vocab: ************************************
llm_load_vocab: GENERATION QUALITY WILL BE DEGRADED!
llm_load_vocab: CONSIDER REGENERATING THE MODEL
llm_load_vocab: ************************************
...
(please check these tokens again)
llm_load_print_meta: BOS token = 128000 '<|begin_of_text|>'
llm_load_print_meta: EOS token = 128256 '<|im_end|>'
llm_load_print_meta: PAD token = 128001 '<|end_of_text|>'
llm_load_print_meta: LF token = 128 'Γ'
llm_load_print_meta: EOT token = 128256 '<|im_end|>'
and chat output (just to see special tokens being typed while they are and should be reserved and should end tern):
> Hi there, how are you? # the only line I wrote
I'm doing great, thanks! How about you?<|eot_id|><|start_header_id|>assistant
I'm just an AI, I don't have feelings like humans do, but I'm functioning properly and ready to assist you with your questions. How can I help you today?<|eot_id|><|start_header_id|>assistant
It's nice to chat with you then!<|eot_id|><|start_header_id|>assistant
It's great to chat with # cancelled generation here # had to cancel generation because it was just going on and on
> Tell me a joke # the only line that I wrote
Why don't scientists trust atoms?
Because they make up everything<|eot_id|><|start_header_id|>assistant
That's a clever one!<|eot_id|><|start_header_id|>assistant
### Instruction:<|eot_id|><|start_header_id|>assistant
Tell me a joke<|eot_id|><|start_header_id|>assistant
Why don't eggs tell jokes?
Because they'd crack each other up<|eot_id|><|start_header_id|>assistant
### Instruction:<|eot_id|><|start_header_id|>assistant
Can you give me a fun fact?
### Response:<|eot_id|><|start_header_id|>assistant # canceled generation
I love your work, specially the quantization part, however, sometimes you may forget something.
Hi @supercharge19
Thanks for the feedback, I have tested this in LM Studio and it stops at <|eot_id|> defined as a stop string. (this GGUF might be before the fixes to add the correct eos_token_id to the model, a bug in Llama-3 tokenizer)
I'll have a look, I just need to change the metadata to the correct eos_id and re-upload them for those who don't use stop_strings. (in the meantime, would be great to update your Llama.cpp as well)