natalie-a-1 commited on
Commit
b482329
ยท
1 Parent(s): dba3c92

Refactor README.md to improve model details, technical specifications, and usage guidelines for the Biden Mistral Adapter

Browse files
Files changed (1) hide show
  1. README.md +62 -81
README.md CHANGED
@@ -1,6 +1,4 @@
1
  ---
2
- base_model: mistralai/Mistral-7B-Instruct-v0.2
3
- library_name: peft
4
  language:
5
  - en
6
  tags:
@@ -14,102 +12,86 @@ license: mit
14
  datasets:
15
  - rohanrao/joe-biden-tweets
16
  - christianlillelund/joe-biden-2020-dnc-speech
 
 
17
  ---
18
 
19
- <div align="center">
20
-
21
  # ๐Ÿ‡บ๐Ÿ‡ธ Biden Mistral Adapter ๐Ÿ‡บ๐Ÿ‡ธ
22
 
23
- **A finely-tuned Mistral adapter that captures the distinctive voice, speaking style, and rhetoric of President Joe Biden**
24
-
25
- </div>
26
-
27
- ---
28
-
29
- ## ๐Ÿ“‹ Model Overview
30
-
31
- This LoRA adapter for [Mistral-7B-Instruct-v0.2](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2) has been crafted to emulate Joe Biden's unique communication patterns, discourse style, and policy framing.
32
-
33
- ### โš™๏ธ Technical Specifications
34
-
35
- | **Feature** | **Details** |
36
- |:---------------:|:--------------------------------------------------:|
37
- | Base Model | mistralai/Mistral-7B-Instruct-v0.2 |
38
- | Adapter Type | LoRA (Low-Rank Adaptation) |
39
- | LoRA Rank | 16 |
40
- | Primary Language| English |
41
- | Special Feature | Merged weights from style and identity LoRA adapters|
42
-
43
- ---
44
 
45
- ## ๐Ÿ”„ Model Evolution
46
 
47
- This enhanced version combines two carefully balanced adapter components:
48
 
49
- - ๐ŸŽญ **Style Adapter**: The original Biden-style adapter (nnat03/biden-mistral-adapter)
50
- - ๐Ÿง  **Identity Adapter**: Custom identity adapter (biden-identity-adapter)
 
 
 
 
 
 
51
 
52
- This merged approach produces more coherent and contextually appropriate responses while preserving Biden's characteristic voice, rhetorical patterns, and speaking cadence.
53
 
54
- ---
55
-
56
- ## ๐ŸŽฏ Intended Applications
57
-
58
- - ๐ŸŽ“ **Educational**: Research on political discourse and communication styles
59
- - ๐Ÿ” **Analytical**: Interactive simulations for rhetoric analysis
60
- - ๐ŸŽจ **Creative**: Content development exploring political communication
61
-
62
- ---
 
 
 
 
 
63
 
64
- ## ๐Ÿ“š Training Data
65
 
66
- The model was fine-tuned on two comprehensive datasets:
67
 
