chai-one


Namechai-one JSON
Version 0.0.2 PyPI version JSON
download
home_pagehttps://github.com/kyegomez/Chai-1
SummaryPaper - Pytorch
upload_time2024-09-10 02:51:26
maintainerNone
docs_urlNone
authorKye Gomez
requires_python<4.0,>=3.10
licenseMIT
keywords artificial intelligence deep learning optimizers prompt engineering
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Multi-Modality](agorabanner.png)](https://discord.com/servers/agora-999382051935506503)

# Chai-1

[![Join our Discord](https://img.shields.io/badge/Discord-Join%20our%20server-5865F2?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/agora-999382051935506503) [![Subscribe on YouTube](https://img.shields.io/badge/YouTube-Subscribe-red?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/@kyegomez3242) [![Connect on LinkedIn](https://img.shields.io/badge/LinkedIn-Connect-blue?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/kye-g-38759a207/) [![Follow on X.com](https://img.shields.io/badge/X.com-Follow-1DA1F2?style=for-the-badge&logo=x&logoColor=white)](https://x.com/kyegomezb)

An free and open source community implementation of Chai-1 in PyTorch. [Paper is here](https://chaiassets.com/chai-1/paper/technical_report_v1.pdf)

Join our discord to help us implement this paper!


## Installation

```bash
pip3 install chai-one
```

## Usage

```python

######### example.py
import torch
from loguru import logger
from chai_one.model import ChaiOne

# Set up model parameters
dim_single = 128
dim_pairwise = 128
dim_msa = 128
dim_msa_input = 134  # Adjusted to match the expected input dimension
dim_additional_msa_feats = 2
window_size = 25

# Initialize the model
logger.info("Initializing ChaiOne model")
model = ChaiOne(
    dim_single=dim_single,
    dim_pairwise=dim_pairwise,
    msa_depth=4,
    dim_msa=dim_msa,
    dim_msa_input=dim_msa_input,  # Set to 134
    dim_additional_msa_feats=0,
    msa_pwa_heads=8,
    msa_pwa_dim_head=32,
    layerscale_output=False,
    heads=8,
    window_size=window_size,
    num_memory_kv=0,
    attn_layers=48,
)

# Create dummy input tensors
batch_size = 1
seq_length = 100
num_msa = 4

logger.info(
    f"Creating input tensors with shape: batch_size={batch_size}, seq_length={seq_length}, num_msa={num_msa}"
)
single_repr = torch.randn(batch_size, seq_length, dim_single)
pairwise_repr = torch.randn(
    batch_size, seq_length, seq_length, dim_pairwise
)

# Create msa tensor with matching input size for msa_init_proj (134 features)
msa = torch.randn(
    batch_size, num_msa, seq_length, dim_msa_input
)  # Adjusted to 134

# Forward pass
logger.info("Performing forward pass")
output = model(
    single_repr=single_repr,
    pairwise_repr=pairwise_repr,
    msa=msa,
)

logger.info(f"Output shape: {output.shape}")

```



# License
MIT

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/kyegomez/Chai-1",
    "name": "chai-one",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "artificial intelligence, deep learning, optimizers, Prompt Engineering",
    "author": "Kye Gomez",
    "author_email": "kye@apac.ai",
    "download_url": "https://files.pythonhosted.org/packages/10/85/a8e467a1d91378d58daa8d23fc2148a8a0cb04342e4c92fdc4f339e2b230/chai_one-0.0.2.tar.gz",
    "platform": null,
    "description": "[![Multi-Modality](agorabanner.png)](https://discord.com/servers/agora-999382051935506503)\n\n# Chai-1\n\n[![Join our Discord](https://img.shields.io/badge/Discord-Join%20our%20server-5865F2?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/agora-999382051935506503) [![Subscribe on YouTube](https://img.shields.io/badge/YouTube-Subscribe-red?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/@kyegomez3242) [![Connect on LinkedIn](https://img.shields.io/badge/LinkedIn-Connect-blue?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/kye-g-38759a207/) [![Follow on X.com](https://img.shields.io/badge/X.com-Follow-1DA1F2?style=for-the-badge&logo=x&logoColor=white)](https://x.com/kyegomezb)\n\nAn free and open source community implementation of Chai-1 in PyTorch. [Paper is here](https://chaiassets.com/chai-1/paper/technical_report_v1.pdf)\n\nJoin our discord to help us implement this paper!\n\n\n## Installation\n\n```bash\npip3 install chai-one\n```\n\n## Usage\n\n```python\n\n######### example.py\nimport torch\nfrom loguru import logger\nfrom chai_one.model import ChaiOne\n\n# Set up model parameters\ndim_single = 128\ndim_pairwise = 128\ndim_msa = 128\ndim_msa_input = 134  # Adjusted to match the expected input dimension\ndim_additional_msa_feats = 2\nwindow_size = 25\n\n# Initialize the model\nlogger.info(\"Initializing ChaiOne model\")\nmodel = ChaiOne(\n    dim_single=dim_single,\n    dim_pairwise=dim_pairwise,\n    msa_depth=4,\n    dim_msa=dim_msa,\n    dim_msa_input=dim_msa_input,  # Set to 134\n    dim_additional_msa_feats=0,\n    msa_pwa_heads=8,\n    msa_pwa_dim_head=32,\n    layerscale_output=False,\n    heads=8,\n    window_size=window_size,\n    num_memory_kv=0,\n    attn_layers=48,\n)\n\n# Create dummy input tensors\nbatch_size = 1\nseq_length = 100\nnum_msa = 4\n\nlogger.info(\n    f\"Creating input tensors with shape: batch_size={batch_size}, seq_length={seq_length}, num_msa={num_msa}\"\n)\nsingle_repr = torch.randn(batch_size, seq_length, dim_single)\npairwise_repr = torch.randn(\n    batch_size, seq_length, seq_length, dim_pairwise\n)\n\n# Create msa tensor with matching input size for msa_init_proj (134 features)\nmsa = torch.randn(\n    batch_size, num_msa, seq_length, dim_msa_input\n)  # Adjusted to 134\n\n# Forward pass\nlogger.info(\"Performing forward pass\")\noutput = model(\n    single_repr=single_repr,\n    pairwise_repr=pairwise_repr,\n    msa=msa,\n)\n\nlogger.info(f\"Output shape: {output.shape}\")\n\n```\n\n\n\n# License\nMIT\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Paper - Pytorch",
    "version": "0.0.2",
    "project_urls": {
        "Documentation": "https://github.com/kyegomez/Chai-1",
        "Homepage": "https://github.com/kyegomez/Chai-1",
        "Repository": "https://github.com/kyegomez/Chai-1"
    },
    "split_keywords": [
        "artificial intelligence",
        " deep learning",
        " optimizers",
        " prompt engineering"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "243113258cb69e833b1bd9cb82ce2c745c931faeabe3709dbb540c2c252751e2",
                "md5": "40976d5f6e028e71f2c9acf823b65025",
                "sha256": "67befbc4d89cc15ffee664d6436e0ca4a5f9c893a9a8842e3d18784a44c1a8aa"
            },
            "downloads": -1,
            "filename": "chai_one-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "40976d5f6e028e71f2c9acf823b65025",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 4115,
            "upload_time": "2024-09-10T02:51:26",
            "upload_time_iso_8601": "2024-09-10T02:51:26.105453Z",
            "url": "https://files.pythonhosted.org/packages/24/31/13258cb69e833b1bd9cb82ce2c745c931faeabe3709dbb540c2c252751e2/chai_one-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1085a8e467a1d91378d58daa8d23fc2148a8a0cb04342e4c92fdc4f339e2b230",
                "md5": "a44990043e5e4112641d660493b04235",
                "sha256": "ce90c9b2a08727f21ecd4bf2e7771eb8089c539d26c09b6a8aa273e99d9ba646"
            },
            "downloads": -1,
            "filename": "chai_one-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "a44990043e5e4112641d660493b04235",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 3839,
            "upload_time": "2024-09-10T02:51:26",
            "upload_time_iso_8601": "2024-09-10T02:51:26.988336Z",
            "url": "https://files.pythonhosted.org/packages/10/85/a8e467a1d91378d58daa8d23fc2148a8a0cb04342e4c92fdc4f339e2b230/chai_one-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-10 02:51:26",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "kyegomez",
    "github_project": "Chai-1",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "chai-one"
}
        
Elapsed time: 0.34330s