Instructions to use mdavidson83/Meta-Llama-3.1-8B-Instruct-Function-Calling with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mdavidson83/Meta-Llama-3.1-8B-Instruct-Function-Calling with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mdavidson83/Meta-Llama-3.1-8B-Instruct-Function-Calling") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("mdavidson83/Meta-Llama-3.1-8B-Instruct-Function-Calling") model = AutoModelForCausalLM.from_pretrained("mdavidson83/Meta-Llama-3.1-8B-Instruct-Function-Calling") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mdavidson83/Meta-Llama-3.1-8B-Instruct-Function-Calling with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mdavidson83/Meta-Llama-3.1-8B-Instruct-Function-Calling" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mdavidson83/Meta-Llama-3.1-8B-Instruct-Function-Calling", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mdavidson83/Meta-Llama-3.1-8B-Instruct-Function-Calling
- SGLang
How to use mdavidson83/Meta-Llama-3.1-8B-Instruct-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 "mdavidson83/Meta-Llama-3.1-8B-Instruct-Function-Calling" \ --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": "mdavidson83/Meta-Llama-3.1-8B-Instruct-Function-Calling", "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 "mdavidson83/Meta-Llama-3.1-8B-Instruct-Function-Calling" \ --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": "mdavidson83/Meta-Llama-3.1-8B-Instruct-Function-Calling", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use mdavidson83/Meta-Llama-3.1-8B-Instruct-Function-Calling with Docker Model Runner:
docker model run hf.co/mdavidson83/Meta-Llama-3.1-8B-Instruct-Function-Calling
Upload LlamaForCausalLM
Browse files- config.json +2 -1
- generation_config.json +1 -1
- model-00001-of-00004.safetensors +1 -1
- model-00002-of-00004.safetensors +1 -1
- model-00003-of-00004.safetensors +1 -1
- model-00004-of-00004.safetensors +1 -1
config.json
CHANGED
|
@@ -7,6 +7,7 @@
|
|
| 7 |
"attention_dropout": 0.0,
|
| 8 |
"bos_token_id": 128256,
|
| 9 |
"eos_token_id": 128257,
|
|
|
|
| 10 |
"hidden_act": "silu",
|
| 11 |
"hidden_size": 4096,
|
| 12 |
"initializer_range": 0.02,
|
|
@@ -30,7 +31,7 @@
|
|
| 30 |
"rope_theta": 500000.0,
|
| 31 |
"tie_word_embeddings": false,
|
| 32 |
"torch_dtype": "float16",
|
| 33 |
-
"transformers_version": "4.
|
| 34 |
"use_cache": true,
|
| 35 |
"vocab_size": 128258
|
| 36 |
}
|
|
|
|
| 7 |
"attention_dropout": 0.0,
|
| 8 |
"bos_token_id": 128256,
|
| 9 |
"eos_token_id": 128257,
|
| 10 |
+
"head_dim": 128,
|
| 11 |
"hidden_act": "silu",
|
| 12 |
"hidden_size": 4096,
|
| 13 |
"initializer_range": 0.02,
|
|
|
|
| 31 |
"rope_theta": 500000.0,
|
| 32 |
"tie_word_embeddings": false,
|
| 33 |
"torch_dtype": "float16",
|
| 34 |
+
"transformers_version": "4.45.1",
|
| 35 |
"use_cache": true,
|
| 36 |
"vocab_size": 128258
|
| 37 |
}
|
generation_config.json
CHANGED
|
@@ -5,5 +5,5 @@
|
|
| 5 |
"pad_token_id": 128257,
|
| 6 |
"temperature": 0.6,
|
| 7 |
"top_p": 0.9,
|
| 8 |
-
"transformers_version": "4.
|
| 9 |
}
|
|
|
|
| 5 |
"pad_token_id": 128257,
|
| 6 |
"temperature": 0.6,
|
| 7 |
"top_p": 0.9,
|
| 8 |
+
"transformers_version": "4.45.1"
|
| 9 |
}
|
model-00001-of-00004.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4976714976
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:95141de92270947377fb31b22feb1369e4bac2a7e286f58778e093c4874d9115
|
| 3 |
size 4976714976
|
model-00002-of-00004.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4999802616
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:256b3fa2c614cae6545fce05d2c21584c15b8f377060468cb02c31089792fa4c
|
| 3 |
size 4999802616
|
model-00003-of-00004.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4915916080
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9336d0e2d3a7cd8533df3376261429a30df9203852a1922ee978ce61614d5d69
|
| 3 |
size 4915916080
|
model-00004-of-00004.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 1168155192
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9b9aeb53e0041f90b43fe05a85a21c5c21e0fb0afe80efacba5673c124c00a61
|
| 3 |
size 1168155192
|