Update README.md
Browse files
README.md
CHANGED
|
@@ -25,44 +25,47 @@ datasets:
|
|
| 25 |
|
| 26 |
### Overview
|
| 27 |
|
| 28 |
-
This model is a fine-tuned version of `unsloth/mistral-7b-bnb-4bit`, a 7-billion-parameter model based on the Mistral architecture. It was
|
| 29 |
|
| 30 |
-
The fine-tuning process leveraged the **Unsloth** framework, which
|
| 31 |
|
| 32 |
### Training Details
|
| 33 |
|
| 34 |
- **Base Model:** `unsloth/mistral-7b-bnb-4bit` (7B parameters, 4-bit quantized weights for memory efficiency)
|
| 35 |
-
- **Training Speed:** The model was trained **2x faster** with Unsloth,
|
| 36 |
-
- **Optimization Techniques:**
|
| 37 |
|
| 38 |
### Intended Use
|
| 39 |
|
| 40 |
-
This model is
|
| 41 |
- Sentiment analysis
|
| 42 |
- Text classification
|
| 43 |
- Fine-grained NLP tasks
|
| 44 |
|
| 45 |
-
It is
|
| 46 |
|
| 47 |
### Model Performance
|
| 48 |
|
| 49 |
- **Primary Metric:** Accuracy on text classification tasks (Stanford IMDb dataset)
|
| 50 |
-
- **Fine-Tuning Results:**
|
| 51 |
|
| 52 |
### Usage
|
| 53 |
|
| 54 |
-
To use the model, you can
|
| 55 |
|
| 56 |
```python
|
| 57 |
-
from
|
| 58 |
|
|
|
|
| 59 |
model_name = "shaheennabi/your-finetuned-mistral-7b-imdb"
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
model =
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
|
|
|
|
|
|
| 66 |
|
| 67 |
# Example of using the model for inference
|
| 68 |
input_text = "This movie was fantastic!"
|
|
|
|
| 25 |
|
| 26 |
### Overview
|
| 27 |
|
| 28 |
+
This model is a fine-tuned version of `unsloth/mistral-7b-bnb-4bit`, a 7-billion-parameter model based on the Mistral architecture. It was fine-tuned to improve performance on natural language understanding tasks, specifically for text classification using the Stanford IMDb dataset.
|
| 29 |
|
| 30 |
+
The fine-tuning process leveraged the **Unsloth** framework, which significantly sped up the training time, enabling a **2x faster training** process. Additionally, Hugging Face's **TRL library** (Transformers Reinforcement Learning) was used to adapt the model efficiently.
|
| 31 |
|
| 32 |
### Training Details
|
| 33 |
|
| 34 |
- **Base Model:** `unsloth/mistral-7b-bnb-4bit` (7B parameters, 4-bit quantized weights for memory efficiency)
|
| 35 |
+
- **Training Speed:** The model was trained **2x faster** with Unsloth, optimizing training time and resource usage.
|
| 36 |
+
- **Optimization Techniques:** Low-rank adaptation (LoRA), gradient checkpointing, and 4-bit quantization were employed to reduce memory and computational cost while maintaining model performance.
|
| 37 |
|
| 38 |
### Intended Use
|
| 39 |
|
| 40 |
+
This model is designed for tasks such as:
|
| 41 |
- Sentiment analysis
|
| 42 |
- Text classification
|
| 43 |
- Fine-grained NLP tasks
|
| 44 |
|
| 45 |
+
It is optimized for deployment in resource-constrained environments due to the quantization of the base model and fine-tuning techniques used.
|
| 46 |
|
| 47 |
### Model Performance
|
| 48 |
|
| 49 |
- **Primary Metric:** Accuracy on text classification tasks (Stanford IMDb dataset)
|
| 50 |
+
- **Fine-Tuning Results:** The fine-tuned model shows improved accuracy, making it a practical choice for NLP applications.
|
| 51 |
|
| 52 |
### Usage
|
| 53 |
|
| 54 |
+
To use the model, you can load it using the `FastLanguageModel` class as follows:
|
| 55 |
|
| 56 |
```python
|
| 57 |
+
from unsloth import FastLanguageModel
|
| 58 |
|
| 59 |
+
# Load the fine-tuned model and tokenizer
|
| 60 |
model_name = "shaheennabi/your-finetuned-mistral-7b-imdb"
|
| 61 |
+
max_seq_length = 512 # Set according to your requirements
|
| 62 |
+
|
| 63 |
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
| 64 |
+
model_name=model_name,
|
| 65 |
+
max_seq_length=max_seq_length,
|
| 66 |
+
dtype=None,
|
| 67 |
+
load_in_4bit=True
|
| 68 |
+
)
|
| 69 |
|
| 70 |
# Example of using the model for inference
|
| 71 |
input_text = "This movie was fantastic!"
|