File size: 693 Bytes
8687062
 
 
 
 
4f3dccd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8687062
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
---
license: mit
metrics:
- accuracy
---

# Minimal Transformer Demo

This is a very small Transformer model for demonstration purposes.

## Usage

```python
import torch
from huggingface_hub import hf_hub_download

# Load the model
model_path = hf_hub_download(repo_id="your_username/minimal-transformer-demo", filename="pytorch_model.bin")
state_dict = torch.load(model_path)

# Create the model architecture (must match the saved model!)
# ... (define MinimalTransformer and MinimalTransformerBlock classes here) ...

model = MinimalTransformer() # Use appropriate parameters
model.load_state_dict(state_dict)
model.eval() # Set to evaluation mode

# Now you can use the model for inference