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
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 |
-
|
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 |
-
|
46 |
|
47 |
-
|
48 |
|
49 |
-
|
50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
-
|
53 |
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
-
##
|
65 |
|
66 |
-
|
67 |
|
68 |
-
- ๐ฑ
|
69 |
-
- ๐ค
|
70 |
|
71 |
-
|
72 |
|
73 |
-
##
|
74 |
|
75 |
-
###
|
76 |
-
- **Libraries**: Hugging Face Transformers and PEFT
|
77 |
-
- **Optimization**: 4-bit quantization for efficiency
|
78 |
|
79 |
-
### ๐ LoRA Configuration
|
80 |
```
|
81 |
-
|
82 |
-
|
83 |
-
|
|
|
84 |
```
|
85 |
|
86 |
-
###
|
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
|
104 |
|
105 |
-
-
|
106 |
-
-
|
107 |
-
-
|
108 |
-
-
|
109 |
|
110 |
-
|
111 |
|
112 |
-
|
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 |
-
|
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
|
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>
|