devshaheen commited on
Commit
453c8e3
·
verified ·
1 Parent(s): 45f25ac

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +18 -15
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 trained 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 speeds up training times significantly, enabling a **2x faster training** process compared to traditional methods. 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, making it a more practical solution for large-scale fine-tuning.
36
- - **Optimization Techniques:** Use of low-rank adaptation (LoRA), gradient checkpointing, and 4-bit quantization to reduce memory and computational cost while maintaining model performance.
37
 
38
  ### Intended Use
39
 
40
- This model is intended for tasks like:
41
  - Sentiment analysis
42
  - Text classification
43
  - Fine-grained NLP tasks
44
 
45
- It is well-suited for environments with limited resources, thanks to the quantization of the base model and fine-tuning techniques employed.
46
 
47
  ### Model Performance
48
 
49
  - **Primary Metric:** Accuracy on text classification tasks (Stanford IMDb dataset)
50
- - **Fine-Tuning Results:** This fine-tuned model achieved a notable improvement in accuracy, making it suitable for deployment in real-world NLP applications.
51
 
52
  ### Usage
53
 
54
- To use the model, you can directly load it using Hugging Face's Transformers library, with the following code:
55
 
56
  ```python
57
- from transformers import AutoModelForSequenceClassification, AutoTokenizer
58
 
 
59
  model_name = "shaheennabi/your-finetuned-mistral-7b-imdb"
60
-
61
- # Load the fine-tuned model
62
- model = AutoModelForSequenceClassification.from_pretrained(model_name)
63
-
64
- # Load tokenizer
65
- tokenizer = AutoTokenizer.from_pretrained(model_name)
 
 
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!"