Text Generation
Transformers
Safetensors
GGUF
PyTorch
English
llama
facebook
meta
llama-2
functions
function calling
sharded
text-generation-inference
Instructions to use Trelis/Llama-2-7b-chat-hf-function-calling-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Trelis/Llama-2-7b-chat-hf-function-calling-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Trelis/Llama-2-7b-chat-hf-function-calling-v2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Trelis/Llama-2-7b-chat-hf-function-calling-v2") model = AutoModelForCausalLM.from_pretrained("Trelis/Llama-2-7b-chat-hf-function-calling-v2") - llama-cpp-python
How to use Trelis/Llama-2-7b-chat-hf-function-calling-v2 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Trelis/Llama-2-7b-chat-hf-function-calling-v2", filename="ggml-vocab-llama.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use Trelis/Llama-2-7b-chat-hf-function-calling-v2 with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Trelis/Llama-2-7b-chat-hf-function-calling-v2:Q3_K_M # Run inference directly in the terminal: llama-cli -hf Trelis/Llama-2-7b-chat-hf-function-calling-v2:Q3_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Trelis/Llama-2-7b-chat-hf-function-calling-v2:Q3_K_M # Run inference directly in the terminal: llama-cli -hf Trelis/Llama-2-7b-chat-hf-function-calling-v2:Q3_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 Trelis/Llama-2-7b-chat-hf-function-calling-v2:Q3_K_M # Run inference directly in the terminal: ./llama-cli -hf Trelis/Llama-2-7b-chat-hf-function-calling-v2:Q3_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 Trelis/Llama-2-7b-chat-hf-function-calling-v2:Q3_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Trelis/Llama-2-7b-chat-hf-function-calling-v2:Q3_K_M
Use Docker
docker model run hf.co/Trelis/Llama-2-7b-chat-hf-function-calling-v2:Q3_K_M
- LM Studio
- Jan
- vLLM
How to use Trelis/Llama-2-7b-chat-hf-function-calling-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Trelis/Llama-2-7b-chat-hf-function-calling-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Trelis/Llama-2-7b-chat-hf-function-calling-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Trelis/Llama-2-7b-chat-hf-function-calling-v2:Q3_K_M
- SGLang
How to use Trelis/Llama-2-7b-chat-hf-function-calling-v2 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 "Trelis/Llama-2-7b-chat-hf-function-calling-v2" \ --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": "Trelis/Llama-2-7b-chat-hf-function-calling-v2", "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 "Trelis/Llama-2-7b-chat-hf-function-calling-v2" \ --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": "Trelis/Llama-2-7b-chat-hf-function-calling-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use Trelis/Llama-2-7b-chat-hf-function-calling-v2 with Ollama:
ollama run hf.co/Trelis/Llama-2-7b-chat-hf-function-calling-v2:Q3_K_M
- Unsloth Studio new
How to use Trelis/Llama-2-7b-chat-hf-function-calling-v2 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Trelis/Llama-2-7b-chat-hf-function-calling-v2 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Trelis/Llama-2-7b-chat-hf-function-calling-v2 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Trelis/Llama-2-7b-chat-hf-function-calling-v2 to start chatting
- Docker Model Runner
How to use Trelis/Llama-2-7b-chat-hf-function-calling-v2 with Docker Model Runner:
docker model run hf.co/Trelis/Llama-2-7b-chat-hf-function-calling-v2:Q3_K_M
- Lemonade
How to use Trelis/Llama-2-7b-chat-hf-function-calling-v2 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Trelis/Llama-2-7b-chat-hf-function-calling-v2:Q3_K_M
Run and chat with the model
lemonade run user.Llama-2-7b-chat-hf-function-calling-v2-Q3_K_M
List all available models
lemonade list
Commit ·
d06f7b2
1
Parent(s): 02c8b65
Upload tokenizer
Browse files- special_tokens_map.json +3 -21
- tokenizer_config.json +31 -24
special_tokens_map.json
CHANGED
|
@@ -1,23 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"bos_token":
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
"normalized": false,
|
| 6 |
-
"rstrip": false,
|
| 7 |
-
"single_word": false
|
| 8 |
-
},
|
| 9 |
-
"eos_token": {
|
| 10 |
-
"content": "</s>",
|
| 11 |
-
"lstrip": false,
|
| 12 |
-
"normalized": false,
|
| 13 |
-
"rstrip": false,
|
| 14 |
-
"single_word": false
|
| 15 |
-
},
|
| 16 |
-
"unk_token": {
|
| 17 |
-
"content": "<unk>",
|
| 18 |
-
"lstrip": false,
|
| 19 |
-
"normalized": false,
|
| 20 |
-
"rstrip": false,
|
| 21 |
-
"single_word": false
|
| 22 |
-
}
|
| 23 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"bos_token": "<s>",
|
| 3 |
+
"eos_token": "</s>",
|
| 4 |
+
"unk_token": "<unk>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
}
|
tokenizer_config.json
CHANGED
|
@@ -1,33 +1,40 @@
|
|
| 1 |
{
|
| 2 |
-
"
|
| 3 |
-
"
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
},
|
|
|
|
|
|
|
| 10 |
"clean_up_tokenization_spaces": false,
|
| 11 |
-
"eos_token":
|
| 12 |
-
"__type": "AddedToken",
|
| 13 |
-
"content": "</s>",
|
| 14 |
-
"lstrip": false,
|
| 15 |
-
"normalized": false,
|
| 16 |
-
"rstrip": false,
|
| 17 |
-
"single_word": false
|
| 18 |
-
},
|
| 19 |
"legacy": false,
|
| 20 |
"model_max_length": 1000000000000000019884624838656,
|
| 21 |
"pad_token": null,
|
|
|
|
| 22 |
"sp_model_kwargs": {},
|
| 23 |
"tokenizer_class": "LlamaTokenizer",
|
| 24 |
-
"unk_token":
|
| 25 |
-
|
| 26 |
-
"content": "<unk>",
|
| 27 |
-
"lstrip": false,
|
| 28 |
-
"normalized": false,
|
| 29 |
-
"rstrip": false,
|
| 30 |
-
"single_word": false
|
| 31 |
-
},
|
| 32 |
-
"use_fast": false
|
| 33 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"added_tokens_decoder": {
|
| 3 |
+
"0": {
|
| 4 |
+
"content": "<unk>",
|
| 5 |
+
"lstrip": false,
|
| 6 |
+
"normalized": false,
|
| 7 |
+
"rstrip": false,
|
| 8 |
+
"single_word": false,
|
| 9 |
+
"special": true
|
| 10 |
+
},
|
| 11 |
+
"1": {
|
| 12 |
+
"content": "<s>",
|
| 13 |
+
"lstrip": false,
|
| 14 |
+
"normalized": false,
|
| 15 |
+
"rstrip": false,
|
| 16 |
+
"single_word": false,
|
| 17 |
+
"special": true
|
| 18 |
+
},
|
| 19 |
+
"2": {
|
| 20 |
+
"content": "</s>",
|
| 21 |
+
"lstrip": false,
|
| 22 |
+
"normalized": false,
|
| 23 |
+
"rstrip": false,
|
| 24 |
+
"single_word": false,
|
| 25 |
+
"special": true
|
| 26 |
+
}
|
| 27 |
},
|
| 28 |
+
"additional_special_tokens": [],
|
| 29 |
+
"bos_token": "<s>",
|
| 30 |
"clean_up_tokenization_spaces": false,
|
| 31 |
+
"eos_token": "</s>",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
"legacy": false,
|
| 33 |
"model_max_length": 1000000000000000019884624838656,
|
| 34 |
"pad_token": null,
|
| 35 |
+
"padding_side": "right",
|
| 36 |
"sp_model_kwargs": {},
|
| 37 |
"tokenizer_class": "LlamaTokenizer",
|
| 38 |
+
"unk_token": "<unk>",
|
| 39 |
+
"use_default_system_prompt": true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
}
|