Instructions to use sanghyun89/llama3.2-5b-PI-NL2SQL-korean-2-test with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sanghyun89/llama3.2-5b-PI-NL2SQL-korean-2-test with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sanghyun89/llama3.2-5b-PI-NL2SQL-korean-2-test") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sanghyun89/llama3.2-5b-PI-NL2SQL-korean-2-test") model = AutoModelForCausalLM.from_pretrained("sanghyun89/llama3.2-5b-PI-NL2SQL-korean-2-test", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sanghyun89/llama3.2-5b-PI-NL2SQL-korean-2-test with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sanghyun89/llama3.2-5b-PI-NL2SQL-korean-2-test" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sanghyun89/llama3.2-5b-PI-NL2SQL-korean-2-test", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sanghyun89/llama3.2-5b-PI-NL2SQL-korean-2-test
- SGLang
How to use sanghyun89/llama3.2-5b-PI-NL2SQL-korean-2-test 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 "sanghyun89/llama3.2-5b-PI-NL2SQL-korean-2-test" \ --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": "sanghyun89/llama3.2-5b-PI-NL2SQL-korean-2-test", "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 "sanghyun89/llama3.2-5b-PI-NL2SQL-korean-2-test" \ --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": "sanghyun89/llama3.2-5b-PI-NL2SQL-korean-2-test", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use sanghyun89/llama3.2-5b-PI-NL2SQL-korean-2-test with Docker Model Runner:
docker model run hf.co/sanghyun89/llama3.2-5b-PI-NL2SQL-korean-2-test
Upload tokenizer
Browse files- special_tokens_map.json +19 -21
- tokenizer.json +2 -2
- tokenizer_config.json +24 -4
special_tokens_map.json
CHANGED
|
@@ -1,23 +1,21 @@
|
|
| 1 |
{
|
| 2 |
-
"
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
"single_word": false
|
| 22 |
-
}
|
| 23 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"additional_special_tokens": [
|
| 3 |
+
{
|
| 4 |
+
"content": "<|im_start|>",
|
| 5 |
+
"lstrip": false,
|
| 6 |
+
"normalized": false,
|
| 7 |
+
"rstrip": false,
|
| 8 |
+
"single_word": false
|
| 9 |
+
},
|
| 10 |
+
{
|
| 11 |
+
"content": "<|im_end|>",
|
| 12 |
+
"lstrip": false,
|
| 13 |
+
"normalized": false,
|
| 14 |
+
"rstrip": false,
|
| 15 |
+
"single_word": false
|
| 16 |
+
}
|
| 17 |
+
],
|
| 18 |
+
"bos_token": "<|im_start|>",
|
| 19 |
+
"eos_token": "<|im_end|>",
|
| 20 |
+
"pad_token": "<|im_end|>"
|
|
|
|
|
|
|
| 21 |
}
|
tokenizer.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4a58418f8e48567d81e6d0972998e4754a99861b993b8e532939e990af17fcd0
|
| 3 |
+
size 17212032
|
tokenizer_config.json
CHANGED
|
@@ -2111,12 +2111,32 @@
|
|
| 2111 |
"rstrip": false,
|
| 2112 |
"single_word": false,
|
| 2113 |
"special": false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2114 |
}
|
| 2115 |
},
|
| 2116 |
-
"
|
| 2117 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2118 |
"clean_up_tokenization_spaces": true,
|
| 2119 |
-
"eos_token": "<|
|
| 2120 |
"extra_special_tokens": {},
|
| 2121 |
"max_length": 64,
|
| 2122 |
"model_input_names": [
|
|
@@ -2124,7 +2144,7 @@
|
|
| 2124 |
"attention_mask"
|
| 2125 |
],
|
| 2126 |
"model_max_length": 131072,
|
| 2127 |
-
"pad_token": "<|
|
| 2128 |
"processor_class": "MllamaProcessor",
|
| 2129 |
"stride": 0,
|
| 2130 |
"tokenizer_class": "PreTrainedTokenizerFast",
|
|
|
|
| 2111 |
"rstrip": false,
|
| 2112 |
"single_word": false,
|
| 2113 |
"special": false
|
| 2114 |
+
},
|
| 2115 |
+
"128264": {
|
| 2116 |
+
"content": "<|im_start|>",
|
| 2117 |
+
"lstrip": false,
|
| 2118 |
+
"normalized": false,
|
| 2119 |
+
"rstrip": false,
|
| 2120 |
+
"single_word": false,
|
| 2121 |
+
"special": true
|
| 2122 |
+
},
|
| 2123 |
+
"128265": {
|
| 2124 |
+
"content": "<|im_end|>",
|
| 2125 |
+
"lstrip": false,
|
| 2126 |
+
"normalized": false,
|
| 2127 |
+
"rstrip": false,
|
| 2128 |
+
"single_word": false,
|
| 2129 |
+
"special": true
|
| 2130 |
}
|
| 2131 |
},
|
| 2132 |
+
"additional_special_tokens": [
|
| 2133 |
+
"<|im_start|>",
|
| 2134 |
+
"<|im_end|>"
|
| 2135 |
+
],
|
| 2136 |
+
"bos_token": "<|im_start|>",
|
| 2137 |
+
"chat_template": "{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
|
| 2138 |
"clean_up_tokenization_spaces": true,
|
| 2139 |
+
"eos_token": "<|im_end|>",
|
| 2140 |
"extra_special_tokens": {},
|
| 2141 |
"max_length": 64,
|
| 2142 |
"model_input_names": [
|
|
|
|
| 2144 |
"attention_mask"
|
| 2145 |
],
|
| 2146 |
"model_max_length": 131072,
|
| 2147 |
+
"pad_token": "<|im_end|>",
|
| 2148 |
"processor_class": "MllamaProcessor",
|
| 2149 |
"stride": 0,
|
| 2150 |
"tokenizer_class": "PreTrainedTokenizerFast",
|