Update README.md
Browse files
README.md
CHANGED
|
@@ -12,7 +12,7 @@ base_model:
|
|
| 12 |
# Model Card for Model ID
|
| 13 |
|
| 14 |
AddaGPT 2.0 is a Bengali language model based on GPT-2, fine-tuned using LoRA adapters for academic and low-resource applications. While GPT-2 was originally trained only on English data, this model has been adapted to Bengali using the AI4Bharat NaamaPadam dataset — a corpus focused on Named Entity Recognition (NER).
|
| 15 |
-
This project is intended as a proof of concept to explore how small, pretrained models like GPT-2 can be extended to Indic languages using low-rank adaptation (LoRA) techniques, even under limited compute settings (e.g., free Kaggle GPUs). It lays the foundation for future work in adapting language models for low-bandwidth, regional, and offline-first use cases —
|
| 16 |
|
| 17 |
## Model Details
|
| 18 |
| **Attribute** | **Description** |
|
|
@@ -32,89 +32,77 @@ This project is intended as a proof of concept to explore how small, pretrained
|
|
| 32 |
|
| 33 |
### Model Description
|
| 34 |
|
| 35 |
-
|
| 36 |
-
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
| 37 |
-
|
| 38 |
- **Developed by:** Swastik Guha Roy
|
| 39 |
-
- **Funded by
|
| 40 |
-
- **Shared by [optional]:** [More Information Needed]
|
| 41 |
-
- **Model type:** [More Information Needed]
|
| 42 |
-
- **Language(s) (NLP):** [More Information Needed]
|
| 43 |
-
- **License:** [More Information Needed]
|
| 44 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
| 45 |
|
| 46 |
-
### Model Sources [optional]
|
| 47 |
|
| 48 |
-
|
| 49 |
|
| 50 |
-
-
|
| 51 |
-
- **Paper [optional]:** [More Information Needed]
|
| 52 |
-
- **Demo [optional]:** [More Information Needed]
|
| 53 |
|
| 54 |
-
|
|
|
|
| 55 |
|
| 56 |
-
|
| 57 |
|
| 58 |
-
|
| 59 |
|
| 60 |
-
|
| 61 |
|
| 62 |
-
|
| 63 |
|
| 64 |
-
###
|
| 65 |
|
| 66 |
-
|
| 67 |
|
| 68 |
-
|
| 69 |
|
| 70 |
-
|
| 71 |
|
| 72 |
-
|
| 73 |
|
| 74 |
-
[More Information Needed]
|
| 75 |
|
| 76 |
-
##
|
| 77 |
|
| 78 |
This model is not capable of generating grammatically or syntactically correct Bengali sentences. Instead, it outputs individual Bengali words or word-like tokens that are often meaningful on their own — a direct result of training on a NER-style dataset rather than full natural language text.
|
| 79 |
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
| 83 |
-
|
| 84 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
| 85 |
-
|
| 86 |
-
## How to Get Started with the Model
|
| 87 |
-
|
| 88 |
-
Use the code below to get started with the model.
|
| 89 |
-
|
| 90 |
-
[More Information Needed]
|
| 91 |
-
|
| 92 |
-
## Training Details
|
| 93 |
-
|
| 94 |
-
### Training Data
|
| 95 |
-
|
| 96 |
-
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
| 97 |
-
|
| 98 |
-
[More Information Needed]
|
| 99 |
-
|
| 100 |
-
### Training Procedure
|
| 101 |
-
|
| 102 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
| 103 |
-
|
| 104 |
-
#### Preprocessing [optional]
|
| 105 |
|
| 106 |
-
|
| 107 |
|
|
|
|
| 108 |
|
| 109 |
-
#### Training Hyperparameters
|
| 110 |
|
| 111 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
| 112 |
|
| 113 |
-
|
| 114 |
|
| 115 |
-
|
|
|
|
|
|
|
|
|
|
| 116 |
|
| 117 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
|
| 119 |
## Evaluation
|
| 120 |
|
|
@@ -122,94 +110,18 @@ Use the code below to get started with the model.
|
|
| 122 |
|
| 123 |
### Testing Data, Factors & Metrics
|
| 124 |
|
| 125 |
-
#### Testing Data
|
| 126 |
-
|
| 127 |
-
<!-- This should link to a Dataset Card if possible. -->
|
| 128 |
-
|
| 129 |
-
[More Information Needed]
|
| 130 |
-
|
| 131 |
-
#### Factors
|
| 132 |
-
|
| 133 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
| 134 |
-
|
| 135 |
-
[More Information Needed]
|
| 136 |
-
|
| 137 |
-
#### Metrics
|
| 138 |
-
|
| 139 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
| 140 |
-
|
| 141 |
-
[More Information Needed]
|
| 142 |
-
|
| 143 |
### Results
|
| 144 |
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
#### Summary
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
## Model Examination [optional]
|
| 152 |
-
|
| 153 |
-
<!-- Relevant interpretability work for the model goes here -->
|
| 154 |
-
|
| 155 |
-
[More Information Needed]
|
| 156 |
-
|
| 157 |
-
## Environmental Impact
|
| 158 |
-
|
| 159 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
| 160 |
-
|
| 161 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
| 162 |
-
|
| 163 |
-
- **Hardware Type:** [More Information Needed]
|
| 164 |
-
- **Hours used:** [More Information Needed]
|
| 165 |
-
- **Cloud Provider:** [More Information Needed]
|
| 166 |
-
- **Compute Region:** [More Information Needed]
|
| 167 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 168 |
-
|
| 169 |
-
## Technical Specifications [optional]
|
| 170 |
-
|
| 171 |
-
### Model Architecture and Objective
|
| 172 |
-
|
| 173 |
-
[More Information Needed]
|
| 174 |
-
|
| 175 |
-
### Compute Infrastructure
|
| 176 |
-
|
| 177 |
-
[More Information Needed]
|
| 178 |
-
|
| 179 |
-
#### Hardware
|
| 180 |
-
|
| 181 |
-
[More Information Needed]
|
| 182 |
-
|
| 183 |
-
#### Software
|
| 184 |
-
|
| 185 |
-
[More Information Needed]
|
| 186 |
-
|
| 187 |
-
## Citation [optional]
|
| 188 |
-
|
| 189 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 190 |
-
|
| 191 |
-
**BibTeX:**
|
| 192 |
-
|
| 193 |
-
[More Information Needed]
|
| 194 |
-
|
| 195 |
-
**APA:**
|
| 196 |
-
|
| 197 |
-
[More Information Needed]
|
| 198 |
-
|
| 199 |
-
## Glossary [optional]
|
| 200 |
-
|
| 201 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
| 202 |
-
|
| 203 |
-
[More Information Needed]
|
| 204 |
-
|
| 205 |
-
## More Information [optional]
|
| 206 |
-
|
| 207 |
-
[More Information Needed]
|
| 208 |
|
| 209 |
-
##
|
|
|
|
|
|
|
|
|
|
| 210 |
|
| 211 |
-
|
| 212 |
|
| 213 |
-
##
|
| 214 |
|
| 215 |
-
|
|
|
|
|
|
| 12 |
# Model Card for Model ID
|
| 13 |
|
| 14 |
AddaGPT 2.0 is a Bengali language model based on GPT-2, fine-tuned using LoRA adapters for academic and low-resource applications. While GPT-2 was originally trained only on English data, this model has been adapted to Bengali using the AI4Bharat NaamaPadam dataset — a corpus focused on Named Entity Recognition (NER).
|
| 15 |
+
This project is intended as a proof of concept to explore how small, pretrained models like GPT-2 can be extended to Indic languages using low-rank adaptation (LoRA) techniques, even under limited compute settings (e.g., free Kaggle GPUs). It lays the foundation for future work in adapting language models for low-bandwidth, regional, and offline-first use cases — to support local communities.
|
| 16 |
|
| 17 |
## Model Details
|
| 18 |
| **Attribute** | **Description** |
|
|
|
|
| 32 |
|
| 33 |
### Model Description
|
| 34 |
|
|
|
|
|
|
|
|
|
|
| 35 |
- **Developed by:** Swastik Guha Roy
|
| 36 |
+
- **Funded by :** Self Funded
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
|
|
|
| 38 |
|
| 39 |
+
### Uses
|
| 40 |
|
| 41 |
+
AddaGPT 2.0 is an academic proof-of-concept project designed to explore how low-resource, low-compute setups (like Kaggle T4 GPUs) can be used to adapt large language models like GPT-2 for Indic languages, specifically Bengali.
|
|
|
|
|
|
|
| 42 |
|
| 43 |
+
### Intended Use Cases:
|
| 44 |
+
Academic research on low-rank adaptation (LoRA) for regional languages
|
| 45 |
|
| 46 |
+
Language modeling experimentation in Bengali
|
| 47 |
|
| 48 |
+
Demonstration of fine-tuning techniques in resource-constrained environments
|
| 49 |
|
| 50 |
+
Baseline comparison for future Bengali language model development
|
| 51 |
|
| 52 |
+
Educational purposes for students and ML enthusiasts working on low-resource NLP
|
| 53 |
|
| 54 |
+
### Intended Users:
|
| 55 |
|
| 56 |
+
ML/NLP researchers exploring parameter-efficient tuning
|
| 57 |
|
| 58 |
+
Students building regional language models
|
| 59 |
|
| 60 |
+
Developers prototyping Bengali language tools (with limitations)
|
| 61 |
|
| 62 |
+
Community contributors interested in advancing open-source Bengali AI
|
| 63 |
|
|
|
|
| 64 |
|
| 65 |
+
## Limitations
|
| 66 |
|
| 67 |
This model is not capable of generating grammatically or syntactically correct Bengali sentences. Instead, it outputs individual Bengali words or word-like tokens that are often meaningful on their own — a direct result of training on a NER-style dataset rather than full natural language text.
|
| 68 |
|
| 69 |
+
->This version does not produce grammatically coherent Bengali sentences
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
|
| 71 |
+
->It's trained on a NER dataset, so it mostly outputs individual Bengali words
|
| 72 |
|
| 73 |
+
->It is not suitable for downstream tasks like summarization, translation, or question-answering — yet
|
| 74 |
|
|
|
|
| 75 |
|
|
|
|
| 76 |
|
| 77 |
+
### How to Get Started with the Model
|
| 78 |
|
| 79 |
+
# Load Nessecary Libraries
|
| 80 |
+
```python
|
| 81 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
|
| 82 |
+
```
|
| 83 |
|
| 84 |
+
# Load the model and tokenizer
|
| 85 |
+
```python
|
| 86 |
+
model = AutoModelForCausalLM.from_pretrained("SwastikGuhaRoy/AddaGPT2.0")
|
| 87 |
+
tokenizer = AutoTokenizer.from_pretrained("SwastikGuhaRoy/AddaGPT2.0_tokenizer")
|
| 88 |
+
```
|
| 89 |
+
# Initialize generation pipeline
|
| 90 |
+
```python
|
| 91 |
+
text_generator = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
| 92 |
+
```
|
| 93 |
+
# Run inference
|
| 94 |
+
``` python
|
| 95 |
+
prompt = "রবীন্দ্রনাথ ঠাকুর একজন"
|
| 96 |
+
output = text_generator(
|
| 97 |
+
prompt,
|
| 98 |
+
max_new_tokens=30,
|
| 99 |
+
temperature=0.7,
|
| 100 |
+
top_p=0.95,
|
| 101 |
+
do_sample=True
|
| 102 |
+
)
|
| 103 |
+
|
| 104 |
+
print(output[0]["generated_text"])
|
| 105 |
+
```
|
| 106 |
|
| 107 |
## Evaluation
|
| 108 |
|
|
|
|
| 110 |
|
| 111 |
### Testing Data, Factors & Metrics
|
| 112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
### Results
|
| 114 |
|
| 115 |
+
The model was evaluated on the validation split of the ai4bharat/naamapadam dataset to measure how well it models Bengali text.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
|
| 117 |
+
## Metric: Perplexity (Lower is Better)
|
| 118 |
+
Model Validation Perplexity
|
| 119 |
+
AddaGPT 2.0 25.61
|
| 120 |
+
Vanilla GPT-2 (English) 144.53
|
| 121 |
|
| 122 |
+
## AddaGPT 2.0 shows a significantly lower perplexity, indicating a better fit to Bengali text.
|
| 123 |
|
| 124 |
+
## GPT-2 struggles with Bengali due to the lack of Bengali data during pretraining.
|
| 125 |
|
| 126 |
+
## Summary
|
| 127 |
+
Despite lower perplexity, the model still generates mostly isolated Bengali words, not grammatically complete sentences (due to the nature of the training dataset — a NER corpus).
|