Update README.md
Browse files
README.md
CHANGED
|
@@ -9,202 +9,125 @@ tags:
|
|
| 9 |
- transformers
|
| 10 |
- trl
|
| 11 |
- unsloth
|
|
|
|
| 12 |
---
|
|
|
|
| 13 |
|
| 14 |
-
|
|
|
|
| 15 |
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
| 17 |
|
|
|
|
|
|
|
| 18 |
|
|
|
|
| 19 |
|
| 20 |
-
|
| 21 |
|
| 22 |
-
|
| 23 |
|
| 24 |
-
|
| 25 |
|
|
|
|
| 26 |
|
| 27 |
-
|
| 28 |
-
- **Developed by:** [More Information Needed]
|
| 29 |
-
- **Funded by [optional]:** [More Information Needed]
|
| 30 |
-
- **Shared by [optional]:** [More Information Needed]
|
| 31 |
-
- **Model type:** [More Information Needed]
|
| 32 |
-
- **Language(s) (NLP):** [More Information Needed]
|
| 33 |
-
- **License:** [More Information Needed]
|
| 34 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
| 35 |
-
|
| 36 |
-
### Model Sources [optional]
|
| 37 |
-
|
| 38 |
-
<!-- Provide the basic links for the model. -->
|
| 39 |
-
|
| 40 |
-
- **Repository:** [More Information Needed]
|
| 41 |
-
- **Paper [optional]:** [More Information Needed]
|
| 42 |
-
- **Demo [optional]:** [More Information Needed]
|
| 43 |
|
| 44 |
## Uses
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
### Direct Use
|
| 49 |
-
|
| 50 |
-
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
| 51 |
-
|
| 52 |
-
[More Information Needed]
|
| 53 |
-
|
| 54 |
-
### Downstream Use [optional]
|
| 55 |
-
|
| 56 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
| 57 |
-
|
| 58 |
-
[More Information Needed]
|
| 59 |
-
|
| 60 |
-
### Out-of-Scope Use
|
| 61 |
-
|
| 62 |
-
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
| 63 |
-
|
| 64 |
-
[More Information Needed]
|
| 65 |
-
|
| 66 |
-
## Bias, Risks, and Limitations
|
| 67 |
-
|
| 68 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
| 69 |
-
|
| 70 |
-
[More Information Needed]
|
| 71 |
-
|
| 72 |
-
### Recommendations
|
| 73 |
-
|
| 74 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
| 75 |
-
|
| 76 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
| 77 |
-
|
| 78 |
-
## How to Get Started with the Model
|
| 79 |
-
|
| 80 |
-
Use the code below to get started with the model.
|
| 81 |
-
|
| 82 |
-
[More Information Needed]
|
| 83 |
-
|
| 84 |
-
## Training Details
|
| 85 |
-
|
| 86 |
-
### Training Data
|
| 87 |
-
|
| 88 |
-
<!-- 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. -->
|
| 89 |
-
|
| 90 |
-
[More Information Needed]
|
| 91 |
-
|
| 92 |
-
### Training Procedure
|
| 93 |
-
|
| 94 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
| 95 |
-
|
| 96 |
-
#### Preprocessing [optional]
|
| 97 |
-
|
| 98 |
-
[More Information Needed]
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
#### Training Hyperparameters
|
| 102 |
-
|
| 103 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
| 104 |
-
|
| 105 |
-
#### Speeds, Sizes, Times [optional]
|
| 106 |
-
|
| 107 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
| 108 |
-
|
| 109 |
-
[More Information Needed]
|
| 110 |
-
|
| 111 |
-
## Evaluation
|
| 112 |
-
|
| 113 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 114 |
-
|
| 115 |
-
### Testing Data, Factors & Metrics
|
| 116 |
-
|
| 117 |
-
#### Testing Data
|
| 118 |
-
|
| 119 |
-
<!-- This should link to a Dataset Card if possible. -->
|
| 120 |
-
|
| 121 |
-
[More Information Needed]
|
| 122 |
-
|
| 123 |
-
#### Factors
|
| 124 |
-
|
| 125 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
| 126 |
-
|
| 127 |
-
[More Information Needed]
|
| 128 |
-
|
| 129 |
-
#### Metrics
|
| 130 |
-
|
| 131 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
| 132 |
-
|
| 133 |
-
[More Information Needed]
|
| 134 |
-
|
| 135 |
-
### Results
|
| 136 |
-
|
| 137 |
-
[More Information Needed]
|
| 138 |
-
|
| 139 |
-
#### Summary
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
## Model Examination [optional]
|
| 144 |
|
| 145 |
-
<!-- Relevant interpretability work for the model goes here -->
|
| 146 |
|
| 147 |
-
|
| 148 |
|
| 149 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
|
| 151 |
-
|
|
|
|
| 152 |
|
| 153 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 154 |
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
|
|
|
| 160 |
|
| 161 |
-
|
| 162 |
|
| 163 |
-
|
| 164 |
|
| 165 |
-
|
| 166 |
|
| 167 |
-
|
|
|
|
|
|
|
| 168 |
|
| 169 |
-
[More Information Needed]
|
| 170 |
|
| 171 |
-
|
| 172 |
|
| 173 |
-
|
| 174 |
|
| 175 |
-
|
| 176 |
|
| 177 |
-
|
| 178 |
|
| 179 |
-
|
| 180 |
|
| 181 |
-
|
| 182 |
|
| 183 |
-
|
| 184 |
|
| 185 |
-
|
| 186 |
|
| 187 |
-
|
| 188 |
|
| 189 |
-
|
| 190 |
|
| 191 |
-
|
| 192 |
|
| 193 |
-
|
| 194 |
|
| 195 |
-
|
| 196 |
|
| 197 |
-
|
| 198 |
|
| 199 |
-
|
| 200 |
|
| 201 |
-
|
| 202 |
|
| 203 |
-
|
| 204 |
|
| 205 |
-
|
| 206 |
|
| 207 |
-
|
| 208 |
-
### Framework versions
|
| 209 |
|
| 210 |
-
|
|
|
|
| 9 |
- transformers
|
| 10 |
- trl
|
| 11 |
- unsloth
|
| 12 |
+
license: mit
|
| 13 |
---
|
| 14 |
+
## Model Card for Pragnyan-Clone-v1
|
| 15 |
|
| 16 |
+
This is a personality-tuned version of Llama 3.1 8B, trained to mimic the conversational style, tone, and slang of Pragnyan Ramtha.
|
| 17 |
+
It was fine-tuned on private chat logs using QLoRA and Unsloth to create a lightweight, highly efficient digital twin.Model DetailsModel Description
|
| 18 |
|
| 19 |
+
This model is a LoRA (Low-Rank Adaptation) adapter fine-tuned on the unsloth/llama-3.1-8b-Instruct base model.
|
| 20 |
+
It was trained to replicate a specific user's personality ("Pragnyan Ramtha") by learning from real-world conversation history (Instagram/WhatsApp).
|
| 21 |
+
It captures nuances, casual sentence structure, and specific personal interests.
|
| 22 |
+
The model was optimized for local deployment, trained on a cloud GPU (NVIDIA L4), and quantized to GGUF for efficient inference on consumer hardware via Ollama.
|
| 23 |
|
| 24 |
+
## Developed by: Pragnyan Ramtha
|
| 25 |
+
Model type: Causal Language Model (Fine-tuned Llama 3.1)
|
| 26 |
|
| 27 |
+
Language(s) (NLP): English (with internet slang/informal syntax)
|
| 28 |
|
| 29 |
+
Finetuned from model: unsloth/llama-3.1-8b-Instruct
|
| 30 |
|
| 31 |
+
Model Sources
|
| 32 |
|
| 33 |
+
Repository: [Link to your Hugging Face Repo]
|
| 34 |
|
| 35 |
+
Base Model: Meta Llama 3.1 8B Instruct
|
| 36 |
|
| 37 |
+
Tech Stack: Unsloth, TRL, PEFT, Ollama
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
## Uses
|
| 40 |
+
Direct Use
|
| 41 |
+
This model is intended for:
|
| 42 |
+
Personality Simulation: Chatting with a digital clone of the creator.
|
| 43 |
+
Style Transfer: Generating text in a specific, informal style.Local
|
| 44 |
+
Chatbot: Running a highly responsive, personalized assistant on consumer GPUs (RTX 3060/4060).
|
| 45 |
+
Out-of-Scope UseFactual Q&A: While based on Llama 3.1, this model is biased towards a specific personality's knowledge and may hallucinate facts to maintain character.
|
| 46 |
+
Impersonation: This model should not be used to deceive others into thinking they are speaking to the real person.
|
| 47 |
+
Bias, Risks, and Limitations
|
| 48 |
+
Training Data Bias: The model reflects the opinions, biases, and language patterns found in the private chat logs used for training.
|
| 49 |
+
Language Style: The model often uses informal language, slang, and non-standard grammar, which is a feature, not a bug.
|
| 50 |
+
Hallucinations: Like all LLMs, it can generate confident but incorrect information.
|
| 51 |
+
How to Get Started with the ModelYou can use this model directly with the peft and transformers library, or download the GGUF version for Ollama.Python Code (Adapter Only)
|
| 52 |
|
| 53 |
+
```
|
| 54 |
+
from unsloth import FastLanguageModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
|
|
|
|
| 56 |
|
| 57 |
+
from peft import PeftModel
|
| 58 |
|
| 59 |
+
# 1. Load Base Model
|
| 60 |
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
| 61 |
+
model_name = "unsloth/llama-3.1-8b-Instruct",
|
| 62 |
+
max_seq_length = 8192,
|
| 63 |
+
dtype = None,
|
| 64 |
+
load_in_4bit = True,
|
| 65 |
+
)
|
| 66 |
|
| 67 |
+
# 2. Load Adapters
|
| 68 |
+
model = PeftModel.from_pretrained(model, "PragnyanRamtha/pragnyan-clone-v1")
|
| 69 |
|
| 70 |
+
# 3. Inference
|
| 71 |
+
FastLanguageModel.for_inference(model)
|
| 72 |
+
messages = [
|
| 73 |
+
{"role": "user", "content": "Yo, what's good?"},
|
| 74 |
+
]
|
| 75 |
+
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to("cuda")
|
| 76 |
|
| 77 |
+
outputs = model.generate(inputs, max_new_tokens=64, use_cache=True)
|
| 78 |
+
print(tokenizer.batch_decode(outputs))
|
| 79 |
+
```
|
| 80 |
+
Local Use (Ollama)Download the .gguf file from the "Files" tab and create a Modelfile:
|
| 81 |
+
```
|
| 82 |
+
FROM ./pragnyan-clone-v1.q4_k_m.gguf
|
| 83 |
|
| 84 |
+
TEMPLATE """<|begin_of_text|><|start_header_id|>system<|end_header_id|>
|
| 85 |
|
| 86 |
+
{{ .System }}<|eot_id|><|start_header_id|>user<|end_header_id|>
|
| 87 |
|
| 88 |
+
{{ .Prompt }}<|eot_id|><|start_header_id|>assistant<|end_header_id|>
|
| 89 |
|
| 90 |
+
{{ .Response }}<|eot_id|>"""
|
| 91 |
+
SYSTEM """You are Pragnyan Ramtha."""
|
| 92 |
+
```
|
| 93 |
|
|
|
|
| 94 |
|
| 95 |
+
Training Procedure
|
| 96 |
|
| 97 |
+
Size: ~13,500 training examples.
|
| 98 |
|
| 99 |
+
The model was fine-tuned using Unsloth for 2x faster training and optimized VRAM usage.
|
| 100 |
|
| 101 |
+
We used QLoRA (Quantized Low-Rank Adaptation) to train on a single GPU.
|
| 102 |
|
| 103 |
+
### Training Hyperparameters
|
| 104 |
|
| 105 |
+
Training regime: 4-bit QLoRA (bfloat16 precision)
|
| 106 |
|
| 107 |
+
Optimizer: paged_adamw_8bit (Paged AdamW to save memory)
|
| 108 |
|
| 109 |
+
Learning Rate: 2e-4
|
| 110 |
|
| 111 |
+
Epochs: 1
|
| 112 |
|
| 113 |
+
Batch Size: 2 (per device)
|
| 114 |
|
| 115 |
+
Gradient Accumulation: 8 (Effective batch size = 16)
|
| 116 |
|
| 117 |
+
LoRA Rank (r): 32.
|
| 118 |
|
| 119 |
+
LoRA Alpha: 64LoRA
|
| 120 |
|
| 121 |
+
Dropout: 0.05Max
|
| 122 |
|
| 123 |
+
Sequence Length: 8192
|
| 124 |
|
| 125 |
+
Hardware: NVIDIA L4 GPU (24GB VRAM) on Google Cloud.
|
| 126 |
|
| 127 |
+
Training Time: ~1.5 hours for 1 epoch.
|
| 128 |
|
| 129 |
+
VRAM Usage: Peaked at ~16GB during training.
|
| 130 |
|
| 131 |
+
EvaluationResultsFinal Validation Loss: ~1.14
|
|
|
|
| 132 |
|
| 133 |
+
Qualitative Eval: The model successfully adopts the target persona, maintaining conversation flow without breaking character.
|