Skip to main content

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

🌐 Website | 💻 GitHub

🙏 Acknowledgments

Special thanks to:

  • JAX/Flax team
  • TPU Research Cloud
  • Open source community

Project details


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

capibara_model-1.1.6-py3-none-any.whl (63.7 kB view details)

Uploaded Python 3

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

Hashes for capibara_model-1.1.6.tar.gz
Algorithm Hash digest
SHA256 917f34910c1f5a6f79e541c60517980de16e4d1eae168ef9b8c08c0376224ada
MD5 7502f44ec7e6e05550bcf87735f6b52b
BLAKE2b-256 9778689ac14f18ff178ce9cb3422946fb8170094f5483005b81a8a39606f3ae7

See more details on using hashes here.

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

Hashes for capibara_model-1.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 dc65a173a59c59769c938a9d5bc1059ec27eecd292bacea38b9a5978ee70b09a
MD5 a45d06455fa70163c407b41c7720d6aa
BLAKE2b-256 7493dbb5c59921f4cc4d0cbca0317969c8ab0df5820bffdefc4142bd31deeaf0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page