68
- - ๐Ÿ“ฑ **Biden Twitter Archive** ([2007-2020](https://www.kaggle.com/datasets/rohanrao/joe-biden-tweets)): Capturing everyday communication style
69
- - ๐ŸŽค **DNC Acceptance Speech** ([2020](https://www.kaggle.com/datasets/christianlillelund/joe-biden-2020-dnc-speech)): Formal oratorical patterns
70
 
71
- ---
72
 
73
- ## ๐Ÿ› ๏ธ Training Process
74
 
75
- ### ๐Ÿ”ง Technical Framework
76
- - **Libraries**: Hugging Face Transformers and PEFT
77
- - **Optimization**: 4-bit quantization for efficiency
78
 
79
- ### ๐Ÿ” LoRA Configuration
80
  ```
81
- r=16
82
- lora_alpha=64
83
- lora_dropout=0.05
 
84
  ```
85
 
86
- ### ๐ŸŽ›๏ธ Target Modules
87
- - q_proj, k_proj, v_proj, o_proj
88
- - gate_proj, up_proj, down_proj
89
-
90
- ### โš—๏ธ Training Parameters
91
- | **Parameter** | **Value** |
92
- |:------------:|:---------:|
93
- | Batch Size | 4 |
94
- | Gradient Accumulation | 4 |
95
- | Learning Rate | 2e-4 |
96
- | Epochs | 3 |
97
- | LR Scheduler | cosine |
98
- | Optimizer | paged_adamw_8bit |
99
- | Precision | BF16 |
100
 
101
- ---
 
 
 
 
 
 
 
 
102
 
103
- ## โš ๏ธ Limitations and Considerations
104
 
105
- - ๐ŸŽญ This model mimics a speaking style but may not provide factually accurate information
106
- - ๐Ÿ—ฃ๏ธ While it emulates Biden's rhetoric, it does not represent his actual views
107
- - ๐Ÿ”„ The model may reproduce biases present in the training data
108
- - ๐Ÿ“Š Not suitable for production applications without RAG enhancement for factual accuracy
109
 
110
- ---
111
 
112
- ## ๐Ÿ’ป Implementation Guide
113
 
114
  ```python
115
  from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
@@ -146,9 +128,9 @@ response = tokenizer.decode(outputs[0], skip_special_tokens=True)
146
  print(response.split("[/INST]")[-1].strip())
147
  ```
148
 
149
- ---
150
 
151
- ## ๐Ÿ“ Citation
152
 
153
  ```bibtex
154
  @misc{nnat03-biden-mistral-adapter,
@@ -160,14 +142,13 @@ print(response.split("[/INST]")[-1].strip())
160
  }
161
  ```
162
 
163
- ---
164
-
165
- ## ๐Ÿ” Ethical Usage
166
 
167
- This model is intended for educational and research purposes only. It mimics the speaking style of a public figure but does not represent their actual views or statements. Please use responsibly.
168
 
169
  ---
170
 
171
  <div align="center">
172
- <b>Framework version:</b> PEFT 0.15.0
 
173
  </div>
 
1
  ---
 
 
2
  language:
3
  - en
4
  tags:
 
12
  datasets:
13
  - rohanrao/joe-biden-tweets
14
  - christianlillelund/joe-biden-2020-dnc-speech
15
+ base_model: mistralai/Mistral-7B-Instruct-v0.2
16
+ library_name: peft
17
  ---
18
 
 
 
19
  # ๐Ÿ‡บ๐Ÿ‡ธ Biden Mistral Adapter ๐Ÿ‡บ๐Ÿ‡ธ
20
 
21
+ > *"Look, folks, this adapter, it's about our common purpose, our shared values. That's no joke."*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
 
23
+ This LoRA adapter for [Mistral-7B-Instruct-v0.2](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2) has been fine-tuned to emulate Joe Biden's distinctive speaking style, discourse patterns, and policy positions. The model captures the measured cadence, personal anecdotes, and characteristic expressions associated with the current U.S. President.
24
 
25
+ ## โœจ Model Details
26
 
27
+ | Feature | Description |
28
+ |---------|-------------|
29
+ | **Base Model** | [mistralai/Mistral-7B-Instruct-v0.2](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2) |
30
+ | **Architecture** | LoRA adapter (Low-Rank Adaptation) |
31
+ | **LoRA Rank** | 16 |
32
+ | **Language** | English |
33
+ | **Training Focus** | Biden's communication style, rhetoric, and response patterns |
34
+ | **Merged Adapters** | Combines style and identity LoRA weights from:<br>- nnat03/biden-mistral-adapter (original adapter)<br>- ./identity-adapters/biden-identity-adapter |
35
 
36
+ ## ๐ŸŽฏ Intended Use
37
 
38
+ <div align="center">
39
+ <table>
40
+ <tr>
41
+ <td align="center">๐Ÿ“š <b>Education</b></td>
42
+ <td align="center">๐Ÿ” <b>Research</b></td>
43
+ <td align="center">๐ŸŽญ <b>Creative</b></td>
44
+ </tr>
45
+ <tr>
46
+ <td>Political discourse analysis</td>
47
+ <td>Rhetoric pattern studies</td>
48
+ <td>Interactive simulations</td>
49
+ </tr>
50
+ </table>
51
+ </div>
52
 
53
+ ## ๐Ÿ“Š Training Data
54
 
55
+ This model was trained on carefully curated datasets that capture authentic speech patterns:
56
 
57
+ - ๐Ÿ“ฑ [Biden tweets dataset (2007-2020)](https://www.kaggle.com/datasets/rohanrao/joe-biden-tweets) - Extensive collection capturing everyday communication
58
+ - ๐ŸŽค [Biden 2020 DNC speech dataset](https://www.kaggle.com/datasets/christianlillelund/joe-biden-2020-dnc-speech) - Formal oratorical patterns
59
 
60
+ These datasets were processed into a specialized instruction format to optimize learning of distinctive speech patterns.
61
 
62
+ ## โš™๏ธ Technical Specifications
63
 
64
+ ### Training Configuration
 
 
65
 
 
66
  ```
67
+ ๐Ÿง  Framework: Hugging Face Transformers + PEFT
68
+ ๐Ÿ“Š Optimization: 4-bit quantization
69
+ ๐Ÿ”ง LoRA Config: r=16, alpha=64, dropout=0.05
70
+ ๐ŸŽ›๏ธ Target modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
71
  ```
72
 
73
+ ### Training Parameters
 
 
 
 
 
 
 
 
 
 
 
 
 
74
 
75
+ ```
76
+ ๐Ÿ“ฆ Batch size: 4
77
+ ๐Ÿ”„ Gradient accumulation: 4
78
+ ๐Ÿ“ˆ Learning rate: 2e-4
79
+ ๐Ÿ” Epochs: 3
80
+ ๐Ÿ“‰ LR scheduler: cosine
81
+ โšก Optimizer: paged_adamw_8bit
82
+ ๐Ÿงฎ Precision: BF16
83
+ ```
84
 
85
+ ## โš ๏ธ Limitations and Biases
86
 
87
+ - This model mimics a speaking style but doesn't guarantee factual accuracy
88
+ - While emulating Biden's rhetoric, it doesn't represent his actual views
89
+ - May reproduce biases present in the training data
90
+ - Not suitable for production applications without additional fact-checking
91
 
92
+ ## ๐Ÿ’ป Usage
93
 
94
+ Run this code to start using the adapter with the Mistral-7B-Instruct-v0.2 base model:
95
 
96
  ```python
97
  from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
 
128
  print(response.split("[/INST]")[-1].strip())
129
  ```
130
 
131
+ ## ๐Ÿ“š Citation
132
 
133
+ If you use this model in your research, please cite:
134
 
135
  ```bibtex
136
  @misc{nnat03-biden-mistral-adapter,
 
142
  }
143
  ```
144
 
145
+ ## ๐Ÿ” Ethical Considerations
 
 
146
 
147
+ This model is created for educational and research purposes. It attempts to mimic the speaking style of a public figure but does not represent their actual views or statements. Use responsibly.
148
 
149
  ---
150
 
151
  <div align="center">
152
+ <p><b>Framework version:</b> PEFT 0.15.0</p>
153
+ <p>Made with โค๏ธ for NLP research and education</p>
154
  </div>