Text Generation
Transformers
PyTorch
English
llama
facebook
meta
llama-2
functions
function calling
sharded
ggml
gptq
text-generation-inference
Instructions to use Trelis/Llama-2-7b-chat-hf-function-calling 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 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")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Trelis/Llama-2-7b-chat-hf-function-calling") model = AutoModelForCausalLM.from_pretrained("Trelis/Llama-2-7b-chat-hf-function-calling", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Trelis/Llama-2-7b-chat-hf-function-calling 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" # 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", "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
- SGLang
How to use Trelis/Llama-2-7b-chat-hf-function-calling 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" \ --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", "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" \ --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", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Trelis/Llama-2-7b-chat-hf-function-calling with Docker Model Runner:
docker model run hf.co/Trelis/Llama-2-7b-chat-hf-function-calling
Commit ·
57a6493
1
Parent(s): 9c75415
v2 is live
Browse files
README.md
CHANGED
|
@@ -15,6 +15,12 @@ tags:
|
|
| 15 |
- ggml
|
| 16 |
- gptq
|
| 17 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
# fLlama 2 - Function Calling Llama 2
|
| 19 |
|
| 20 |
- fLlama 2 extends the hugging face Llama 2 models with function calling capabilities.
|
|
|
|
| 15 |
- ggml
|
| 16 |
- gptq
|
| 17 |
---
|
| 18 |
+
# ** v2 is now live **
|
| 19 |
+
|
| 20 |
+
LLama 2 with function calling (version 2) has been released and is available [here](https://huggingface.co/Trelis/Llama-2-7b-chat-hf-function-calling-v2).
|
| 21 |
+
|
| 22 |
+
~~~
|
| 23 |
+
|
| 24 |
# fLlama 2 - Function Calling Llama 2
|
| 25 |
|
| 26 |
- fLlama 2 extends the hugging face Llama 2 models with function calling capabilities.
|