Compare commits

...

10 Commits

Author SHA1 Message Date
Richard Erkhov
4f11382c16 uploaded readme 2024-08-23 01:02:38 +00:00
Richard Erkhov
4fb586a671 uploaded model 2024-08-23 01:02:34 +00:00
Richard Erkhov
ecb0201874 uploaded model 2024-08-23 00:50:21 +00:00
Richard Erkhov
99f8729d34 uploaded model 2024-08-23 00:35:34 +00:00
Richard Erkhov
06437a9c4c uploaded model 2024-08-23 00:26:35 +00:00
Richard Erkhov
6f8a39dbe3 uploaded model 2024-08-23 00:20:34 +00:00
Richard Erkhov
e8346f34c0 uploaded model 2024-08-23 00:12:18 +00:00
Richard Erkhov
ef2b473068 uploaded model 2024-08-23 00:04:09 +00:00
Richard Erkhov
c584deefb7 uploaded model 2024-08-22 23:57:35 +00:00
Richard Erkhov
da5040be80 uploaded model 2024-08-22 23:51:14 +00:00
11 changed files with 258 additions and 0 deletions

9
.gitattributes vendored
View File

@@ -46,3 +46,12 @@ granite-8b-code-instruct-128k.Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
granite-8b-code-instruct-128k.IQ4_NL.gguf filter=lfs diff=lfs merge=lfs -text
granite-8b-code-instruct-128k.Q4_K_S.gguf filter=lfs diff=lfs merge=lfs -text
granite-8b-code-instruct-128k.Q4_K.gguf filter=lfs diff=lfs merge=lfs -text
granite-8b-code-instruct-128k.Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
granite-8b-code-instruct-128k.Q4_1.gguf filter=lfs diff=lfs merge=lfs -text
granite-8b-code-instruct-128k.Q5_0.gguf filter=lfs diff=lfs merge=lfs -text
granite-8b-code-instruct-128k.Q5_K_S.gguf filter=lfs diff=lfs merge=lfs -text
granite-8b-code-instruct-128k.Q5_K.gguf filter=lfs diff=lfs merge=lfs -text
granite-8b-code-instruct-128k.Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text
granite-8b-code-instruct-128k.Q5_1.gguf filter=lfs diff=lfs merge=lfs -text
granite-8b-code-instruct-128k.Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
granite-8b-code-instruct-128k.Q8_0.gguf filter=lfs diff=lfs merge=lfs -text

222
README.md Normal file
View File

