GraySoft
Projects Models About FAQ Contact Download guIDE →
Model Intelligence Sheet

richarderkhov/ibm-granite_-_granite-3.0-2b-instruct-gguf overview

Model Summary: Granite-3.0-2B-Instruct is a 2B parameter model finetuned from Granite-3.0-2B-Base using a combination of open source instruction datasets with permissive license and internally collected synthetic datasets. This model is developed using a diverse set of techniques with a structured chat format, including supervised finetuning, model alignment using reinforcement learning, and model merging. Supported Languages: English, German, Spanish, French, Japanese, Portuguese, Arabic, Czech, Italian, Korean, Dutch, and Chinese. Users may finetune Granite 3.0 models for languages beyond these 12 languages. Intended use: The model is designed to respond to general instructions and can be used to build AI assistants for multiple domains, including business applications. Capabilities Summarization Text classification Text extraction Question-answering Retrieval Augmented Generation (RAG) Code related tasks Function-calling tasks Multilingual dialog use cases Generation: This is a simple example of how to use Granite-3.0-2B-Instruct model. Install the following libraries: Then, copy the snippet from the section that is relevant for your use case. Model Architecture: Granite-3.0-2B-Instruct is based on a decoder-only dense transformer architecture. Core components of this architecture are: GQA and RoPE, MLP with SwiGLU, RMSNorm, and shared input/output embeddings. | Model | 2B Dense | 8B Dense | 1B MoE | 3B MoE | | :-------- | :-------- | :--------| :--------| :--------| | Embedding size | 2048 | 4096 | 1024 | 1536 | | Number of layers | 40 | 40 | 24 | 32 | | Attention head size | 64 | 128 | 64 | 64 | | Number of attention heads | 32 | 32 | 16 | 24 | | Number of KV heads | 8 | 8 | 8 | 8 | | MLP hidden size | 8192 | 12800 | 512 | 512 | | MLP activation | SwiGLU | SwiGLU | SwiGLU | SwiGLU | | Number of Experts | — | — | 32 | 40 | | MoE TopK | — | — | 8 | 8 | | Initialization std | 0.1 | 0.1 | 0.1 | 0.1 | | Sequence Length | 4096 | 4096 | 4096 | 4096 | | Position Embedding | RoPE | RoPE | RoPE | RoPE | | # Parameters | 2.5B | 8.1B | 1.3B | 3.3B | | # Active Parameters | 2.5B | 8.1B | 400M | 800M | | # Training tokens | 12T | 12T | 10T | 10T | Training Data: Overall, our SFT data is largely comprised of three key sources: (1) publicly available datasets with permissive license, (2) internal synthetic data targeting specific capabilities, and (3) very small amounts of human-curated data. A detailed attribution of datasets can be found in the Granite Technical Report and Accompanying Author List. Infrastructure: We train Granite 3.0 Language Models using IBM's super computing cluster, Blue Vela, which is outfitted with NVIDIA H100 GPUs. This cluster provides a scalable and efficient infrastructure for training our models over thousands of GPUs while minimizing environmental impact by utilizing 100% renewable energy sources. Ethical Considerations and Limitations: Granite 3.0 Instruct Models are primarily finetuned using instruction-response pairs mostly in English, but also multilingual data covering eleven languages. Although this model can handle multilingual dialog use cases, its performance might not be similar to English tasks. In such case, introducing a small number of examples (few-shot) can help the model in generating more accurate outputs. While this model has been aligned by keeping safety in consideration, the model may in some cases produce inaccurate, biased, or unsafe responses to user prompts. So we urge the community to use this model with proper safety testing and tuning tailored for their specific tasks.

ggufarxiv:0000.00000endpoints_compatibleregion:usconversational
richarderkhov/ibm-granite_-_granite-3.0-2b-instruct-gguf visual
Downloads
100
Likes
0
Pipeline
Library
Visibility
Public
Access
Open

Repository Files & Downloads

