Language model with contextual processing
Project description
🦫 CapibaraModel
Language model with contextual processing based on JAX/Flax.
✨ Features
-
🧠 Architecture:
- 🔄 Multi-head attention
- 🎯 Contextual activation
- 🔍 Coherence detection
- 🎭 Personality management
-
⚡ Optimizations:
- 🚀 Native TPU support
- ⚙️ Efficient processing
- 📦 Optimized batching
- 🕸️ Integrated sparsity
📋 Requirements
- Python >= 3.8
- JAX >= 0.4.1
- Flax >= 0.6.0
- Optax >= 0.1.3
🚀 Installation
pip install capibara_model
💻 Usage
Basic Example
from capibara_model.core.model import CapibaraModel
from capibara_model.core.inference import CapibaraInference
# Create model
model = CapibaraModel(hidden_size=768, num_heads=8)
# Create inference
inference = CapibaraInference(hidden_size=768)
# Generate response
response = inference("How are you?")
print(response)
Advanced Example
# Custom configuration
config = {
'model': {
'hidden_size': 1024,
'num_heads': 16,
'num_layers': 24,
'dropout_rate': 0.1
},
'training': {
'batch_size': 32,
'learning_rate': 1e-4,
'warmup_steps': 1000
}
}
# Create model with custom config
model = CapibaraModel(**config['model'])
# Process conversation
context = "Previous conversation context..."
response = inference(
"What's the meaning of life?",
context=context
)
⚙️ Configuration
config = {
'hidden_size': 768,
'num_heads': 8,
'num_layers': 12,
'dropout_rate': 0.1,
'use_tpu': False
}
🛠️ Development
# Install development dependencies
pip install capibara_model[dev]
# Run tests
pytest tests/
# Run specific test
pytest tests/test_model.py -k "test_attention"
# Check code style
black capibara_model/
📝 License
MIT License. See LICENSE for more information.
📫 Contact
Marco Durán - marco@anachroni.co
🙏 Acknowledgments
Special thanks to:
- JAX/Flax team
- TPU Research Cloud
- Open source community
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
capibara_model-1.1.6.tar.gz
(37.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file capibara_model-1.1.6.tar.gz.
File metadata
- Download URL: capibara_model-1.1.6.tar.gz
- Upload date:
- Size: 37.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
917f34910c1f5a6f79e541c60517980de16e4d1eae168ef9b8c08c0376224ada
|
|
| MD5 |
7502f44ec7e6e05550bcf87735f6b52b
|
|
| BLAKE2b-256 |
9778689ac14f18ff178ce9cb3422946fb8170094f5483005b81a8a39606f3ae7
|
File details
Details for the file capibara_model-1.1.6-py3-none-any.whl.
File metadata
- Download URL: capibara_model-1.1.6-py3-none-any.whl
- Upload date:
- Size: 63.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc65a173a59c59769c938a9d5bc1059ec27eecd292bacea38b9a5978ee70b09a
|
|
| MD5 |
a45d06455fa70163c407b41c7720d6aa
|
|
| BLAKE2b-256 |
7493dbb5c59921f4cc4d0cbca0317969c8ab0df5820bffdefc4142bd31deeaf0
|