Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,73 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
datasets:
|
| 4 |
+
- pfb30/multi_woz_v22
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
pipeline_tag: text-generation
|
| 8 |
+
---
|
| 9 |
+
model_card = """
|
| 10 |
+
# 🧠 Model Card: Sam‑2.0
|
| 11 |
+
|
| 12 |
+
## 📌 Model Overview
|
| 13 |
+
**Sam‑2.0** is a modular, head‑agnostic Transformer architecture designed for chat‑style and multimodal reasoning tasks. It emphasizes reproducibility, ablation‑friendly design, and clean benchmarking across input modalities.
|
| 14 |
+
|
| 15 |
+
- **Architecture**: Transformer encoder with RoPE positional encoding, MQA attention, and modular input adapters
|
| 16 |
+
- **Training Objective**: Causal language modeling (CLM)
|
| 17 |
+
- **Checkpoint**: `sam2-epoch35.safetensors`
|
| 18 |
+
- **Final Train Loss**: 1.04
|
| 19 |
+
- **Validation Loss**: Not tracked in this run
|
| 20 |
+
- **Training Duration**: ~6272s over 35 epochs
|
| 21 |
+
- **Framework**: PyTorch + Hugging Face Transformers (custom registry)
|
| 22 |
+
|
| 23 |
+
## 🧱 Model Architecture
|
| 24 |
+
| Component | Description |
|
| 25 |
+
|------------------|-----------------------------------------------------------------------------|
|
| 26 |
+
| Backbone | Transformer encoder with RoPE and MQA |
|
| 27 |
+
| Input Adapter | Tokenizer-driven byte-level embedding layer |
|
| 28 |
+
| Positional Bias | Rotary embeddings (RoPE) |
|
| 29 |
+
| Attention | Multi-query attention (MQA) |
|
| 30 |
+
| Head | Head-agnostic registry (default: classification placeholder) |
|
| 31 |
+
| Checkpoint Format| `safetensors` with metadata for reproducibility |
|
| 32 |
+
|
| 33 |
+
## 🧪 Training Details
|
| 34 |
+
- **Dataset**: Synthetic chat-style corpus with adversarial prompt patterns
|
| 35 |
+
- **Batch Size**: 1055 steps per epoch
|
| 36 |
+
- **Optimizer**: AdamW
|
| 37 |
+
- **Learning Rate Schedule**: Cosine decay with warmup
|
| 38 |
+
- **Loss Function**: Cross-entropy over token predictions
|
| 39 |
+
- **Hardware**: Kaggle TPUv2 (simulated)
|
| 40 |
+
- **Logging**: Step-wise loss tracking, no validation during training
|
| 41 |
+
|
| 42 |
+
## 📊 Evaluation
|
| 43 |
+
| Metric | Value | Notes |
|
| 44 |
+
|----------------|-------------|---------------------------------------|
|
| 45 |
+
| Final Train Loss | 1.04 | Achieved at Epoch 35/35 |
|
| 46 |
+
| Validation Loss | — | Not tracked in this run |
|
| 47 |
+
| Inference Speed | Fast | Optimized for edge deployment |
|
| 48 |
+
| Generalisation | TBD | To be compared against Sam‑2.5 |
|
| 49 |
+
|
| 50 |
+
## 🔧 Intended Use
|
| 51 |
+
- **Research**: Benchmarking modular architectures and ablation studies
|
| 52 |
+
- **Education**: Reasoning scaffolds and logic quizzes
|
| 53 |
+
- **Deployment**: Lightweight agents for chat and multimodal fusion (with adapters)
|
| 54 |
+
|
| 55 |
+
## 🚫 Limitations
|
| 56 |
+
- No validation tracking — generalisation must be inferred via external harnesses
|
| 57 |
+
- Trained on synthetic data — may not generalize to real-world dialogue without fine-tuning
|
| 58 |
+
- Head is placeholder — downstream tasks require custom head registration
|
| 59 |
+
|
| 60 |
+
## 📁 Files
|
| 61 |
+
- `sam2-epoch35.safetensors` — final checkpoint
|
| 62 |
+
- `config.yaml` — architecture and training config
|
| 63 |
+
- `tokenizer.json` — byte-level tokenizer
|
| 64 |
+
- `README.md` — training logs and setup instructions
|
| 65 |
+
|
| 66 |
+
## 🧩 How to Load
|
| 67 |
+
```python
|
| 68 |
+
from sam2 import build_sam2_model
|
| 69 |
+
import torch
|
| 70 |
+
|
| 71 |
+
model = build_sam2_model(config="config.yaml")
|
| 72 |
+
model.load_state_dict(torch.load("sam2-epoch35.safetensors"))
|
| 73 |
+
model.eval()
|