IstishadAlamTishad commited on
Commit
fee85e8
Β·
1 Parent(s): 486ebff

Updated Model Card details

Browse files
Files changed (2) hide show
  1. README.md +36 -51
  2. assets/crossEntropyLossImage.png +0 -0
README.md CHANGED
@@ -12,10 +12,9 @@ pipeline_tag: text-generation
12
  ---
13
 
14
  # πŸ¦‰ Owl-v1
 
15
 
16
- > **Demo Β· Character-Level GPT Β· Pretrained on TinyShakespeare**
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 size** | 65 characters (char-level) |
31
- | **Tokenizer** | `CharTokenizer` (hand-rolled, no sub-word splitting) |
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
- | Setting | Value |
43
- |---|---|
44
- | Dataset | TinyShakespeare (1,115,394 tokens) |
45
- | Steps / Batch | 5,000 / 64 |
46
- | Optimiser | AdamW Β· Cross-Entropy loss |
47
 
48
  ### Training Curves
49
 
50
- **Cross-Entropy Loss** β€” train (smoothed) vs validation
51
-
52
- ![Cross-entropy loss over 5,000 steps](assets/crossEntropyLossImage.png)
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
- ![Perplexity over 5,000 steps](assets/perplexityPerformanceImage.png)
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
- ![Throughput (tokens/sec) over 5,000 steps](assets/ThroughputImage.png)
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
- Owl-v1 is a **Shakespearean text-continuation engine**. It generates coherent Early Modern English text when primed with a matching prompt.
73
 
74
- | Prompt Style | Expected Output | Quality |
75
  |---|---|---|
76
- | `"HAMLET:\n"` | Character dialogue β€” Early Modern diction | ⭐⭐⭐ Good |
77
- | `"Enter KING and QUEEN.\n"` | Stage directions + speech | ⭐⭐ Fair |
78
- | `"To be, or not to be"` | Continued monologue (probabilistic, not exact) | ⭐⭐ Fair |
79
- | `"Shall I compare thee"` | Poetic continuation β€” metre may drift | ⭐ Moderate |
80
- | `"\n"` *(cold start)* | Free-form dramatic scene | ⭐⭐ Fair |
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
- > πŸ’‘ **Agentic tip:** Seed with a character-name prefix e.g. `"KING LEAR:\n"` for the most coherent pipeline-test outputs.
 
85
 
86
  ---
87
 
88
- ## Files
89
 
90
- | File | Description |
91
- |---|---|
92
- | `model.safetensors` | Weights (~41 MB, float32) |
93
- | `config.json` | Architecture hyperparameters |
94
- | `tokenizer_config.json` | Tokenizer class + metadata |
95
- | `vocab.json` | `stoi` / `itos` char mappings |
96
- | `assets/crossEntropyLossImage.png` | Training loss curve |
97
- | `assets/perplexityPerformanceImage.png` | Perplexity curve (PPL) |
98
- | `assets/ThroughputImage.png` | Throughput curve |
 
 
 
 
 
 
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
+ | ![Perplexity (PPL = exp(loss), ↓ better)](assets/perplexityPerformanceImage.png) | ![Throughput (tokens/sec)](assets/ThroughputImage.png) |
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)