TheBloke commited on
Commit
75b08f3
1 Parent(s): 6bc5c0b

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +31 -17
README.md CHANGED
@@ -1,13 +1,22 @@
1
  ---
 
2
  inference: false
3
  language:
4
  - code
5
  license: llama2
6
  model_creator: Meta
7
- model_link: https://huggingface.co/codellama/CodeLlama-13b-python-hf
8
  model_name: CodeLlama 13B Python
9
  model_type: llama
10
  pipeline_tag: text-generation
 
 
 
 
 
 
 
 
 
11
  quantized_by: TheBloke
12
  tags:
13
  - llama-2
@@ -45,9 +54,9 @@ Multiple GPTQ parameter permutations are provided; see Provided Files below for
45
  <!-- repositories-available start -->
46
  ## Repositories available
47
 
 
48
  * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/CodeLlama-13B-Python-GPTQ)
49
  * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/CodeLlama-13B-Python-GGUF)
50
- * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU+GPU inference (deprecated)](https://huggingface.co/TheBloke/CodeLlama-13B-Python-GGML)
51
  * [Meta's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/codellama/CodeLlama-13b-python-hf)
52
  <!-- repositories-available end -->
53
 
@@ -63,6 +72,7 @@ Multiple GPTQ parameter permutations are provided; see Provided Files below for
63
 
64
  <!-- prompt-template end -->
65
 
 
66
  <!-- README_GPTQ.md-provided-files start -->
67
  ## Provided files and GPTQ parameters
68
 
@@ -87,22 +97,22 @@ All recent GPTQ files are made with AutoGPTQ, and all files in non-main branches
87
 
88
  | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
89
  | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
90
- | [main](https://huggingface.co/TheBloke/CodeLlama-13B-Python-GPTQ/tree/main) | 4 | 128 | No | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 8192 | 7.26 GB | Yes | Most compatible option. Good inference speed in AutoGPTQ and GPTQ-for-LLaMa. Lower inference quality than other options. |
91
- | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/CodeLlama-13B-Python-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 8192 | 8.00 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. Poor AutoGPTQ CUDA speed. |
92
- | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/CodeLlama-13B-Python-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 8192 | 7.51 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. Poor AutoGPTQ CUDA speed. |
93
- | [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/CodeLlama-13B-Python-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 8192 | 7.26 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. Poor AutoGPTQ CUDA speed. |
94
- | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/CodeLlama-13B-Python-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 8192 | 13.36 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements and to improve AutoGPTQ speed. |
95
- | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/CodeLlama-13B-Python-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 8192 | 13.65 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. Poor AutoGPTQ CUDA speed. |
96
 
97
  <!-- README_GPTQ.md-provided-files end -->
98
 
99
  <!-- README_GPTQ.md-download-from-branches start -->
100
  ## How to download from branches
101
 
102
- - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/CodeLlama-13B-Python-GPTQ:gptq-4bit-32g-actorder_True`
103
  - With Git, you can clone a branch with:
104
  ```
105
- git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/CodeLlama-13B-Python-GPTQ
106
  ```
107
  - In Python Transformers code, the branch is the `revision` parameter; see below.
108
  <!-- README_GPTQ.md-download-from-branches end -->
@@ -115,7 +125,7 @@ It is strongly recommended to use the text-generation-webui one-click-installers
115
 
116
  1. Click the **Model tab**.
117
  2. Under **Download custom model or LoRA**, enter `TheBloke/CodeLlama-13B-Python-GPTQ`.
118
- - To download from a specific branch, enter for example `TheBloke/CodeLlama-13B-Python-GPTQ:gptq-4bit-32g-actorder_True`
119
  - see Provided Files above for the list of branches for each option.
120
  3. Click **Download**.
121
  4. The model will start downloading. Once it's finished it will say "Done".
@@ -163,10 +173,10 @@ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
163
 
164
  model_name_or_path = "TheBloke/CodeLlama-13B-Python-GPTQ"
165
  # To use a different branch, change revision
166
- # For example: revision="gptq-4bit-32g-actorder_True"
167
  model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
168
- torch_dtype=torch.float16,
169
  device_map="auto",
 
170
  revision="main")
171
 
172
  tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
@@ -181,7 +191,7 @@ prompt_template=f'''[INST] Write code to solve the following coding problem that
181
  print("\n\n*** Generate:")
182
 
183
  input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
184
- output = model.generate(inputs=input_ids, temperature=0.7, max_new_tokens=512)
185
  print(tokenizer.decode(output[0]))
186
 
187
  # Inference can also be done using transformers' pipeline
@@ -192,9 +202,11 @@ pipe = pipeline(
192
  model=model,
193
  tokenizer=tokenizer,
194
  max_new_tokens=512,
 
195
  temperature=0.7,
196
  top_p=0.95,
197
- repetition_penalty=1.15
 
198
  )
199
 
200
  print(pipe(prompt_template)[0]['generated_text'])
@@ -219,10 +231,12 @@ For further support, and discussions on these models and AI in general, join us
219
 
220
  [TheBloke AI's Discord server](https://discord.gg/theblokeai)
221
 
222
- ## Thanks, and how to contribute.
223
 
224
  Thanks to the [chirper.ai](https://chirper.ai) team!
225
 
 
 
226
  I've had a lot of people ask if they can contribute. I enjoy providing models and helping people, and would love to be able to spend even more time doing it, as well as expanding into new projects like fine tuning/training.
227
 
228
  If you're able and willing to contribute it will be most gratefully received and will help me to keep providing more models, and to start work on new AI projects.
@@ -234,7 +248,7 @@ Donaters will get priority support on any and all AI/LLM/model questions and req
234
 
235
  **Special thanks to**: Aemon Algiz.
236
 
237
- **Patreon special mentions**: Russ Johnson, J, alfie_i, Alex, NimbleBox.ai, Chadd, Mandus, Nikolai Manek, Ken Nordquist, ya boyyy, Illia Dulskyi, Viktor Bowallius, vamX, Iucharbius, zynix, Magnesian, Clay Pascal, Pierre Kircher, Enrico Ros, Tony Hughes, Elle, Andrey, knownsqashed, Deep Realms, Jerry Meng, Lone Striker, Derek Yates, Pyrater, Mesiah Bishop, James Bentley, Femi Adebogun, Brandon Frisco, SuperWojo, Alps Aficionado, Michael Dempsey, Vitor Caleffi, Will Dee, Edmond Seymore, usrbinkat, LangChain4j, Kacper Wikieł, Luke Pendergrass, John Detwiler, theTransient, Nathan LeClaire, Tiffany J. Kim, biorpg, Eugene Pentland, Stanislav Ovsiannikov, Fred von Graf, terasurfer, Kalila, Dan Guido, Nitin Borwankar, 阿明, Ai Maven, John Villwock, Gabriel Puliatti, Stephen Murray, Asp the Wyvern, danny, Chris Smitley, ReadyPlayerEmma, S_X, Daniel P. Andersen, Olakabola, Jeffrey Morgan, Imad Khwaja, Caitlyn Gatomon, webtim, Alicia Loh, Trenton Dambrowitz, Swaroop Kallakuri, Erik Bjäreholt, Leonard Tan, Spiking Neurons AB, Luke @flexchar, Ajan Kanaga, Thomas Belote, Deo Leter, RoA, Willem Michiel, transmissions 11, subjectnull, Matthew Berman, Joseph William Delisle, David Ziegler, Michael Davis, Johann-Peter Hartmann, Talal Aujan, senxiiz, Artur Olbinski, Rainer Wilmers, Spencer Kim, Fen Risland, Cap'n Zoog, Rishabh Srivastava, Michael Levine, Geoffrey Montalvo, Sean Connelly, Alexandros Triantafyllidis, Pieter, Gabriel Tamborski, Sam, Subspace Studios, Junyu Yang, Pedro Madruga, Vadim, Cory Kujawski, K, Raven Klaugh, Randy H, Mano Prime, Sebastain Graf, Space Cruiser
238
 
239
 
240
  Thank you to all my generous patrons and donaters!
 
1
  ---
2
+ base_model: https://huggingface.co/codellama/CodeLlama-13b-python-hf
3
  inference: false
4
  language:
5
  - code
6
  license: llama2
7
  model_creator: Meta
 
8
  model_name: CodeLlama 13B Python
9
  model_type: llama
10
  pipeline_tag: text-generation
11
+ prompt_template: '[INST] Write code to solve the following coding problem that obeys
12
+ the constraints and passes the example test cases. Please wrap your code answer
13
+ using ```:
14
+
15
+ {prompt}
16
+
17
+ [/INST]
18
+
19
+ '
20
  quantized_by: TheBloke
21
  tags:
22
  - llama-2
 
54
  <!-- repositories-available start -->
55
  ## Repositories available
56
 
57
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/CodeLlama-13B-Python-AWQ)
58
  * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/CodeLlama-13B-Python-GPTQ)
59
  * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/CodeLlama-13B-Python-GGUF)
 
60
  * [Meta's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/codellama/CodeLlama-13b-python-hf)
61
  <!-- repositories-available end -->
62
 
 
72
 
73
  <!-- prompt-template end -->
74
 
75
+
76
  <!-- README_GPTQ.md-provided-files start -->
77
  ## Provided files and GPTQ parameters
78
 
 
97
 
98
  | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
99
  | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
100
+ | [main](https://huggingface.co/TheBloke/CodeLlama-13B-Python-GPTQ/tree/main) | 4 | 128 | No | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 8192 | 7.26 GB | Yes | 4-bit, without Act Order and group size 128g. |
101
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/CodeLlama-13B-Python-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 8192 | 8.00 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
102
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/CodeLlama-13B-Python-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 8192 | 7.51 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. |
103
+ | [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/CodeLlama-13B-Python-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 8192 | 7.26 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
104
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/CodeLlama-13B-Python-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 8192 | 13.36 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
105
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/CodeLlama-13B-Python-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [Evol Instruct Code](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1) | 8192 | 13.65 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
106
 
107
  <!-- README_GPTQ.md-provided-files end -->
108
 
109
  <!-- README_GPTQ.md-download-from-branches start -->
110
  ## How to download from branches
111
 
112
+ - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/CodeLlama-13B-Python-GPTQ:main`
113
  - With Git, you can clone a branch with:
114
  ```
115
+ git clone --single-branch --branch main https://huggingface.co/TheBloke/CodeLlama-13B-Python-GPTQ
116
  ```
117
  - In Python Transformers code, the branch is the `revision` parameter; see below.
118
  <!-- README_GPTQ.md-download-from-branches end -->
 
125
 
126
  1. Click the **Model tab**.
127
  2. Under **Download custom model or LoRA**, enter `TheBloke/CodeLlama-13B-Python-GPTQ`.
128
+ - To download from a specific branch, enter for example `TheBloke/CodeLlama-13B-Python-GPTQ:main`
129
  - see Provided Files above for the list of branches for each option.
130
  3. Click **Download**.
131
  4. The model will start downloading. Once it's finished it will say "Done".
 
173
 
174
  model_name_or_path = "TheBloke/CodeLlama-13B-Python-GPTQ"
175
  # To use a different branch, change revision
176
+ # For example: revision="main"
177
  model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
 
178
  device_map="auto",
179
+ trust_remote_code=True,
180
  revision="main")
181
 
182
  tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
 
191
  print("\n\n*** Generate:")
192
 
193
  input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
194
+ output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
195
  print(tokenizer.decode(output[0]))
196
 
197
  # Inference can also be done using transformers' pipeline
 
202
  model=model,
203
  tokenizer=tokenizer,
204
  max_new_tokens=512,
205
+ do_sample=True,
206
  temperature=0.7,
207
  top_p=0.95,
208
+ top_k=40,
209
+ repetition_penalty=1.1
210
  )
211
 
212
  print(pipe(prompt_template)[0]['generated_text'])
 
231
 
232
  [TheBloke AI's Discord server](https://discord.gg/theblokeai)
233
 
234
+ ## Thanks, and how to contribute
235
 
236
  Thanks to the [chirper.ai](https://chirper.ai) team!
237
 
238
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
239
+
240
  I've had a lot of people ask if they can contribute. I enjoy providing models and helping people, and would love to be able to spend even more time doing it, as well as expanding into new projects like fine tuning/training.
241
 
242
  If you're able and willing to contribute it will be most gratefully received and will help me to keep providing more models, and to start work on new AI projects.
 
248
 
249
  **Special thanks to**: Aemon Algiz.
250
 
251
+ **Patreon special mentions**: Alicia Loh, Stephen Murray, K, Ajan Kanaga, RoA, Magnesian, Deo Leter, Olakabola, Eugene Pentland, zynix, Deep Realms, Raymond Fosdick, Elijah Stavena, Iucharbius, Erik Bjäreholt, Luis Javier Navarrete Lozano, Nicholas, theTransient, John Detwiler, alfie_i, knownsqashed, Mano Prime, Willem Michiel, Enrico Ros, LangChain4j, OG, Michael Dempsey, Pierre Kircher, Pedro Madruga, James Bentley, Thomas Belote, Luke @flexchar, Leonard Tan, Johann-Peter Hartmann, Illia Dulskyi, Fen Risland, Chadd, S_X, Jeff Scroggin, Ken Nordquist, Sean Connelly, Artur Olbinski, Swaroop Kallakuri, Jack West, Ai Maven, David Ziegler, Russ Johnson, transmissions 11, John Villwock, Alps Aficionado, Clay Pascal, Viktor Bowallius, Subspace Studios, Rainer Wilmers, Trenton Dambrowitz, vamX, Michael Levine, 준교 김, Brandon Frisco, Kalila, Trailburnt, Randy H, Talal Aujan, Nathan Dryer, Vadim, 阿明, ReadyPlayerEmma, Tiffany J. Kim, George Stoitzev, Spencer Kim, Jerry Meng, Gabriel Tamborski, Cory Kujawski, Jeffrey Morgan, Spiking Neurons AB, Edmond Seymore, Alexandros Triantafyllidis, Lone Striker, Cap'n Zoog, Nikolai Manek, danny, ya boyyy, Derek Yates, usrbinkat, Mandus, TL, Nathan LeClaire, subjectnull, Imad Khwaja, webtim, Raven Klaugh, Asp the Wyvern, Gabriel Puliatti, Caitlyn Gatomon, Joseph William Delisle, Jonathan Leane, Luke Pendergrass, SuperWojo, Sebastain Graf, Will Dee, Fred von Graf, Andrey, Dan Guido, Daniel P. Andersen, Nitin Borwankar, Elle, Vitor Caleffi, biorpg, jjj, NimbleBox.ai, Pieter, Matthew Berman, terasurfer, Michael Davis, Alex, Stanislav Ovsiannikov
252
 
253
 
254
  Thank you to all my generous patrons and donaters!