Update README.md
Browse files
README.md
CHANGED
|
@@ -1,199 +1,128 @@
|
|
|
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
| 3 |
-
tags: []
|
| 4 |
---
|
| 5 |
|
| 6 |
-
#
|
| 7 |
-
|
| 8 |
-
<!-- Provide a quick summary of what the model is/does. -->
|
| 9 |
-
|
| 10 |
|
|
|
|
| 11 |
|
| 12 |
## Model Details
|
| 13 |
|
| 14 |
### Model Description
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
| 19 |
|
| 20 |
-
- **Developed by:**
|
| 21 |
-
- **
|
| 22 |
-
- **
|
| 23 |
-
- **
|
| 24 |
-
- **
|
| 25 |
-
- **
|
| 26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
| 27 |
|
| 28 |
-
### Model Sources
|
| 29 |
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
- **
|
| 33 |
-
- **Paper [optional]:** [More Information Needed]
|
| 34 |
-
- **Demo [optional]:** [More Information Needed]
|
| 35 |
|
| 36 |
## Uses
|
| 37 |
|
| 38 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
| 39 |
-
|
| 40 |
### Direct Use
|
| 41 |
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
[More Information Needed]
|
| 45 |
|
| 46 |
-
### Downstream Use
|
| 47 |
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
[More Information Needed]
|
| 51 |
|
| 52 |
### Out-of-Scope Use
|
| 53 |
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
|
| 58 |
## Bias, Risks, and Limitations
|
| 59 |
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
### Recommendations
|
| 65 |
-
|
| 66 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
| 67 |
-
|
| 68 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
| 69 |
|
| 70 |
## How to Get Started with the Model
|
| 71 |
|
| 72 |
-
|
|
|
|
| 73 |
|
| 74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
|
| 76 |
## Training Details
|
| 77 |
|
| 78 |
### Training Data
|
| 79 |
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
[More Information Needed]
|
| 83 |
|
| 84 |
### Training Procedure
|
| 85 |
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
[More Information Needed]
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
#### Training Hyperparameters
|
| 94 |
-
|
| 95 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
| 96 |
|
| 97 |
-
|
| 98 |
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
|
| 103 |
## Evaluation
|
| 104 |
|
| 105 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 106 |
-
|
| 107 |
### Testing Data, Factors & Metrics
|
| 108 |
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
<!-- This should link to a Dataset Card if possible. -->
|
| 112 |
-
|
| 113 |
-
[More Information Needed]
|
| 114 |
-
|
| 115 |
-
#### Factors
|
| 116 |
-
|
| 117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
| 118 |
-
|
| 119 |
-
[More Information Needed]
|
| 120 |
-
|
| 121 |
-
#### Metrics
|
| 122 |
-
|
| 123 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
| 124 |
-
|
| 125 |
-
[More Information Needed]
|
| 126 |
-
|
| 127 |
-
### Results
|
| 128 |
-
|
| 129 |
-
[More Information Needed]
|
| 130 |
-
|
| 131 |
-
#### Summary
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
## Model Examination [optional]
|
| 136 |
-
|
| 137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
| 138 |
-
|
| 139 |
-
[More Information Needed]
|
| 140 |
|
| 141 |
## Environmental Impact
|
| 142 |
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
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).
|
| 146 |
|
| 147 |
-
|
| 148 |
-
- **Hours used:** [More Information Needed]
|
| 149 |
-
- **Cloud Provider:** [More Information Needed]
|
| 150 |
-
- **Compute Region:** [More Information Needed]
|
| 151 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 152 |
-
|
| 153 |
-
## Technical Specifications [optional]
|
| 154 |
|
| 155 |
### Model Architecture and Objective
|
| 156 |
|
| 157 |
-
|
|
|
|
| 158 |
|
| 159 |
### Compute Infrastructure
|
| 160 |
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
#### Hardware
|
| 164 |
-
|
| 165 |
-
[More Information Needed]
|
| 166 |
-
|
| 167 |
-
#### Software
|
| 168 |
-
|
| 169 |
-
[More Information Needed]
|
| 170 |
-
|
| 171 |
-
## Citation [optional]
|
| 172 |
-
|
| 173 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 174 |
-
|
| 175 |
-
**BibTeX:**
|
| 176 |
-
|
| 177 |
-
[More Information Needed]
|
| 178 |
-
|
| 179 |
-
**APA:**
|
| 180 |
-
|
| 181 |
-
[More Information Needed]
|
| 182 |
-
|
| 183 |
-
## Glossary [optional]
|
| 184 |
-
|
| 185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
| 186 |
|
| 187 |
-
|
| 188 |
|
| 189 |
-
|
| 190 |
|
| 191 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 192 |
|
| 193 |
-
## Model Card Authors
|
| 194 |
|
| 195 |
-
|
| 196 |
|
| 197 |
## Model Card Contact
|
| 198 |
|
| 199 |
-
|
|
|
|
| 1 |
+
|
| 2 |
---
|
| 3 |
library_name: transformers
|
| 4 |
+
tags: [causal-lm, text-generation, fine-tuned, falcon, lora, imdb, sentiment-analysis]
|
| 5 |
---
|
| 6 |
|
| 7 |
+
# Falcon-RW-1B Fine-tuned with LoRA on IMDb Sentiment Dataset
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
+
This is a Falcon-RW-1B language model fine-tuned using LoRA (Low-Rank Adaptation) for causal language modeling, trained on a subset of the IMDb movie reviews dataset for sentiment-related text generation tasks.
|
| 10 |
|
| 11 |
## Model Details
|
| 12 |
|
| 13 |
### Model Description
|
| 14 |
|
| 15 |
+
This model is based on the Falcon-RW-1B pretrained causal language model, fine-tuned with parameter-efficient LoRA adapters targeting the "query_key_value" modules. Training was performed on a small subset of the IMDb dataset (1,000 samples) with sequences truncated/padded to 128 tokens.
|
|
|
|
|
|
|
| 16 |
|
| 17 |
+
- **Developed by:** Sujith Somanunnithan
|
| 18 |
+
- **Model type:** Causal Language Model (Transformer)
|
| 19 |
+
- **Language:** English
|
| 20 |
+
- **License:** Apache 2.0
|
| 21 |
+
- **Finetuned from:** `tiiuae/falcon-rw-1b`
|
| 22 |
+
- **Fine-tuning method:** LoRA (using PEFT library)
|
|
|
|
| 23 |
|
| 24 |
+
### Model Sources
|
| 25 |
|
| 26 |
+
- **Repository:** [Insert your Hugging Face repo URL here]
|
| 27 |
+
- **Base model:** https://huggingface.co/tiiuae/falcon-rw-1b
|
| 28 |
+
- **Dataset:** IMDb movie reviews — https://huggingface.co/datasets/imdb
|
|
|
|
|
|
|
| 29 |
|
| 30 |
## Uses
|
| 31 |
|
|
|
|
|
|
|
| 32 |
### Direct Use
|
| 33 |
|
| 34 |
+
This model can be used for generating or completing English text sequences related to movie reviews, sentiment analysis prompts, or similar NLP causal language modeling tasks.
|
|
|
|
|
|
|
| 35 |
|
| 36 |
+
### Downstream Use
|
| 37 |
|
| 38 |
+
The LoRA adapters allow further parameter-efficient fine-tuning for other NLP tasks or domain adaptation, leveraging the Falcon-RW-1B base.
|
|
|
|
|
|
|
| 39 |
|
| 40 |
### Out-of-Scope Use
|
| 41 |
|
| 42 |
+
- This model is **not optimized for zero-shot classification or tasks outside of causal language modeling.**
|
| 43 |
+
- Not suitable for languages other than English.
|
| 44 |
+
- The small training subset limits generalization; performance on real-world text may vary.
|
| 45 |
|
| 46 |
## Bias, Risks, and Limitations
|
| 47 |
|
| 48 |
+
- The base Falcon-RW-1B model inherits biases present in the pretraining data.
|
| 49 |
+
- The fine-tuning on IMDb is limited in scope and size; results may be biased toward movie review sentiment.
|
| 50 |
+
- Use caution when deploying in production or sensitive applications.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
## How to Get Started with the Model
|
| 53 |
|
| 54 |
+
```python
|
| 55 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 56 |
|
| 57 |
+
model_id = "your-hf-username/your-falcon-lora-model"
|
| 58 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 59 |
+
model = AutoModelForCausalLM.from_pretrained(model_id)
|
| 60 |
+
|
| 61 |
+
inputs = tokenizer("The movie was", return_tensors="pt")
|
| 62 |
+
outputs = model.generate(**inputs, max_length=50)
|
| 63 |
+
print(tokenizer.decode(outputs[0]))
|
| 64 |
+
```
|
| 65 |
|
| 66 |
## Training Details
|
| 67 |
|
| 68 |
### Training Data
|
| 69 |
|
| 70 |
+
- Dataset: IMDb movie reviews (subset of 1000 training samples)
|
| 71 |
+
- Text sequences truncated/padded to max length 128
|
|
|
|
| 72 |
|
| 73 |
### Training Procedure
|
| 74 |
|
| 75 |
+
- Fine-tuned on Falcon-RW-1B using LoRA adapters targeting "query_key_value"
|
| 76 |
+
- Training arguments: batch size 2, gradient accumulation 4, 1 epoch, mixed precision (fp16)
|
| 77 |
+
- Trainer API from Hugging Face Transformers with PEFT integration
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
|
| 79 |
+
### Training Hyperparameters
|
| 80 |
|
| 81 |
+
- LoRA config: r=8, lora_alpha=16, dropout=0.1
|
| 82 |
+
- Optimized with AdamW (default Trainer)
|
| 83 |
+
- Single epoch training on a small dataset for demonstration
|
| 84 |
|
| 85 |
## Evaluation
|
| 86 |
|
|
|
|
|
|
|
| 87 |
### Testing Data, Factors & Metrics
|
| 88 |
|
| 89 |
+
- No formal evaluation metrics reported for this demo model
|
| 90 |
+
- Intended for proof-of-concept fine-tuning and further downstream adaptation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
|
| 92 |
## Environmental Impact
|
| 93 |
|
| 94 |
+
- Training performed on a GPU-enabled machine with mixed precision to reduce energy consumption.
|
| 95 |
+
- Approximate compute and carbon footprint unknown; training on a small subset minimizes impact.
|
|
|
|
| 96 |
|
| 97 |
+
## Technical Specifications
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
### Model Architecture and Objective
|
| 100 |
|
| 101 |
+
- Falcon-RW-1B causal LM architecture based on transformer decoder blocks
|
| 102 |
+
- Objective: language modeling via cross-entropy loss on next-token prediction
|
| 103 |
|
| 104 |
### Compute Infrastructure
|
| 105 |
|
| 106 |
+
- Training performed on a single GPU with mixed precision (fp16)
|
| 107 |
+
- Software: Transformers, PEFT, PyTorch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
|
| 109 |
+
## Citation
|
| 110 |
|
| 111 |
+
If you use this model, please cite:
|
| 112 |
|
| 113 |
+
```
|
| 114 |
+
@misc{somanunnithan2025falconlora,
|
| 115 |
+
title={Falcon-RW-1B fine-tuned with LoRA on IMDb dataset},
|
| 116 |
+
author={Sujith Somanunnithan},
|
| 117 |
+
year={2025},
|
| 118 |
+
howpublished={\url{https://huggingface.co/your-hf-username/your-falcon-lora-model}}
|
| 119 |
+
}
|
| 120 |
+
```
|
| 121 |
|
| 122 |
+
## Model Card Authors
|
| 123 |
|
| 124 |
+
- Sujith Somanunnithan
|
| 125 |
|
| 126 |
## Model Card Contact
|
| 127 |
|
| 128 |
+
- your-email@example.com
|