22 files detected
Direct downloads for all repository files
FileTypeQuantizationSizeLink
granite-3.0-2b-instruct.IQ3_M.gguf GGUF IQ3_M 1.13 GB Download
granite-3.0-2b-instruct.IQ3_S.gguf GGUF IQ3_S 1.10 GB Download
granite-3.0-2b-instruct.IQ3_XS.gguf GGUF IQ3_XS 1.05 GB Download
granite-3.0-2b-instruct.IQ4_NL.gguf GGUF IQ4_NL 1.42 GB Download
granite-3.0-2b-instruct.IQ4_XS.gguf GGUF IQ4_XS 1.35 GB Download
granite-3.0-2b-instruct.Q2_K.gguf GGUF Q2_K 964.43 MB Download
granite-3.0-2b-instruct.Q3_K.gguf GGUF Q3_K 1.21 GB Download
granite-3.0-2b-instruct.Q3_K_L.gguf GGUF Q3_K_L 1.30 GB Download
granite-3.0-2b-instruct.Q3_K_M.gguf GGUF Q3_K_M 1.21 GB Download
granite-3.0-2b-instruct.Q3_K_S.gguf GGUF Q3_K_S 1.09 GB Download
granite-3.0-2b-instruct.Q4_0.gguf GGUF 1.41 GB Download
granite-3.0-2b-instruct.Q4_1.gguf GGUF 1.55 GB Download
granite-3.0-2b-instruct.Q4_K.gguf GGUF Q4_K 1.49 GB Download
granite-3.0-2b-instruct.Q4_K_M.gguf GGUF Q4_K_M 1.49 GB Download
granite-3.0-2b-instruct.Q4_K_S.gguf GGUF Q4_K_S 1.42 GB Download
granite-3.0-2b-instruct.Q5_0.gguf GGUF 1.70 GB Download
granite-3.0-2b-instruct.Q5_1.gguf GGUF 1.85 GB Download
granite-3.0-2b-instruct.Q5_K.gguf GGUF Q5_K 1.75 GB Download
granite-3.0-2b-instruct.Q5_K_M.gguf GGUF Q5_K_M 1.75 GB Download
granite-3.0-2b-instruct.Q5_K_S.gguf GGUF Q5_K_S 1.70 GB Download
granite-3.0-2b-instruct.Q6_K.gguf GGUF Q6_K 2.01 GB Download
granite-3.0-2b-instruct.Q8_0.gguf GGUF 2.61 GB Download

Model Details Live

Model Slug
richarderkhov/ibm-granite_-_granite-3.0-2b-instruct-gguf
Author
RichardErkhov
Pipeline Task
Library
Created
2024-10-22
Last Modified
2024-10-22
Gated
No
Private
No
HF SHA
4ff15e3a75805a3211c86973e2310735dca8e35a
License
Unknown
Language
Unknown
Base Model
Unknown

Metadata Inspector