@@ -0,0 +1,222 @@
Quantization made by Richard Erkhov.
[Github](https://github.com/RichardErkhov)
[Discord](https://discord.gg/pvy7H8DZMG)
[Request more models](https://github.com/RichardErkhov/quant_request)
granite-8b-code-instruct-128k - GGUF
- Model creator: https://huggingface.co/ibm-granite/
- Original model: https://huggingface.co/ibm-granite/granite-8b-code-instruct-128k/
| Name | Quant method | Size |
| ---- | ---- | ---- |
| [granite-8b-code-instruct-128k.Q2_K.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-8b-code-instruct-128k-gguf/blob/main/granite-8b-code-instruct-128k.Q2_K.gguf) | Q2_K | 2.85GB |
| [granite-8b-code-instruct-128k.IQ3_XS.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-8b-code-instruct-128k-gguf/blob/main/granite-8b-code-instruct-128k.IQ3_XS.gguf) | IQ3_XS | 3.15GB |
| [granite-8b-code-instruct-128k.IQ3_S.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-8b-code-instruct-128k-gguf/blob/main/granite-8b-code-instruct-128k.IQ3_S.gguf) | IQ3_S | 3.32GB |
| [granite-8b-code-instruct-128k.Q3_K_S.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-8b-code-instruct-128k-gguf/blob/main/granite-8b-code-instruct-128k.Q3_K_S.gguf) | Q3_K_S | 3.3GB |
| [granite-8b-code-instruct-128k.IQ3_M.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-8b-code-instruct-128k-gguf/blob/main/granite-8b-code-instruct-128k.IQ3_M.gguf) | IQ3_M | 3.43GB |
| [granite-8b-code-instruct-128k.Q3_K.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-8b-code-instruct-128k-gguf/blob/main/granite-8b-code-instruct-128k.Q3_K.gguf) | Q3_K | 3.67GB |
| [granite-8b-code-instruct-128k.Q3_K_M.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-8b-code-instruct-128k-gguf/blob/main/granite-8b-code-instruct-128k.Q3_K_M.gguf) | Q3_K_M | 3.67GB |
| [granite-8b-code-instruct-128k.Q3_K_L.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-8b-code-instruct-128k-gguf/blob/main/granite-8b-code-instruct-128k.Q3_K_L.gguf) | Q3_K_L | 3.99GB |
| [granite-8b-code-instruct-128k.IQ4_XS.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-8b-code-instruct-128k-gguf/blob/main/granite-8b-code-instruct-128k.IQ4_XS.gguf) | IQ4_XS | 4.1GB |
| [granite-8b-code-instruct-128k.Q4_0.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-8b-code-instruct-128k-gguf/blob/main/granite-8b-code-instruct-128k.Q4_0.gguf) | Q4_0 | 4.28GB |
| [granite-8b-code-instruct-128k.IQ4_NL.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-8b-code-instruct-128k-gguf/blob/main/granite-8b-code-instruct-128k.IQ4_NL.gguf) | IQ4_NL | 4.32GB |
| [granite-8b-code-instruct-128k.Q4_K_S.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-8b-code-instruct-128k-gguf/blob/main/granite-8b-code-instruct-128k.Q4_K_S.gguf) | Q4_K_S | 4.3GB |
| [granite-8b-code-instruct-128k.Q4_K.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-8b-code-instruct-128k-gguf/blob/main/granite-8b-code-instruct-128k.Q4_K.gguf) | Q4_K | 4.55GB |
| [granite-8b-code-instruct-128k.Q4_K_M.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-8b-code-instruct-128k-gguf/blob/main/granite-8b-code-instruct-128k.Q4_K_M.gguf) | Q4_K_M | 4.55GB |
| [granite-8b-code-instruct-128k.Q4_1.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-8b-code-instruct-128k-gguf/blob/main/granite-8b-code-instruct-128k.Q4_1.gguf) | Q4_1 | 4.73GB |
| [granite-8b-code-instruct-128k.Q5_0.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-8b-code-instruct-128k-gguf/blob/main/granite-8b-code-instruct-128k.Q5_0.gguf) | Q5_0 | 5.19GB |
| [granite-8b-code-instruct-128k.Q5_K_S.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-8b-code-instruct-128k-gguf/blob/main/granite-8b-code-instruct-128k.Q5_K_S.gguf) | Q5_K_S | 5.19GB |
| [granite-8b-code-instruct-128k.Q5_K.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-8b-code-instruct-128k-gguf/blob/main/granite-8b-code-instruct-128k.Q5_K.gguf) | Q5_K | 5.33GB |
| [granite-8b-code-instruct-128k.Q5_K_M.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-8b-code-instruct-128k-gguf/blob/main/granite-8b-code-instruct-128k.Q5_K_M.gguf) | Q5_K_M | 5.33GB |
| [granite-8b-code-instruct-128k.Q5_1.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-8b-code-instruct-128k-gguf/blob/main/granite-8b-code-instruct-128k.Q5_1.gguf) | Q5_1 | 5.65GB |
| [granite-8b-code-instruct-128k.Q6_K.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-8b-code-instruct-128k-gguf/blob/main/granite-8b-code-instruct-128k.Q6_K.gguf) | Q6_K | 6.16GB |
| [granite-8b-code-instruct-128k.Q8_0.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-8b-code-instruct-128k-gguf/blob/main/granite-8b-code-instruct-128k.Q8_0.gguf) | Q8_0 | 7.98GB |
Original model description:
---
pipeline_tag: text-generation
inference: false
license: apache-2.0
datasets:
- bigcode/commitpackft
- TIGER-Lab/MathInstruct
- meta-math/MetaMathQA
- glaiveai/glaive-code-assistant-v3
- glaive-function-calling-v2
- bugdaryan/sql-create-context-instruction
- garage-bAInd/Open-Platypus
- nvidia/HelpSteer
- bigcode/self-oss-instruct-sc2-exec-filter-50k
metrics:
- code_eval
library_name: transformers
tags:
- code
- granite
model-index:
- name: granite-8B-Code-instruct-128k
results:
- task:
type: text-generation
dataset:
type: bigcode/humanevalpack
name: HumanEvalSynthesis (Python)
metrics:
- name: pass@1
type: pass@1
value: 62.2
verified: false
- task:
type: text-generation
dataset:
type: bigcode/humanevalpack
name: HumanEvalSynthesis (Average)
metrics:
- name: pass@1
type: pass@1
value: 51.4
verified: false
- task:
type: text-generation
dataset:
type: bigcode/humanevalpack
name: HumanEvalExplain (Average)
metrics:
- name: pass@1
type: pass@1
value: 38.9
verified: false
- task:
type: text-generation
dataset:
type: bigcode/humanevalpack
name: HumanEvalFix (Average)
metrics:
- name: pass@1
type: pass@1
value: 38.3
verified: false
- task:
type: text-generation
dataset:
type: repoqa
name: RepoQA (Python@16K)
metrics:
- name: pass@1 (thresh=0.5)
type: pass@1 (thresh=0.5)
value: 73.0
verified: false
- task:
type: text-generation
dataset:
type: repoqa
name: RepoQA (C++@16K)
metrics:
- name: pass@1 (thresh=0.5)
type: pass@1 (thresh=0.5)
value: 37.0
verified: false
- task:
type: text-generation
dataset:
type: repoqa
name: RepoQA (Java@16K)
metrics:
- name: pass@1 (thresh=0.5)
type: pass@1 (thresh=0.5)
value: 73.0
verified: false
- task:
type: text-generation
dataset:
type: repoqa
name: RepoQA (TypeScript@16K)
metrics:
- name: pass@1 (thresh=0.5)
type: pass@1 (thresh=0.5)
value: 62.0
verified: false
- task:
type: text-generation
dataset:
type: repoqa
name: RepoQA (Rust@16K)
metrics:
- name: pass@1 (thresh=0.5)
type: pass@1 (thresh=0.5)
value: 63.0
verified: false
---
![image/png](https://cdn-uploads.huggingface.co/production/uploads/62cd5057674cdb524450093d/1hzxoPwqkBJXshKVVe6_9.png)
# Granite-8B-Code-Instruct-128K
## Model Summary
**Granite-8B-Code-Instruct-128K** is a 8B parameter long-context instruct model fine tuned from *Granite-8B-Code-Base-128K* on a combination of **permissively licensed** data used in training the original Granite code instruct models, in addition to synthetically generated code instruction datasets tailored for solving long context problems. By exposing the model to both short and long context data, we aim to enhance its long-context capability without sacrificing code generation performance at short input context.
- **Developers:** IBM Research
- **GitHub Repository:** [ibm-granite/granite-code-models](https://github.com/ibm-granite/granite-code-models)
- **Paper:** [Scaling Granite Code Models to 128K Context](https://arxiv.org/abs/2407.13739)
- **Release Date**: July 18th, 2024
- **License:** [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0).
## Usage
### Intended use
The model is designed to respond to coding related instructions over long-conext input up to 128K length and can be used to build coding assistants.
<!-- TO DO: Check starcoder2 instruct code example that includes the template https://huggingface.co/bigcode/starcoder2-15b-instruct-v0.1 -->
### Generation
This is a simple example of how to use **Granite-8B-Code-Instruct** model.
```python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
device = "cuda" # or "cpu"
model_path = "ibm-granite/granite-8B-Code-instruct-128k"
tokenizer = AutoTokenizer.from_pretrained(model_path)
# drop device_map if running on CPU
model = AutoModelForCausalLM.from_pretrained(model_path, device_map=device)
model.eval()
# change input text as desired
chat = [
{ "role": "user", "content": "Write a code to find the maximum value in a list of numbers." },
]
chat = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
# tokenize the text
input_tokens = tokenizer(chat, return_tensors="pt")
# transfer tokenized inputs to the device
for i in input_tokens:
input_tokens[i] = input_tokens[i].to(device)
# generate output tokens
output = model.generate(**input_tokens, max_new_tokens=100)
# decode output tokens into text
output = tokenizer.batch_decode(output)
# loop over the batch to print, in this example the batch size is 1
for i in output:
print(i)
```
<!-- TO DO: Check this part -->
## Training Data
Granite Code Instruct models are trained on a mix of short and long context data as follows.
* Short-Context Instruction Data: [CommitPackFT](https://huggingface.co/datasets/bigcode/commitpackft), [BigCode-SC2-Instruct](bigcode/self-oss-instruct-sc2-exec-filter-50k), [MathInstruct](https://huggingface.co/datasets/TIGER-Lab/MathInstruct), [MetaMathQA](https://huggingface.co/datasets/meta-math/MetaMathQA), [Glaive-Code-Assistant-v3](https://huggingface.co/datasets/glaiveai/glaive-code-assistant-v3), [Glaive-Function-Calling-v2](https://huggingface.co/datasets/glaiveai/glaive-function-calling-v2), [NL2SQL11](https://huggingface.co/datasets/bugdaryan/sql-create-context-instruction), [HelpSteer](https://huggingface.co/datasets/nvidia/HelpSteer), [OpenPlatypus](https://huggingface.co/datasets/garage-bAInd/Open-Platypus) including a synthetically generated dataset for API calling and multi-turn code interactions with execution feedback. We also include a collection of hardcoded prompts to ensure our model generates correct outputs given inquiries about its name or developers.
* Long-Context Instruction Data: A synthetically-generated dataset by bootstrapping the repository-level file-packed documents through Granite-8b-Code-Instruct to improve long-context capability of the model.
## Infrastructure
We train the Granite Code models using two of IBM's super computing clusters, namely Vela and Blue Vela, both outfitted with NVIDIA A100 and H100 GPUs respectively. These clusters provide a scalable and efficient infrastructure for training our models over thousands of GPUs.
## Ethical Considerations and Limitations
Granite code instruct models are primarily finetuned using instruction-response pairs across a specific set of programming languages. Thus, their performance may be limited with out-of-domain programming languages. In this situation, it is beneficial providing few-shot examples to steer the model's output. Moreover, developers should perform safety testing and target-specific tuning before deploying these models on critical applications. The model also inherits ethical considerations and limitations from its base model. For more information, please refer to *[Granite-8B-Code-Base-128K](https://huggingface.co/ibm-granite/granite-8B-Code-base-128k)* model card.

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:801d1212dd7e455de18f7d5c1725a9d8983d4336d3b2dd45274b0caa5230842e
size 5081628512

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ef4fe5ea80ec8908484f52d54a68e44d231998104f2fd8303b7349d713a93fa2
size 4882857824

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:264bec0158c7759cef384bcd8e37133db207104fb7c1eb109ad831199894f9b8
size 5572362080

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:536ac23f6eaa89bb476006d03e137d6da902b7a3f71aa96582b9d33fda4b0324
size 6063095648

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:445ecf95ecc42056068cf8e06b2002354b1fa5224bac3f1e89c5c414d09d3a42
size 5722767200

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:445ecf95ecc42056068cf8e06b2002354b1fa5224bac3f1e89c5c414d09d3a42
size 5722767200

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ab2d774837bfa6197a00e76045ea57ad0f435c1bd4f5031eb1eb1041ba541324
size 5572362080

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8f9b5c5c11f60512538322139a9894e95c466679c0f9da046ff93d02882f483a
size 6615170912

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7bbeba7889673d85bca7d8aa3a872efcda7f539093c4354c594b8f392a13710d
size 8565522272