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 ·
7de10d4
1
Parent(s): 11421e6
move up inference guide
Browse files
README.md
CHANGED
|
@@ -22,6 +22,12 @@ Available models:
|
|
| 22 |
- [fLlama-7B](https://huggingface.co/Trelis/Llama-2-7b-chat-hf-function-calling)
|
| 23 |
- [fLlama-13](https://huggingface.co/Trelis/Llama-2-13b-chat-hf-function-calling)
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
## Licensing and Usage
|
| 26 |
|
| 27 |
### Non-commercial Use
|
|
@@ -54,12 +60,6 @@ Model weights are provided as-is, without warranty, and with the same disclaimer
|
|
| 54 |
|
| 55 |
The dataset used for training this model can be found at [Trelis Function Calling Extended Dataset](https://huggingface.co/datasets/Trelis/function_calling_extended).
|
| 56 |
|
| 57 |
-
## Inference with Google Colab and HuggingFace 🤗
|
| 58 |
-
|
| 59 |
-
Get started by saving your own copy of this [fLlama_Inference notebook](https://colab.research.google.com/drive/1Ow5cQ0JNv-vXsT-apCceH6Na3b4L7JyW?usp=sharing).
|
| 60 |
-
|
| 61 |
-
You will be able to run inference using a free Colab notebook if you select a gpu runtime. See the notebook for more details.
|
| 62 |
-
|
| 63 |
## Prompt and Response Format
|
| 64 |
|
| 65 |
To make a function call, you should format your input like this:
|
|
|
|
| 22 |
- [fLlama-7B](https://huggingface.co/Trelis/Llama-2-7b-chat-hf-function-calling)
|
| 23 |
- [fLlama-13](https://huggingface.co/Trelis/Llama-2-13b-chat-hf-function-calling)
|
| 24 |
|
| 25 |
+
## Inference with Google Colab and HuggingFace 🤗
|
| 26 |
+
|
| 27 |
+
Get started by saving your own copy of this [fLlama_Inference notebook](https://colab.research.google.com/drive/1Ow5cQ0JNv-vXsT-apCceH6Na3b4L7JyW?usp=sharing).
|
| 28 |
+
|
| 29 |
+
You will be able to run inference using a free Colab notebook if you select a gpu runtime. See the notebook for more details.
|
| 30 |
+
|
| 31 |
## Licensing and Usage
|
| 32 |
|
| 33 |
### Non-commercial Use
|
|
|
|
| 60 |
|
| 61 |
The dataset used for training this model can be found at [Trelis Function Calling Extended Dataset](https://huggingface.co/datasets/Trelis/function_calling_extended).
|
| 62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
## Prompt and Response Format
|
| 64 |
|
| 65 |
To make a function call, you should format your input like this:
|