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.com
🙏 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.4.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.4.tar.gz.
File metadata
- Download URL: capibara_model-1.1.4.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 |
155eb2fb58dce7894b5472e64a67a81bca498c7135d9da9c3f76dda7dd2c3ec1
|
|
| MD5 |
6dc16bc4cc801d5c24c5272d668876bd
|
|
| BLAKE2b-256 |
2efde456a627ed58f01340908a836173a85e88f9104ffcf06d542f9137ecbae7
|
File details
Details for the file capibara_model-1.1.4-py3-none-any.whl.
File metadata
- Download URL: capibara_model-1.1.4-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 |
e54c373bcb68983b4b963cdca3269d693d9f7d56e013ffa119507166d53cc078
|
|
| MD5 |
1d41a12e1b41fa2db2f5c2aca6ffab29
|
|
| BLAKE2b-256 |
d944735f6a677ce1c3a26a68e549667fbe135ae0e61d12eff6b165a3c6341826
|