Update README.md
Browse files
README.md
CHANGED
|
@@ -1,208 +1,77 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
library_name: peft
|
| 4 |
-
pipeline_tag: text-generation
|
| 5 |
-
tags:
|
| 6 |
-
- base_model:adapter:mistralai/Mistral-7B-Instruct-v0.2
|
| 7 |
-
- lora
|
| 8 |
-
- sft
|
| 9 |
-
- trl
|
| 10 |
-
---
|
| 11 |
|
| 12 |
-
|
| 13 |
|
| 14 |
-
|
| 15 |
|
|
|
|
| 16 |
|
|
|
|
| 17 |
|
| 18 |
-
|
| 19 |
|
| 20 |
-
|
| 21 |
|
| 22 |
-
|
|
|
|
|
|
|
| 23 |
|
|
|
|
|
|
|
| 24 |
|
|
|
|
| 25 |
|
| 26 |
-
|
| 27 |
-
- **Funded by [optional]:** [More Information Needed]
|
| 28 |
-
- **Shared by [optional]:** [More Information Needed]
|
| 29 |
-
- **Model type:** [More Information Needed]
|
| 30 |
-
- **Language(s) (NLP):** [More Information Needed]
|
| 31 |
-
- **License:** [More Information Needed]
|
| 32 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
| 33 |
|
| 34 |
-
|
| 35 |
|
| 36 |
-
|
| 37 |
|
| 38 |
-
|
| 39 |
-
- **Paper [optional]:** [More Information Needed]
|
| 40 |
-
- **Demo [optional]:** [More Information Needed]
|
| 41 |
|
| 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 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
| 73 |
-
|
| 74 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
| 75 |
-
|
| 76 |
-
## How to Get Started with the Model
|
| 77 |
-
|
| 78 |
-
Use the code below to get started with the model.
|
| 79 |
-
|
| 80 |
-
[More Information Needed]
|
| 81 |
-
|
| 82 |
-
## Training Details
|
| 83 |
-
|
| 84 |
-
### Training Data
|
| 85 |
-
|
| 86 |
-
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
| 87 |
-
|
| 88 |
-
[More Information Needed]
|
| 89 |
-
|
| 90 |
-
### Training Procedure
|
| 91 |
-
|
| 92 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
| 93 |
-
|
| 94 |
-
#### Preprocessing [optional]
|
| 95 |
-
|
| 96 |
-
[More Information Needed]
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
#### Training Hyperparameters
|
| 100 |
-
|
| 101 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
| 102 |
-
|
| 103 |
-
#### Speeds, Sizes, Times [optional]
|
| 104 |
-
|
| 105 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
| 106 |
-
|
| 107 |
-
[More Information Needed]
|
| 108 |
-
|
| 109 |
-
## Evaluation
|
| 110 |
-
|
| 111 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 112 |
-
|
| 113 |
-
### Testing Data, Factors & Metrics
|
| 114 |
-
|
| 115 |
-
#### Testing Data
|
| 116 |
-
|
| 117 |
-
<!-- This should link to a Dataset Card if possible. -->
|
| 118 |
-
|
| 119 |
-
[More Information Needed]
|
| 120 |
-
|
| 121 |
-
#### Factors
|
| 122 |
-
|
| 123 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
| 124 |
-
|
| 125 |
-
[More Information Needed]
|
| 126 |
-
|
| 127 |
-
#### Metrics
|
| 128 |
-
|
| 129 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
| 130 |
-
|
| 131 |
-
[More Information Needed]
|
| 132 |
-
|
| 133 |
-
### Results
|
| 134 |
-
|
| 135 |
-
[More Information Needed]
|
| 136 |
-
|
| 137 |
-
#### Summary
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
## Model Examination [optional]
|
| 142 |
-
|
| 143 |
-
<!-- Relevant interpretability work for the model goes here -->
|
| 144 |
-
|
| 145 |
-
[More Information Needed]
|
| 146 |
-
|
| 147 |
-
## Environmental Impact
|
| 148 |
-
|
| 149 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
| 150 |
-
|
| 151 |
-
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).
|
| 152 |
-
|
| 153 |
-
- **Hardware Type:** [More Information Needed]
|
| 154 |
-
- **Hours used:** [More Information Needed]
|
| 155 |
-
- **Cloud Provider:** [More Information Needed]
|
| 156 |
-
- **Compute Region:** [More Information Needed]
|
| 157 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 158 |
-
|
| 159 |
-
## Technical Specifications [optional]
|
| 160 |
-
|
| 161 |
-
### Model Architecture and Objective
|
| 162 |
-
|
| 163 |
-
[More Information Needed]
|
| 164 |
-
|
| 165 |
-
### Compute Infrastructure
|
| 166 |
-
|
| 167 |
-
[More Information Needed]
|
| 168 |
-
|
| 169 |
-
#### Hardware
|
| 170 |
-
|
| 171 |
-
[More Information Needed]
|
| 172 |
-
|
| 173 |
-
#### Software
|
| 174 |
-
|
| 175 |
-
[More Information Needed]
|
| 176 |
-
|
| 177 |
-
## Citation [optional]
|
| 178 |
-
|
| 179 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 180 |
-
|
| 181 |
-
**BibTeX:**
|
| 182 |
-
|
| 183 |
-
[More Information Needed]
|
| 184 |
-
|
| 185 |
-
**APA:**
|
| 186 |
-
|
| 187 |
-
[More Information Needed]
|
| 188 |
-
|
| 189 |
-
## Glossary [optional]
|
| 190 |
-
|
| 191 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
| 192 |
-
|
| 193 |
-
[More Information Needed]
|
| 194 |
-
|
| 195 |
-
## More Information [optional]
|
| 196 |
-
|
| 197 |
-
[More Information Needed]
|
| 198 |
-
|
| 199 |
-
## Model Card Authors [optional]
|
| 200 |
-
|
| 201 |
-
[More Information Needed]
|
| 202 |
-
|
| 203 |
-
## Model Card Contact
|
| 204 |
-
|
| 205 |
-
[More Information Needed]
|
| 206 |
-
### Framework versions
|
| 207 |
-
|
| 208 |
-
- PEFT 0.17.1
|
|
|
|
| 1 |
+
This LoRA adapter was trained on a custom dataset of 1,000 English transcript examples to teach a Mistral-7B model how to segment long transcripts into topic-based chunks using -- as delimiters.
|
| 2 |
+
It enables automated topic boundary detection in conversation, meeting, and podcast transcripts — ideal for preprocessing before summarization, classification, or retrieval.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
+
🧩 Training Objective
|
| 5 |
|
| 6 |
+
The model learns to:
|
| 7 |
|
| 8 |
+
Detect topic changes in unstructured transcripts
|
| 9 |
|
| 10 |
+
Insert -- where those shifts occur
|
| 11 |
|
| 12 |
+
Preserve the original flow of speech
|
| 13 |
|
| 14 |
+
Example:
|
| 15 |
|
| 16 |
+
Input:
|
| 17 |
+
Chunk this transcript wherever a new topic begins. Use -- as a delimiter.
|
| 18 |
+
Transcript: Welcome everyone to the meeting. Today we'll discuss project updates and next quarter goals.
|
| 19 |
|
| 20 |
+
Output:
|
| 21 |
+
Welcome everyone to the meeting -- Today we'll discuss project updates -- and next quarter goals.
|
| 22 |
|
| 23 |
+
⚙️ Training Configuration
|
| 24 |
|
| 25 |
+
Base Model: mistralai/Mistral-7B-v0.2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
+
Adapter Type: LoRA
|
| 28 |
|
| 29 |
+
PEFT Library: peft==0.10.0
|
| 30 |
|
| 31 |
+
Training Framework: Hugging Face Transformers
|
|
|
|
|
|
|
| 32 |
|
| 33 |
+
Epochs: 2
|
| 34 |
|
| 35 |
+
Optimizer: AdamW
|
| 36 |
|
| 37 |
+
Learning Rate: 2e-4
|
| 38 |
|
| 39 |
+
Batch Size: 8
|
| 40 |
|
| 41 |
+
Sequence Length: 512
|
| 42 |
|
| 43 |
+
📊 Training Metrics
|
| 44 |
+
Step Training Loss Validation Loss Entropy Num Tokens Mean Token Accuracy
|
| 45 |
+
100 0.2961 0.1603 0.1644 204,800 0.9594
|
| 46 |
+
200 0.1362 0.1502 0.1609 409,600 0.9603
|
| 47 |
+
300 0.1360 0.1451 0.1391 612,864 0.9572
|
| 48 |
+
400 0.0951 0.1351 0.1279 817,664 0.9635
|
| 49 |
+
500 0.0947 0.1297 0.0892 1,022,464 0.9657
|
| 50 |
|
| 51 |
+
Summary:
|
| 52 |
+
Loss steadily decreased over training, and accuracy remained consistently above 95%, indicating the model effectively learned transcript reconstruction and delimiter placement patterns.
|
| 53 |
|
| 54 |
+
🧰 Usage Example
|
| 55 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 56 |
+
from peft import PeftModel
|
| 57 |
|
| 58 |
+
base = "mistralai/Mistral-7B-v0.2"
|
| 59 |
+
adapter = "Dc-4nderson/transcript_summarizer_model"
|
| 60 |
|
| 61 |
+
tokenizer = AutoTokenizer.from_pretrained(base)
|
| 62 |
+
model = AutoModelForCausalLM.from_pretrained(base)
|
| 63 |
+
model = PeftModel.from_pretrained(model, adapter)
|
| 64 |
|
| 65 |
+
text = "Break this transcript wherever a new topic begins. Use -- as a delimiter.\nTranscript: Let's start with last week's performance metrics. Next, we’ll review upcoming campaign deadlines."
|
| 66 |
+
inputs = tokenizer(text, return_tensors="pt")
|
| 67 |
+
outputs = model.generate(**inputs, max_new_tokens=30000)
|
| 68 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 69 |
|
| 70 |
+
🧾 License
|
| 71 |
|
| 72 |
+
Released under the MIT License — free for research and commercial use with attribution.
|
| 73 |
|
| 74 |
+
🙌 Credits
|
| 75 |
|
| 76 |
+
Developed by Dequan Anderson for automated transcript segmentation and chunked text preprocessing tasks.
|
| 77 |
+
Built using Hugging Face Transformers, PEFT, and Mistral 7B for efficient LoRA fine-tuning.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|