Instructions to use Selikar/code-llama-7b-text-to-sql with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Selikar/code-llama-7b-text-to-sql with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("codellama/CodeLlama-7b-hf") model = PeftModel.from_pretrained(base_model, "Selikar/code-llama-7b-text-to-sql") - Notebooks
- Google Colab
- Kaggle
Upload CodeLlama-7B Text-to-SQL QLoRA adapter
Browse files- config.json +28 -0
- generation_config.json +6 -0
- special_tokens_map.json +27 -17
- tokenizer.json +7 -7
- tokenizer_config.json +5 -1
config.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "codellama/CodeLlama-7b-hf",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"LlamaForCausalLM"
|
| 5 |
+
],
|
| 6 |
+
"attention_bias": false,
|
| 7 |
+
"attention_dropout": 0.0,
|
| 8 |
+
"bos_token_id": 1,
|
| 9 |
+
"eos_token_id": 2,
|
| 10 |
+
"hidden_act": "silu",
|
| 11 |
+
"hidden_size": 4096,
|
| 12 |
+
"initializer_range": 0.02,
|
| 13 |
+
"intermediate_size": 11008,
|
| 14 |
+
"max_position_embeddings": 16384,
|
| 15 |
+
"model_type": "llama",
|
| 16 |
+
"num_attention_heads": 32,
|
| 17 |
+
"num_hidden_layers": 32,
|
| 18 |
+
"num_key_value_heads": 32,
|
| 19 |
+
"pretraining_tp": 1,
|
| 20 |
+
"rms_norm_eps": 1e-05,
|
| 21 |
+
"rope_scaling": null,
|
| 22 |
+
"rope_theta": 1000000,
|
| 23 |
+
"tie_word_embeddings": false,
|
| 24 |
+
"torch_dtype": "float16",
|
| 25 |
+
"transformers_version": "4.36.2",
|
| 26 |
+
"use_cache": true,
|
| 27 |
+
"vocab_size": 32018
|
| 28 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 1,
|
| 4 |
+
"eos_token_id": 2,
|
| 5 |
+
"transformers_version": "4.36.2"
|
| 6 |
+
}
|
special_tokens_map.json
CHANGED
|
@@ -1,23 +1,33 @@
|
|
| 1 |
{
|
| 2 |
"additional_special_tokens": [
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
},
|
| 10 |
-
{
|
| 11 |
-
"content": "<|im_start|>",
|
| 12 |
-
"lstrip": false,
|
| 13 |
-
"normalized": false,
|
| 14 |
-
"rstrip": false,
|
| 15 |
-
"single_word": false
|
| 16 |
-
}
|
| 17 |
],
|
| 18 |
-
"bos_token":
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
"unk_token": {
|
| 22 |
"content": "<unk>",
|
| 23 |
"lstrip": false,
|
|
|
|
| 1 |
{
|
| 2 |
"additional_special_tokens": [
|
| 3 |
+
"<|im_end|>",
|
| 4 |
+
"<|im_start|>",
|
| 5 |
+
"▁<PRE>",
|
| 6 |
+
"▁<MID>",
|
| 7 |
+
"▁<SUF>",
|
| 8 |
+
"▁<EOT>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
],
|
| 10 |
+
"bos_token": {
|
| 11 |
+
"content": "<|im_start|>",
|
| 12 |
+
"lstrip": false,
|
| 13 |
+
"normalized": false,
|
| 14 |
+
"rstrip": false,
|
| 15 |
+
"single_word": false
|
| 16 |
+
},
|
| 17 |
+
"eos_token": {
|
| 18 |
+
"content": "<|im_end|>",
|
| 19 |
+
"lstrip": false,
|
| 20 |
+
"normalized": false,
|
| 21 |
+
"rstrip": false,
|
| 22 |
+
"single_word": false
|
| 23 |
+
},
|
| 24 |
+
"pad_token": {
|
| 25 |
+
"content": "<|im_end|>",
|
| 26 |
+
"lstrip": false,
|
| 27 |
+
"normalized": false,
|
| 28 |
+
"rstrip": false,
|
| 29 |
+
"single_word": false
|
| 30 |
+
},
|
| 31 |
"unk_token": {
|
| 32 |
"content": "<unk>",
|
| 33 |
"lstrip": false,
|
tokenizer.json
CHANGED
|
@@ -107,7 +107,7 @@
|
|
| 107 |
"single": [
|
| 108 |
{
|
| 109 |
"SpecialToken": {
|
| 110 |
-
"id": "<
|
| 111 |
"type_id": 0
|
| 112 |
}
|
| 113 |
},
|
|
@@ -121,7 +121,7 @@
|
|
| 121 |
"pair": [
|
| 122 |
{
|
| 123 |
"SpecialToken": {
|
| 124 |
-
"id": "<
|
| 125 |
"type_id": 0
|
| 126 |
}
|
| 127 |
},
|
|
@@ -133,7 +133,7 @@
|
|
| 133 |
},
|
| 134 |
{
|
| 135 |
"SpecialToken": {
|
| 136 |
-
"id": "<
|
| 137 |
"type_id": 1
|
| 138 |
}
|
| 139 |
},
|
|
@@ -145,13 +145,13 @@
|
|
| 145 |
}
|
| 146 |
],
|
| 147 |
"special_tokens": {
|
| 148 |
-
"<
|
| 149 |
-
"id": "<
|
| 150 |
"ids": [
|
| 151 |
-
|
| 152 |
],
|
| 153 |
"tokens": [
|
| 154 |
-
"<
|
| 155 |
]
|
| 156 |
}
|
| 157 |
}
|
|
|
|
| 107 |
"single": [
|
| 108 |
{
|
| 109 |
"SpecialToken": {
|
| 110 |
+
"id": "<|im_start|>",
|
| 111 |
"type_id": 0
|
| 112 |
}
|
| 113 |
},
|
|
|
|
| 121 |
"pair": [
|
| 122 |
{
|
| 123 |
"SpecialToken": {
|
| 124 |
+
"id": "<|im_start|>",
|
| 125 |
"type_id": 0
|
| 126 |
}
|
| 127 |
},
|
|
|
|
| 133 |
},
|
| 134 |
{
|
| 135 |
"SpecialToken": {
|
| 136 |
+
"id": "<|im_start|>",
|
| 137 |
"type_id": 1
|
| 138 |
}
|
| 139 |
},
|
|
|
|
| 145 |
}
|
| 146 |
],
|
| 147 |
"special_tokens": {
|
| 148 |
+
"<|im_start|>": {
|
| 149 |
+
"id": "<|im_start|>",
|
| 150 |
"ids": [
|
| 151 |
+
32017
|
| 152 |
],
|
| 153 |
"tokens": [
|
| 154 |
+
"<|im_start|>"
|
| 155 |
]
|
| 156 |
}
|
| 157 |
}
|
tokenizer_config.json
CHANGED
|
@@ -77,7 +77,11 @@
|
|
| 77 |
},
|
| 78 |
"additional_special_tokens": [
|
| 79 |
"<|im_end|>",
|
| 80 |
-
"<|im_start|>"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
],
|
| 82 |
"bos_token": "<|im_start|>",
|
| 83 |
"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 %}",
|
|
|
|
| 77 |
},
|
| 78 |
"additional_special_tokens": [
|
| 79 |
"<|im_end|>",
|
| 80 |
+
"<|im_start|>",
|
| 81 |
+
"▁<PRE>",
|
| 82 |
+
"▁<MID>",
|
| 83 |
+
"▁<SUF>",
|
| 84 |
+
"▁<EOT>"
|
| 85 |
],
|
| 86 |
"bos_token": "<|im_start|>",
|
| 87 |
"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 %}",
|