Upload README.md with huggingface_hub
Browse files
README.md
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
library_name: pytorch
|
3 |
+
license: apache-2.0
|
4 |
+
pipeline_tag: text-generation
|
5 |
+
tags:
|
6 |
+
- llm
|
7 |
+
- generative_ai
|
8 |
+
- android
|
9 |
+
|
10 |
+
---
|
11 |
+
|
12 |
+
![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/ibm_granite_3b_code_instruct/web-assets/model_demo.png)
|
13 |
+
|
14 |
+
# IBM-Granite-3B-Code-Instruct: Optimized for Mobile Deployment
|
15 |
+
## State-of-the-art large language model useful on a variety of code understanding and generation tasks
|
16 |
+
|
17 |
+
Granite-3B-Code-Instruct-2K is a 3B parameter model fine tuned from Granite-3B-Code-Base-2K on a combination of permissively licensed instruction data to enhance instruction following capabilities including logical reasoning and problem-solving skills.
|
18 |
+
|
19 |
+
This is based on the implementation of IBM-Granite-3B-Code-Instruct found
|
20 |
+
[here]({source_repo}). More details on model performance
|
21 |
+
accross various devices, can be found [here](https://aihub.qualcomm.com/models/ibm_granite_3b_code_instruct).
|
22 |
+
|
23 |
+
### Model Details
|
24 |
+
|
25 |
+
- **Model Type:** Text generation
|
26 |
+
- **Model Stats:**
|
27 |
+
- Input sequence length for Prompt Processor: 128
|
28 |
+
- Context length: 2048
|
29 |
+
- Number of parameters: 3.48B
|
30 |
+
- Precision: fp16
|
31 |
+
- Num of key-value heads: 32
|
32 |
+
- Information about the model parts: Prompt Processor and Token Generator are split into 4 parts each. Each corresponding Prompt Processor and Token Generator part share weights.
|
33 |
+
- Prompt processor model size: 7 GB
|
34 |
+
- Prompt processor input (part1): 128 tokens
|
35 |
+
- Prompt processor output (part1): Embeddings output
|
36 |
+
- Prompt processor input (other parts): 128 tokens + KVCache initialized with pad token
|
37 |
+
- Prompt processor output (other parts): 128 output tokens + KVCache for token generator
|
38 |
+
- Token generator model size: 7 GB
|
39 |
+
- Token generator input (part1): 1 token
|
40 |
+
- Token generator output (part1): Embeddings output
|
41 |
+
- Token generator input (other parts): 1 input token + past KVCache
|
42 |
+
- Token generator output (other parts): 1 output token + KVCache for next iteration
|
43 |
+
- Use: Initiate conversation with prompt-processor and then token generator for subsequent iterations.
|
44 |
+
- Supported natural languages: English
|
45 |
+
- Supported programming languages: The Granite code foundation models support 116 programming languages including Python, Javascript, Java, C++, Go, and Rust.
|
46 |
+
- Minimum QNN SDK version required: 2.27.7
|
47 |
+
- TTFT: Time To First Token is the time it takes to generate the first response token. This is expressed as a range because it varies based on the length of the prompt. The lower bound is for a short prompt (up to 128 tokens, i.e., one iteration of the prompt processor) and the upper bound is for a prompt using the full context length (2048 tokens).
|
48 |
+
- Response Rate: Rate of response generation after the first response token.
|
49 |
+
- Tiny MMLU: Tiny MMLU (Massive Multitask Language Understanding) is an English language benchmark designed to measure knowledge acquired during pretraining by evaluating models exclusively in zero-shot and few-shot settings. This makes the benchmark more challenging and more similar to how we evaluate humans.
|
50 |
+
|
51 |
+
| Model | Device | Chipset | Target Runtime | Response Rate (tokens per second) | Time To First Token (range, seconds)
|
52 |
+
|---|---|---|---|---|---|
|
53 |
+
| IBM-Granite-3B-Code | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 5.47 | 0.3262 - 5.2192 | -- | -- |
|
54 |
+
|
55 |
+
|
56 |
+
|
57 |
+
|
58 |
+
## License
|
59 |
+
* The license for the original implementation of IBM-Granite-3B-Code-Instruct can be found [here](https://huggingface.co/datasets/choosealicense/licenses/blob/main/markdown/apache-2.0.md).
|
60 |
+
* The license for the compiled assets for on-device deployment can be found [here](https://huggingface.co/datasets/choosealicense/licenses/blob/main/markdown/apache-2.0.md)
|
61 |
+
|
62 |
+
|
63 |
+
|
64 |
+
## References
|
65 |
+
* [Granite Code Models: A Family of Open Foundation Models for Code Intelligence](https://arxiv.org/abs/2405.04324)
|
66 |
+
* [Source Model Implementation](https://huggingface.co/ibm-granite/granite-3b-code-instruct-2k)
|
67 |
+
|
68 |
+
|
69 |
+
|
70 |
+
## Community
|
71 |
+
* Join [our AI Hub Slack community](https://qualcomm-ai-hub.slack.com/join/shared_invite/zt-2d5zsmas3-Sj0Q9TzslueCjS31eXG2UA#/shared-invite/email) to collaborate, post questions and learn more about on-device AI.
|
72 |
+
* For questions or feedback please [reach out to us](mailto:[email protected]).
|
73 |
+
|
74 |
+
## Usage and Limitations
|
75 |
+
|
76 |
+
Model may not be used for or in connection with any of the following applications:
|
77 |
+
|
78 |
+
- Accessing essential private and public services and benefits;
|
79 |
+
- Administration of justice and democratic processes;
|
80 |
+
- Assessing or recognizing the emotional state of a person;
|
81 |
+
- Biometric and biometrics-based systems, including categorization of persons based on sensitive characteristics;
|
82 |
+
- Education and vocational training;
|
83 |
+
- Employment and workers management;
|
84 |
+
- Exploitation of the vulnerabilities of persons resulting in harmful behavior;
|
85 |
+
- General purpose social scoring;
|
86 |
+
- Law enforcement;
|
87 |
+
- Management and operation of critical infrastructure;
|
88 |
+
- Migration, asylum and border control management;
|
89 |
+
- Predictive policing;
|
90 |
+
- Real-time remote biometric identification in public spaces;
|
91 |
+
- Recommender systems of social media platforms;
|
92 |
+
- Scraping of facial images (from the internet or otherwise); and/or
|
93 |
+
- Subliminal manipulation
|