File size: 1,250 Bytes
4786c8f cd2cfb6 4786c8f cd2cfb6 4786c8f |
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 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# MAX Custom Architecture Example
This is a simple demonstration model for the `MyCustomModelForCausalLM` architecture used in the MAX custom architecture example.
## Model Details
- **Architecture**: MyCustomModelForCausalLM
- **Parameters**: ~289,280
- **Vocab Size**: 1000
- **Hidden Size**: 128
- **Layers**: 2
- **Dtype**: float32
## Usage with MAX
```bash
max generate \
--model-path rachfop/max-custom-architecture-example \
--custom-architectures /path/to/max/examples/custom-model-architectures \
--quantization-encoding float32 \
--prompt "Hello world" \
--max-new-tokens 10
```
## Purpose
This model is intended for demonstration purposes to show how to:
1. Create a custom model architecture for MAX
2. Upload it to Hugging Face
3. Load and use it with MAX's custom architecture system
The model generates random outputs and is not trained for any specific task.
## Architecture Implementation
See the [MAX custom architecture example](https://github.com/modularml/max/tree/main/examples/custom-model-architectures) for the complete implementation including:
- Model definition (`model.py`)
- Architecture registration (`arch.py`)
- Configuration handling (`model_config.py`)
- Weight adapters (`weight_adapters.py`)
|