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.com

🌐 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.5.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.5-py3-none-any.whl (63.8 kB view details)

Uploaded Python 3

File details

Details for the file capibara_model-1.1.5.tar.gz.

File metadata

  • Download URL: capibara_model-1.1.5.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.5.tar.gz
Algorithm Hash digest
SHA256 9d0673acd20e4db889a83a59ca68ea8c1ad64a9ec2c61208a0e819d7bece0b27
MD5 0a0f21bf00ac2103e6f07f08c56ec717
BLAKE2b-256 421c65a4918b94e59bee48c4b5fd53a70661a6c156b9bd9a2e631324e3e31f87

See more details on using hashes here.

File details

Details for the file capibara_model-1.1.5-py3-none-any.whl.

File metadata

  • Download URL: capibara_model-1.1.5-py3-none-any.whl
  • Upload date:
  • Size: 63.8 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 61e7b9b9f30666698ed359c50e6a00bcc77c17e30f9d3b0888e4f277850e4bbd
MD5 629085ac23ada33a50ca0f016116f566
BLAKE2b-256 bea2b95dc45d65eefdb97e09fa732411555b6019a7b73c57c5dd3da7f3959ddb

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