Normalized metadata (stored in metadata_json)
{
  "metadata": {},
  "card_data": {
    "frontmatter": {},
    "hero_image_url": "https://cdn-uploads.huggingface.co/production/uploads/62cd5057674cdb524450093d/1hzxoPwqkBJXshKVVe6_9.png",
    "summary": "**Model Summary:** Granite-3.0-2B-Instruct is a 2B parameter model finetuned from *Granite-3.0-2B-Base* using a combination of open source instruction datasets with permissive license and internally collected synthetic datasets. This model is developed using a diverse set of techniques with a structured chat format, including supervised finetuning, model alignment using reinforcement learning, and model merging. **Supported Languages:** English, German, Spanish, French, Japanese, Portuguese, Arabic, Czech, Italian, Korean, Dutch, and Chinese. Users may finetune Granite 3.0 models for languages beyond these 12 languages. **Intended use:** The model is designed to respond to general instructions and can be used to build AI assistants for multiple domains, including business applications. *Capabilities* * Summarization * Text classification * Text extraction * Question-answering * Retrieval Augmented Generation (RAG) * Code related tasks * Function-calling tasks * Multilingual dialog use cases **Generation:** This is a simple example of how to use Granite-3.0-2B-Instruct model. Install the following libraries: ``shell pip install torch torchvision torchaudio pip install accelerate pip install transformers ` Then, copy the snippet from the section that is relevant for your use case. `python import torch from transformers import AutoModelForCausalLM, AutoTokenizer device = \"auto\" model_path = \"ibm-granite/granite-3.0-2b-instruct\" 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\": \"Please list one IBM Research laboratory located in the United States. You should only output its name and location.\" }, ] chat = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True) # tokenize the text input_tokens = tokenizer(chat, return_tensors=\"pt\").to(device) # generate output tokens output = model.generate(**input_tokens, max_new_tokens=100) # decode output tokens into text output = tokenizer.batch_decode(output) # print output print(output) ` **Model Architecture:** Granite-3.0-2B-Instruct is based on a decoder-only dense transformer architecture. Core components of this architecture are: GQA and RoPE, MLP with SwiGLU, RMSNorm, and shared input/output embeddings. | Model                        | 2B Dense     | 8B Dense | 1B MoE   | 3B MoE   | | :--------                    | :--------    | :--------| :--------| :--------| | Embedding size               | **2048**     | 4096     | 1024     | 1536     | | Number of layers             | **40**       | 40       | 24       | 32       | | Attention head size          | **64**       | 128      | 64       | 64       | | Number of attention heads    | **32**       | 32       | 16       | 24       | | Number of KV heads           | **8**        | 8        | 8        | 8        | | MLP hidden size              | **8192**     | 12800    | 512      | 512      | | MLP activation               | **SwiGLU**   | SwiGLU   | SwiGLU   | SwiGLU   | | Number of Experts            | **—**        | —        | 32       | 40       | | MoE TopK                     | **—**        | —        | 8        | 8        | | Initialization std           | **0.1**      | 0.1      | 0.1      | 0.1      | | Sequence Length              | **4096**     | 4096     | 4096     | 4096     | | Position Embedding           | **RoPE**     | RoPE     | RoPE     | RoPE     | | # Parameters                 | **2.5B**     | 8.1B     | 1.3B     | 3.3B     | | # Active Parameters          | **2.5B**     | 8.1B     | 400M     | 800M     | | # Training tokens            | **12T**      | 12T      | 10T      | 10T      | **Training Data:** Overall, our SFT data is largely comprised of three key sources: (1) publicly available datasets with permissive license, (2) internal synthetic data targeting specific capabilities, and (3) very small amounts of human-curated data. A detailed attribution of datasets can be found in the Granite Technical Report and Accompanying Author List. **Infrastructure:** We train Granite 3.0 Language Models using IBM's super computing cluster, Blue Vela, which is outfitted with NVIDIA H100 GPUs. This cluster provides a scalable and efficient infrastructure for training our models over thousands of GPUs while minimizing environmental impact by utilizing 100% renewable energy sources. **Ethical Considerations and Limitations:** Granite 3.0 Instruct Models are primarily finetuned using instruction-response pairs mostly in English, but also multilingual data covering eleven languages. Although this model can handle multilingual dialog use cases, its performance might not be similar to English tasks. In such case, introducing a small number of examples (few-shot) can help the model in generating more accurate outputs. While this model has been aligned by keeping safety in consideration, the model may in some cases produce inaccurate, biased, or unsafe responses to user prompts. So we urge the community to use this model with proper safety testing and tuning tailored for their specific tasks.",
    "quick_links": [],
    "benchmark_table_html": "",
    "readme_markdown": "Quantization made by Richard Erkhov.\n\n[Github](https://github.com/RichardErkhov)\n\n[Discord](https://discord.gg/pvy7H8DZMG)\n\n[Request more models](https://github.com/RichardErkhov/quant_request)\n\n\ngranite-3.0-2b-instruct - GGUF\n- Model creator: https://huggingface.co/ibm-granite/\n- Original model: https://huggingface.co/ibm-granite/granite-3.0-2b-instruct/\n\n\n| Name | Quant method | Size |\n| ---- | ---- | ---- |\n| [granite-3.0-2b-instruct.Q2_K.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-3.0-2b-instruct-gguf/blob/main/granite-3.0-2b-instruct.Q2_K.gguf) | Q2_K | 0.94GB |\n| [granite-3.0-2b-instruct.IQ3_XS.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-3.0-2b-instruct-gguf/blob/main/granite-3.0-2b-instruct.IQ3_XS.gguf) | IQ3_XS | 1.05GB |\n| [granite-3.0-2b-instruct.IQ3_S.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-3.0-2b-instruct-gguf/blob/main/granite-3.0-2b-instruct.IQ3_S.gguf) | IQ3_S | 1.1GB |\n| [granite-3.0-2b-instruct.Q3_K_S.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-3.0-2b-instruct-gguf/blob/main/granite-3.0-2b-instruct.Q3_K_S.gguf) | Q3_K_S | 1.09GB |\n| [granite-3.0-2b-instruct.IQ3_M.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-3.0-2b-instruct-gguf/blob/main/granite-3.0-2b-instruct.IQ3_M.gguf) | IQ3_M | 1.13GB |\n| [granite-3.0-2b-instruct.Q3_K.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-3.0-2b-instruct-gguf/blob/main/granite-3.0-2b-instruct.Q3_K.gguf) | Q3_K | 1.21GB |\n| [granite-3.0-2b-instruct.Q3_K_M.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-3.0-2b-instruct-gguf/blob/main/granite-3.0-2b-instruct.Q3_K_M.gguf) | Q3_K_M | 1.21GB |\n| [granite-3.0-2b-instruct.Q3_K_L.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-3.0-2b-instruct-gguf/blob/main/granite-3.0-2b-instruct.Q3_K_L.gguf) | Q3_K_L | 1.3GB |\n| [granite-3.0-2b-instruct.IQ4_XS.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-3.0-2b-instruct-gguf/blob/main/granite-3.0-2b-instruct.IQ4_XS.gguf) | IQ4_XS | 1.35GB |\n| [granite-3.0-2b-instruct.Q4_0.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-3.0-2b-instruct-gguf/blob/main/granite-3.0-2b-instruct.Q4_0.gguf) | Q4_0 | 1.41GB |\n| [granite-3.0-2b-instruct.IQ4_NL.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-3.0-2b-instruct-gguf/blob/main/granite-3.0-2b-instruct.IQ4_NL.gguf) | IQ4_NL | 1.42GB |\n| [granite-3.0-2b-instruct.Q4_K_S.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-3.0-2b-instruct-gguf/blob/main/granite-3.0-2b-instruct.Q4_K_S.gguf) | Q4_K_S | 1.42GB |\n| [granite-3.0-2b-instruct.Q4_K.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-3.0-2b-instruct-gguf/blob/main/granite-3.0-2b-instruct.Q4_K.gguf) | Q4_K | 1.49GB |\n| [granite-3.0-2b-instruct.Q4_K_M.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-3.0-2b-instruct-gguf/blob/main/granite-3.0-2b-instruct.Q4_K_M.gguf) | Q4_K_M | 1.49GB |\n| [granite-3.0-2b-instruct.Q4_1.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-3.0-2b-instruct-gguf/blob/main/granite-3.0-2b-instruct.Q4_1.gguf) | Q4_1 | 1.55GB |\n| [granite-3.0-2b-instruct.Q5_0.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-3.0-2b-instruct-gguf/blob/main/granite-3.0-2b-instruct.Q5_0.gguf) | Q5_0 | 1.7GB |\n| [granite-3.0-2b-instruct.Q5_K_S.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-3.0-2b-instruct-gguf/blob/main/granite-3.0-2b-instruct.Q5_K_S.gguf) | Q5_K_S | 1.7GB |\n| [granite-3.0-2b-instruct.Q5_K.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-3.0-2b-instruct-gguf/blob/main/granite-3.0-2b-instruct.Q5_K.gguf) | Q5_K | 1.75GB |\n| [granite-3.0-2b-instruct.Q5_K_M.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-3.0-2b-instruct-gguf/blob/main/granite-3.0-2b-instruct.Q5_K_M.gguf) | Q5_K_M | 1.75GB |\n| [granite-3.0-2b-instruct.Q5_1.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-3.0-2b-instruct-gguf/blob/main/granite-3.0-2b-instruct.Q5_1.gguf) | Q5_1 | 1.85GB |\n| [granite-3.0-2b-instruct.Q6_K.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-3.0-2b-instruct-gguf/blob/main/granite-3.0-2b-instruct.Q6_K.gguf) | Q6_K | 2.01GB |\n| [granite-3.0-2b-instruct.Q8_0.gguf](https://huggingface.co/RichardErkhov/ibm-granite_-_granite-3.0-2b-instruct-gguf/blob/main/granite-3.0-2b-instruct.Q8_0.gguf) | Q8_0 | 2.61GB |\n\n\n\n\nOriginal model description:\n---\npipeline_tag: text-generation\ninference: false\nlicense: apache-2.0\nlibrary_name: transformers\ntags:\n- language\n- granite-3.0\nmodel-index:\n- name: granite-3.0-2b-instruct\n  results:\n  - task:\n      type: text-generation\n    dataset:\n        type: instruction-following\n        name: IFEval\n    metrics:\n    - name: pass@1\n      type: pass@1\n      value: 46.07\n      veriefied: false\n  - task:\n      type: text-generation\n    dataset:\n        type: instruction-following\n        name: MT-Bench\n    metrics:\n    - name: pass@1\n      type: pass@1\n      value: 7.66\n      veriefied: false\n  - task:\n      type: text-generation\n    dataset:\n        type: human-exams\n        name: AGI-Eval\n    metrics:\n    - name: pass@1\n      type: pass@1\n      value: 29.75\n      veriefied: false\n  - task:\n      type: text-generation\n    dataset:\n        type: human-exams\n        name: MMLU\n    metrics:\n    - name: pass@1\n      type: pass@1\n      value: 56.03\n      veriefied: false\n  - task:\n      type: text-generation\n    dataset:\n        type: human-exams\n        name: MMLU-Pro\n    metrics:\n    - name: pass@1\n      type: pass@1\n      value: 27.92\n      veriefied: false\n  - task:\n      type: text-generation\n    dataset:\n        type: commonsense\n        name: OBQA \n    metrics:\n    - name: pass@1\n      type: pass@1\n      value: 43.20\n      veriefied: false\n  - task:\n      type: text-generation\n    dataset:\n        type: commonsense\n        name: SIQA\n    metrics:\n    - name: pass@1\n      type: pass@1\n      value: 66.36\n      veriefied: false\n  - task:\n      type: text-generation\n    dataset:\n        type: commonsense\n        name: Hellaswag\n    metrics:\n    - name: pass@1\n      type: pass@1\n      value: 76.79\n      veriefied: false\n  - task:\n      type: text-generation\n    dataset:\n        type: commonsense\n        name: WinoGrande\n    metrics:\n    - name: pass@1\n      type: pass@1\n      value: 71.90\n      veriefied: false\n  - task:\n      type: text-generation\n    dataset:\n        type: commonsense\n        name: TruthfulQA\n    metrics:\n    - name: pass@1\n      type: pass@1\n      value: 53.37\n      veriefied: false\n  - task:\n      type: text-generation\n    dataset:\n        type: reading-comprehension\n        name: BoolQ\n    metrics:\n    - name: pass@1\n      type: pass@1\n      value: 84.89\n      veriefied: false\n  - task:\n      type: text-generation\n    dataset:\n        type: reading-comprehension\n        name: SQuAD 2.0\n    metrics:\n    - name: pass@1\n      type: pass@1\n      value: 19.73\n      veriefied: false\n  - task:\n      type: text-generation\n    dataset:\n        type: reasoning\n        name: ARC-C\n    metrics:\n    - name: pass@1\n      type: pass@1\n      value: 54.35\n      veriefied: false\n  - task:\n      type: text-generation\n    dataset:\n        type: reasoning\n        name: GPQA\n    metrics:\n    - name: pass@1\n      type: pass@1\n      value: 28.61\n      veriefied: false\n  - task:\n      type: text-generation\n    dataset:\n        type: reasoning\n        name: BBH\n    metrics:\n    - name: pass@1\n      type: pass@1\n      value: 43.74\n      veriefied: false\n  - task:\n      type: text-generation\n    dataset:\n        type: code\n        name: HumanEvalSynthesis\n    metrics:\n    - name: pass@1\n      type: pass@1\n      value: 50.61\n      veriefied: false\n  - task:\n      type: text-generation\n    dataset:\n        type: code\n        name: HumanEvalExplain\n    metrics:\n    - name: pass@1\n      type: pass@1\n      value: 45.58\n      veriefied: false\n  - task:\n      type: text-generation\n    dataset:\n        type: code\n        name: HumanEvalFix\n    metrics:\n    - name: pass@1\n      type: pass@1\n      value: 51.83\n      veriefied: false\n  - task:\n      type: text-generation\n    dataset:\n        type: code\n        name: MBPP\n    metrics:\n    - name: pass@1\n      type: pass@1\n      value: 41.00\n      veriefied: false     \n  - task:\n      type: text-generation\n    dataset:\n        type: math\n        name: GSM8K\n    metrics:\n    - name: pass@1\n      type: pass@1\n      value: 59.66\n      veriefied: false \n  - task:\n      type: text-generation\n    dataset:\n        type: math\n        name: MATH\n    metrics:\n    - name: pass@1\n      type: pass@1\n      value: 23.66\n      veriefied: false   \n  - task:\n      type: text-generation\n    dataset:\n        type: multilingual\n        name: PAWS-X (7 langs)\n    metrics:\n    - name: pass@1\n      type: pass@1\n      value: 61.42\n      veriefied: false \n  - task:\n      type: text-generation\n    dataset:\n        type: multilingual\n        name: MGSM (6 langs)\n    metrics:\n    - name: pass@1\n      type: pass@1\n      value: 37.13\n      veriefied: false \n---\n\n<!-- ![image/png](https://cdn-uploads.huggingface.co/production/uploads/62cd5057674cdb524450093d/1hzxoPwqkBJXshKVVe6_9.png) -->\n<!-- ![image/png](granite-3_0-language-models_Group_1.png) -->\n\n# Granite-3.0-2B-Instruct\n\n**Model Summary:**\nGranite-3.0-2B-Instruct is a 2B parameter model finetuned from *Granite-3.0-2B-Base* using a combination of open source instruction datasets with permissive license and internally collected synthetic datasets. This model is developed using a diverse set of techniques with a structured chat format, including supervised finetuning, model alignment using reinforcement learning, and model merging.\n\n- **Developers:** Granite Team, IBM\n- **GitHub Repository:** [ibm-granite/granite-3.0-language-models](https://github.com/ibm-granite/granite-3.0-language-models)\n- **Website**: [Granite Docs](https://www.ibm.com/granite/docs/)\n- **Paper:** [Granite 3.0 Language Models](https://github.com/ibm-granite/granite-3.0-language-models/blob/main/paper.pdf)\n- **Release Date**: October 21st, 2024\n- **License:** [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)\n\n**Supported Languages:** \nEnglish, German, Spanish, French, Japanese, Portuguese, Arabic, Czech, Italian, Korean, Dutch, and Chinese. Users may finetune Granite 3.0 models for languages beyond these 12 languages.\n\n**Intended use:** \nThe model is designed to respond to general instructions and can be used to build AI assistants for multiple domains, including business applications.\n\n*Capabilities*\n* Summarization\n* Text classification\n* Text extraction\n* Question-answering\n* Retrieval Augmented Generation (RAG)\n* Code related tasks\n* Function-calling tasks\n* Multilingual dialog use cases\n\n**Generation:** \nThis is a simple example of how to use Granite-3.0-2B-Instruct model.\n\nInstall the following libraries:\n\n```shell\npip install torch torchvision torchaudio\npip install accelerate\npip install transformers\n```\nThen, copy the snippet from the section that is relevant for your use case.\n\n```python\nimport torch\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\n\ndevice = \"auto\"\nmodel_path = \"ibm-granite/granite-3.0-2b-instruct\"\ntokenizer = AutoTokenizer.from_pretrained(model_path)\n# drop device_map if running on CPU\nmodel = AutoModelForCausalLM.from_pretrained(model_path, device_map=device)\nmodel.eval()\n# change input text as desired\nchat = [\n    { \"role\": \"user\", \"content\": \"Please list one IBM Research laboratory located in the United States. You should only output its name and location.\" },\n]\nchat = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)\n# tokenize the text\ninput_tokens = tokenizer(chat, return_tensors=\"pt\").to(device)\n# generate output tokens\noutput = model.generate(**input_tokens, \n                        max_new_tokens=100)\n# decode output tokens into text\noutput = tokenizer.batch_decode(output)\n# print output\nprint(output)\n```\n\n**Model Architecture:** \nGranite-3.0-2B-Instruct is based on a decoder-only dense transformer architecture. Core components of this architecture are: GQA and RoPE, MLP with SwiGLU, RMSNorm, and shared input/output embeddings.\n\n| Model                        | 2B Dense     | 8B Dense | 1B MoE   | 3B MoE   |\n| :--------                    | :--------    | :--------| :--------| :--------|\n| Embedding size               | **2048**     | 4096     | 1024     | 1536     |\n| Number of layers             | **40**       | 40       | 24       | 32       |\n| Attention head size          | **64**       | 128      | 64       | 64       |\n| Number of attention heads    | **32**       | 32       | 16       | 24       |\n| Number of KV heads           | **8**        | 8        | 8        | 8        |\n| MLP hidden size              | **8192**     | 12800    | 512      | 512      |\n| MLP activation               | **SwiGLU**   | SwiGLU   | SwiGLU   | SwiGLU   |\n| Number of Experts            | **—**        | —        | 32       | 40       |\n| MoE TopK                     | **—**        | —        | 8        | 8        |\n| Initialization std           | **0.1**      | 0.1      | 0.1      | 0.1      |\n| Sequence Length              | **4096**     | 4096     | 4096     | 4096     |\n| Position Embedding           | **RoPE**     | RoPE     | RoPE     | RoPE     |\n| # Parameters                 | **2.5B**     | 8.1B     | 1.3B     | 3.3B     |\n| # Active Parameters          | **2.5B**     | 8.1B     | 400M     | 800M     |\n| # Training tokens            | **12T**      | 12T      | 10T      | 10T      |\n\n**Training Data:** \nOverall, our SFT data is largely comprised of three key sources: (1) publicly available datasets with permissive license, (2) internal synthetic data targeting specific capabilities, and (3) very small amounts of human-curated data. A detailed attribution of datasets can be found in the [Granite Technical Report](https://github.com/ibm-granite/granite-3.0-language-models/blob/main/paper.pdf) and [Accompanying Author List](https://github.com/ibm-granite/granite-3.0-language-models/blob/main/author-ack.pdf).\n\n**Infrastructure:**\nWe train Granite 3.0 Language Models using IBM's super computing cluster, Blue Vela, which is outfitted with NVIDIA H100 GPUs. This cluster provides a scalable and efficient infrastructure for training our models over thousands of GPUs while minimizing environmental impact by utilizing 100% renewable energy sources.\n\n**Ethical Considerations and Limitations:** \nGranite 3.0 Instruct Models are primarily finetuned using instruction-response pairs mostly in English, but also multilingual data covering eleven languages. Although this model can handle multilingual dialog use cases, its performance might not be similar to English tasks. In such case, introducing a small number of examples (few-shot) can help the model in generating more accurate outputs. While this model has been aligned by keeping safety in consideration, the model may in some cases produce inaccurate, biased, or unsafe responses to user prompts. So we urge the community to use this model with proper safety testing and tuning tailored for their specific tasks.\n\n<!-- ## Citation\n```\n@misc{granite-models,\n  author = {author 1, author2, ...},\n  title = {},\n  journal = {},\n  volume = {},\n  year = {2024},\n  url = {https://arxiv.org/abs/0000.00000},\n}\n``` -->\n\n",
    "related_quantizations": []
  },
  "tags": [
    "gguf",
    "arxiv:0000.00000",
    "endpoints_compatible",
    "region:us",
    "conversational"
  ],
  "likes": 0,
  "downloads": 100,
  "gated": false,
  "private": false,
  "last_modified": "2024-10-22T17:48:19.000Z",
  "created_at": "2024-10-22T16:35:02.000Z",
  "pipeline_tag": "",
  "library_name": ""
}
Source payload excerpt (from Hugging Face API)
{
  "_id": "6717d436e954e1b791cc28c9",
  "id": "RichardErkhov/ibm-granite_-_granite-3.0-2b-instruct-gguf",
  "modelId": "RichardErkhov/ibm-granite_-_granite-3.0-2b-instruct-gguf",
  "sha": "4ff15e3a75805a3211c86973e2310735dca8e35a",
  "createdAt": "2024-10-22T16:35:02.000Z",
  "lastModified": "2024-10-22T17:48:19.000Z",
  "author": "RichardErkhov",
  "downloads": 100,
  "likes": 0,
  "gated": false,
  "private": false,
  "pipeline_tag": "",
  "library_name": "",
  "siblings_count": 24
}