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 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: openbmb/MiniCPM-o-2_6
|
| 4 |
+
tags:
|
| 5 |
+
- vision
|
| 6 |
+
- text-generation
|
| 7 |
+
- multimodal
|
| 8 |
+
- minicpm
|
| 9 |
+
- tiny-model
|
| 10 |
+
- testing
|
| 11 |
+
- optimum-intel
|
| 12 |
+
pipeline_tag: text-generation
|
| 13 |
+
library_name: transformers
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# tiny-random-MiniCPM-o-2_6
|
| 17 |
+
|
| 18 |
+
A minimal, randomly initialized version of MiniCPM-o-2_6 designed for testing and development purposes. This model maintains the same architecture as the original MiniCPM-o-2_6 but with drastically reduced dimensions to create a lightweight test model.
|
| 19 |
+
|
| 20 |
+
## Model Details
|
| 21 |
+
|
| 22 |
+
### Model Description
|
| 23 |
+
|
| 24 |
+
This is a tiny, randomly initialized version of the MiniCPM-o-2_6 multimodal model. It was created by scaling down the original model's dimensions while preserving the architecture structure. The model is intended for:
|
| 25 |
+
|
| 26 |
+
- Testing and development workflows
|
| 27 |
+
- Integration testing with Optimum-Intel
|
| 28 |
+
- Quick prototyping and experimentation
|
| 29 |
+
- CI/CD pipelines requiring lightweight models
|
| 30 |
+
|
| 31 |
+
**⚠️ Important:** This model is randomly initialized and should NOT be used for production inference. It is designed solely for testing purposes.
|
| 32 |
+
|
| 33 |
+
### Model Architecture
|
| 34 |
+
|
| 35 |
+
The model maintains the same architecture as MiniCPM-o-2_6 but with reduced dimensions:
|
| 36 |
+
|
| 37 |
+
**Language Model (LLM):**
|
| 38 |
+
- `hidden_size`: 40
|
| 39 |
+
- `num_hidden_layers`: 1
|
| 40 |
+
- `num_attention_heads`: 4
|
| 41 |
+
- `num_key_value_heads`: 2
|
| 42 |
+
- `intermediate_size`: 16
|
| 43 |
+
- `max_position_embeddings`: 128
|
| 44 |
+
- `vocab_size`: 151,700
|
| 45 |
+
|
| 46 |
+
**Vision Component:**
|
| 47 |
+
- `hidden_size`: 16
|
| 48 |
+
- `num_hidden_layers`: 1
|
| 49 |
+
- `num_attention_heads`: 4
|
| 50 |
+
- `intermediate_size`: 8
|
| 51 |
+
- `patch_size`: 14
|
| 52 |
+
|
| 53 |
+
**Audio/TTS Components:**
|
| 54 |
+
- Audio: Disabled (`init_audio: false`)
|
| 55 |
+
- TTS: Disabled (`init_tts: false`)
|
| 56 |
+
|
| 57 |
+
### Model Size
|
| 58 |
+
|
| 59 |
+
- **Total Parameters**: ~6.17M
|
| 60 |
+
- **Model Size**: ~12.4 MB (on disk)
|
| 61 |
+
- **Precision**: bfloat16
|
| 62 |
+
|
| 63 |
+
## Usage
|
| 64 |
+
|
| 65 |
+
### Basic Usage
|
| 66 |
+
|
| 67 |
+
```python
|
| 68 |
+
from transformers import AutoModel, AutoTokenizer, AutoProcessor
|
| 69 |
+
import torch
|
| 70 |
+
from PIL import Image
|
| 71 |
+
|
| 72 |
+
# Load model and tokenizer
|
| 73 |
+
model_id = "notlikejoe/tiny-random-MiniCPM-o-2_6"
|
| 74 |
+
model = AutoModel.from_pretrained(model_id, trust_remote_code=True, torch_dtype=torch.bfloat16)
|
| 75 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
|
| 76 |
+
processor = AutoProcessor.from_pretrained(model_id, trust_remote_code=True)
|
| 77 |
+
|
| 78 |
+
# Prepare inputs
|
| 79 |
+
text = "Hello, how are you?"
|
| 80 |
+
image = Image.new('RGB', (224, 224), color='red') # Dummy image
|
| 81 |
+
|
| 82 |
+
# Process inputs
|
| 83 |
+
inputs = processor(text=text, images=image, return_tensors="pt")
|
| 84 |
+
|
| 85 |
+
# Forward pass
|
| 86 |
+
model.eval()
|
| 87 |
+
with torch.no_grad():
|
| 88 |
+
outputs = model(**inputs)
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
### With Optimum-Intel
|
| 92 |
+
|
| 93 |
+
This model is compatible with Optimum-Intel for OpenVINO optimization:
|
| 94 |
+
|
| 95 |
+
```python
|
| 96 |
+
from optimum.intel import OVModelForCausalLM
|
| 97 |
+
from transformers import AutoTokenizer
|
| 98 |
+
|
| 99 |
+
model_id = "notlikejoe/tiny-random-MiniCPM-o-2_6"
|
| 100 |
+
|
| 101 |
+
# Export to OpenVINO format
|
| 102 |
+
ov_model = OVModelForCausalLM.from_pretrained(
|
| 103 |
+
model_id,
|
| 104 |
+
export=True,
|
| 105 |
+
trust_remote_code=True
|
| 106 |
+
)
|
| 107 |
+
|
| 108 |
+
# Use for inference
|
| 109 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
|
| 110 |
+
```
|
| 111 |
+
|
| 112 |
+
## Model Validation
|
| 113 |
+
|
| 114 |
+
The model has been validated to ensure:
|
| 115 |
+
|
| 116 |
+
✅ Model loads successfully from Hugging Face
|
| 117 |
+
✅ Config, tokenizer, and processor load correctly
|
| 118 |
+
✅ Model structure matches expected architecture
|
| 119 |
+
✅ Compatible with Optimum-Intel export
|
| 120 |
+
✅ Forward pass completes without errors
|
| 121 |
+
|
| 122 |
+
## Limitations
|
| 123 |
+
|
| 124 |
+
1. **Random Initialization**: This model is randomly initialized and will not produce meaningful outputs
|
| 125 |
+
2. **Reduced Dimensions**: The model dimensions are minimal and may not capture complex patterns
|
| 126 |
+
3. **Testing Only**: This model is intended for testing and development, not production use
|
| 127 |
+
4. **Limited Vocabulary**: The vocabulary has been reduced to 2000 entries for size optimization
|
| 128 |
+
|
| 129 |
+
## Training Details
|
| 130 |
+
|
| 131 |
+
This model was not trained. It is a randomly initialized, dimensionally-reduced version of MiniCPM-o-2_6 created for testing purposes.
|
| 132 |
+
|
| 133 |
+
### Training Data
|
| 134 |
+
|
| 135 |
+
N/A - Model is randomly initialized.
|
| 136 |
+
|
| 137 |
+
## Evaluation
|
| 138 |
+
|
| 139 |
+
This model is not intended for evaluation on standard benchmarks as it is randomly initialized.
|
| 140 |
+
|
| 141 |
+
## Citation
|
| 142 |
+
|
| 143 |
+
If you use this model, please cite the original MiniCPM-o-2_6 model:
|
| 144 |
+
|
| 145 |
+
```bibtex
|
| 146 |
+
@misc{minicpm-o-2_6,
|
| 147 |
+
title={MiniCPM-o-2_6},
|
| 148 |
+
author={OpenBMB},
|
| 149 |
+
year={2024},
|
| 150 |
+
howpublished={\url{https://huggingface.co/openbmb/MiniCPM-o-2_6}}
|
| 151 |
+
}
|
| 152 |
+
```
|
| 153 |
+
|
| 154 |
+
## Model Card Contact
|
| 155 |
+
|
| 156 |
+
For questions or issues related to this model, please open an issue in the repository.
|
| 157 |
+
|
| 158 |
+
## License
|
| 159 |
+
|
| 160 |
+
This model is licensed under the Apache 2.0 License, same as the base model.
|
| 161 |
+
|