Commit Β·
fee85e8
1
Parent(s): 486ebff
Updated Model Card details
Browse files- README.md +36 -51
- assets/crossEntropyLossImage.png +0 -0
README.md
CHANGED
|
@@ -12,10 +12,9 @@ pipeline_tag: text-generation
|
|
| 12 |
---
|
| 13 |
|
| 14 |
# π¦ Owl-v1
|
|
|
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
Owl-v1 is a minimal, scratch-built GPT trained for **demonstration and agentic-integration testing** for an **(Enterprise-grade) Multi-Agent AI Chatbot** project. It validates the full LLM-from-scratch pipeline β architecture, training loop, serialization, and downstream agentic wiring β end-to-end. **Not intended for production use.**
|
| 19 |
|
| 20 |
---
|
| 21 |
|
|
@@ -27,75 +26,61 @@ Owl-v1 is a minimal, scratch-built GPT trained for **demonstration and agentic-i
|
|
| 27 |
| **Parameters** | 10.77 M |
|
| 28 |
| **Layers / Heads / D_embd** | 6 / 6 / 384 |
|
| 29 |
| **Context length** | 256 tokens |
|
| 30 |
-
| **Vocab
|
| 31 |
-
| **Tokenizer** | `CharTokenizer` (
|
| 32 |
-
| **Precision** | float32 |
|
| 33 |
-
| **Framework** | PyTorch + SafeTensors |
|
| 34 |
| **License** | MIT Β· v1 demo checkpoint |
|
| 35 |
|
| 36 |
-
**Vocab** covers: `\n`, space, `! $ & ' , - . : ; ?`, `AβZ`, `aβz` (65 chars total, sourced from TinyShakespeare).
|
| 37 |
-
|
| 38 |
---
|
| 39 |
|
| 40 |
## Training
|
| 41 |
|
| 42 |
-
|
|
| 43 |
-
|---|---|
|
| 44 |
-
|
|
| 45 |
-
| Steps / Batch | 5,000 / 64 |
|
| 46 |
-
| Optimiser | AdamW Β· Cross-Entropy loss |
|
| 47 |
|
| 48 |
### Training Curves
|
| 49 |
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
> Train β ~0.15 Β· Val bottoms at ~1.55 (step 1,500) then rises to ~3.9 β clear **overfitting** on the small corpus. No early stopping applied.
|
| 55 |
-
|
| 56 |
-
**Perplexity** (PPL = exp(loss), β better) β train vs validation
|
| 57 |
-
|
| 58 |
-

|
| 59 |
-
|
| 60 |
-
> Train PPL β ~1 Β· Val PPL bottoms at ~5 (step ~800) then climbs to ~50 by step 5,000 β mirrors the loss overfitting curve.
|
| 61 |
-
|
| 62 |
-
**Throughput**
|
| 63 |
-
|
| 64 |
-

|
| 65 |
-
|
| 66 |
-
> Stable at **~37β38 k tokens/sec** after a brief warm-up spike.
|
| 67 |
|
| 68 |
---
|
| 69 |
|
| 70 |
## What Can It Generate?
|
| 71 |
|
| 72 |
-
|
| 73 |
|
| 74 |
-
| Prompt
|
| 75 |
|---|---|---|
|
| 76 |
-
| `"HAMLET:\n"` | Character dialogue
|
| 77 |
-
| `"Enter KING and QUEEN.\n"` | Stage directions + speech | ββ
|
| 78 |
-
| `"To be, or not to be"` |
|
| 79 |
-
| `"Shall I compare thee"` | Poetic continuation
|
| 80 |
-
| `"\n"` *(cold start)* | Free-form dramatic scene | ββ
|
| 81 |
-
|
| 82 |
-
**Out-of-scope** (will produce Shakespeare-style gibberish): instructions, Q&A, code, non-English text, prompts > 256 tokens, multi-turn chat.
|
| 83 |
|
| 84 |
-
>
|
|
|
|
| 85 |
|
| 86 |
---
|
| 87 |
|
| 88 |
-
##
|
| 89 |
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
|
| 100 |
---
|
| 101 |
|
|
|
|
| 12 |
---
|
| 13 |
|
| 14 |
# π¦ Owl-v1
|
| 15 |
+
> **Character Level Language Model Pretrained on TinyShakespeare**
|
| 16 |
|
| 17 |
+
Owl-v1 is a scratch built LLM for **agentic integration testing** in an **(Enterprise-grade) Multi-Agent AI Chatbot** project. Validates the full LLM from scratch pipeline β architecture, training loop, serialization, and downstream agentic wiring. **Not for production use.**
|
|
|
|
|
|
|
| 18 |
|
| 19 |
---
|
| 20 |
|
|
|
|
| 26 |
| **Parameters** | 10.77 M |
|
| 27 |
| **Layers / Heads / D_embd** | 6 / 6 / 384 |
|
| 28 |
| **Context length** | 256 tokens |
|
| 29 |
+
| **Vocab** | 65 chars β `\n` space `!$&',-.:;?` `AβZ` `aβz` |
|
| 30 |
+
| **Tokenizer** | `CharTokenizer` (char-level, no sub-word) |
|
| 31 |
+
| **Precision / Framework** | float32 Β· PyTorch + SafeTensors |
|
|
|
|
| 32 |
| **License** | MIT Β· v1 demo checkpoint |
|
| 33 |
|
|
|
|
|
|
|
| 34 |
---
|
| 35 |
|
| 36 |
## Training
|
| 37 |
|
| 38 |
+
| Dataset | Tokens | Steps | Batch | Optimiser |
|
| 39 |
+
|---|---|---|---|---|
|
| 40 |
+
| TinyShakespeare | 1,115,394 | 5,000 | 64 | AdamW Β· Cross-Entropy |
|
|
|
|
|
|
|
| 41 |
|
| 42 |
### Training Curves
|
| 43 |
|
| 44 |
+
|  |  |
|
| 45 |
+
|:---:|:---:|
|
| 46 |
+
| *Fig 1 β Perplexity: Train PPL β ~1, Val PPL bottoms at ~5 (step ~800) then climbs to ~50 β clear overfitting on the small corpus.* | *Fig 2 β Throughput: Stable ~37β38 k tokens/sec after a brief warm-up spike.* |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
|
| 48 |
---
|
| 49 |
|
| 50 |
## What Can It Generate?
|
| 51 |
|
| 52 |
+
Shakespearean text-continuation engine. Best results with character-name or scene-opener prompts.
|
| 53 |
|
| 54 |
+
| Prompt | Output | Quality |
|
| 55 |
|---|---|---|
|
| 56 |
+
| `"HAMLET:\n"` | Character dialogue in Early Modern English | βββ |
|
| 57 |
+
| `"Enter KING and QUEEN.\n"` | Stage directions + speech | ββ |
|
| 58 |
+
| `"To be, or not to be"` | Probabilistic monologue continuation | ββ |
|
| 59 |
+
| `"Shall I compare thee"` | Poetic continuation (metre may drift) | β |
|
| 60 |
+
| `"\n"` *(cold start)* | Free-form dramatic scene | ββ |
|
|
|
|
|
|
|
| 61 |
|
| 62 |
+
> **Out-of-scope** β instructions, Q&A, code, non-English, prompts > 256 tokens, multi-turn chat β produces Shakespeare-style gibberish.
|
| 63 |
+
> π‘ Use `"KING LEAR:\n"` style seeds for cleanest agentic pipeline outputs.
|
| 64 |
|
| 65 |
---
|
| 66 |
|
| 67 |
+
## Usage
|
| 68 |
|
| 69 |
+
> Requires `trust_remote_code=True` β `CharTokenizer` and `ModelArchitecture` are custom classes.
|
| 70 |
+
|
| 71 |
+
```python
|
| 72 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 73 |
+
import torch
|
| 74 |
+
|
| 75 |
+
tokenizer = AutoTokenizer.from_pretrained("IstishadAlamTishad/Owl-v1", trust_remote_code=True)
|
| 76 |
+
model = AutoModelForCausalLM.from_pretrained("IstishadAlamTishad/Owl-v1", trust_remote_code=True)
|
| 77 |
+
model.eval()
|
| 78 |
+
|
| 79 |
+
ids = tokenizer.encode("HAMLET:\n", return_tensors="pt")
|
| 80 |
+
with torch.no_grad():
|
| 81 |
+
out = model.generate(ids, max_new_tokens=200, do_sample=True, temperature=0.8, top_k=40)
|
| 82 |
+
print(tokenizer.decode(out[0].tolist()))
|
| 83 |
+
```
|
| 84 |
|
| 85 |
---
|
| 86 |
|
assets/crossEntropyLossImage.png
DELETED
|
Binary file (57.6 kB)
|
|
|