Instructions to use Kwang-su/llama3-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Kwang-su/llama3-model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Kwang-su/llama3-model") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Kwang-su/llama3-model") model = AutoModelForCausalLM.from_pretrained("Kwang-su/llama3-model") 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
- vLLM
How to use Kwang-su/llama3-model with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Kwang-su/llama3-model" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kwang-su/llama3-model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Kwang-su/llama3-model
- SGLang
How to use Kwang-su/llama3-model 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 "Kwang-su/llama3-model" \ --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": "Kwang-su/llama3-model", "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 "Kwang-su/llama3-model" \ --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": "Kwang-su/llama3-model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Kwang-su/llama3-model with Docker Model Runner:
docker model run hf.co/Kwang-su/llama3-model
Upload LlamaForCausalLM
Browse files- config.json +5 -4
- generation_config.json +10 -5
- 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
- model.safetensors.index.json +1 -0
config.json
CHANGED
|
@@ -1,17 +1,19 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "beomi/Llama-3-Open-Ko-8B",
|
| 3 |
"architectures": [
|
| 4 |
"LlamaForCausalLM"
|
| 5 |
],
|
| 6 |
"attention_bias": false,
|
| 7 |
"attention_dropout": 0.0,
|
| 8 |
"bos_token_id": 128000,
|
| 9 |
-
"
|
|
|
|
|
|
|
| 10 |
"hidden_act": "silu",
|
| 11 |
"hidden_size": 4096,
|
| 12 |
"initializer_range": 0.02,
|
| 13 |
"intermediate_size": 14336,
|
| 14 |
"max_position_embeddings": 8192,
|
|
|
|
| 15 |
"model_type": "llama",
|
| 16 |
"num_attention_heads": 32,
|
| 17 |
"num_hidden_layers": 32,
|
|
@@ -21,8 +23,7 @@
|
|
| 21 |
"rope_scaling": null,
|
| 22 |
"rope_theta": 500000.0,
|
| 23 |
"tie_word_embeddings": false,
|
| 24 |
-
"
|
| 25 |
-
"transformers_version": "4.40.0",
|
| 26 |
"use_cache": true,
|
| 27 |
"vocab_size": 128256
|
| 28 |
}
|
|
|
|
| 1 |
{
|
|
|
|
| 2 |
"architectures": [
|
| 3 |
"LlamaForCausalLM"
|
| 4 |
],
|
| 5 |
"attention_bias": false,
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
"bos_token_id": 128000,
|
| 8 |
+
"dtype": "float16",
|
| 9 |
+
"eos_token_id": 128009,
|
| 10 |
+
"head_dim": 128,
|
| 11 |
"hidden_act": "silu",
|
| 12 |
"hidden_size": 4096,
|
| 13 |
"initializer_range": 0.02,
|
| 14 |
"intermediate_size": 14336,
|
| 15 |
"max_position_embeddings": 8192,
|
| 16 |
+
"mlp_bias": false,
|
| 17 |
"model_type": "llama",
|
| 18 |
"num_attention_heads": 32,
|
| 19 |
"num_hidden_layers": 32,
|
|
|
|
| 23 |
"rope_scaling": null,
|
| 24 |
"rope_theta": 500000.0,
|
| 25 |
"tie_word_embeddings": false,
|
| 26 |
+
"transformers_version": "4.57.6",
|
|
|
|
| 27 |
"use_cache": true,
|
| 28 |
"vocab_size": 128256
|
| 29 |
}
|
generation_config.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
| 1 |
{
|
| 2 |
-
"
|
| 3 |
-
"
|
| 4 |
-
"eos_token_id":
|
| 5 |
-
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"bos_token_id": 128000,
|
| 3 |
+
"do_sample": true,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
128001,
|
| 6 |
+
128009
|
| 7 |
+
],
|
| 8 |
+
"max_length": 4096,
|
| 9 |
+
"temperature": 0.6,
|
| 10 |
+
"top_p": 0.9,
|
| 11 |
+
"transformers_version": "4.57.6"
|
| 12 |
}
|
model-00001-of-00004.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4976698592
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:face513dab35244d03043f49e596805fbdaca2b9eb58dcf1e6a74a2f253ba665
|
| 3 |
size 4976698592
|
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:bf8042f848cde7cedaf8b563c87dc0885cb37074b21f28dfef2a98df57eb59c8
|
| 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:8403da2ee8bb2a5caf8ff74a4118c0fb537af80dc042997e5f6777948c9a6122
|
| 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 1168138808
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:146753a60dc85291a4fc40674be347e996064b6cd5a2e48f4b888000a1e19440
|
| 3 |
size 1168138808
|
model.safetensors.index.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"metadata": {
|
|
|
|
| 3 |
"total_size": 16060522496
|
| 4 |
},
|
| 5 |
"weight_map": {
|
|
|
|
| 1 |
{
|
| 2 |
"metadata": {
|
| 3 |
+
"total_parameters": 8030261248,
|
| 4 |
"total_size": 16060522496
|
| 5 |
},
|
| 6 |
"weight_map": {
|