Metadata-Version: 2.1
Name: ctm-ai
Version: 0.0.2
Summary: A cognitive architecture motivated by consciousness turing machine.
License: Apache 2.0 License
Author: Haofei Yu
Author-email: yuhaofei44@gmail.com
Requires-Python: >=3.9,<3.12
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: beartype
Requires-Dist: google-generativeai
Requires-Dist: huggingface_hub (==0.27.1)
Requires-Dist: lxml-html-clean (>=0.4.1,<0.5.0)
Requires-Dist: moviepy
Requires-Dist: mypy (>=1.8.0,<2.0.0)
Requires-Dist: newspaper3k (>=0.2.8,<0.3.0)
Requires-Dist: openai (>=1.59.7,<2.0.0)
Requires-Dist: opencv-python
Requires-Dist: pydantic (>=2.10.5,<3.0.0)
Requires-Dist: requests
Requires-Dist: scikit_learn (==1.6.1)
Requires-Dist: sockio
Requires-Dist: termcolor
Requires-Dist: types-requests
Requires-Dist: wordfreq
Description-Content-Type: text/markdown

![ctm-ai-banner](assets/ctm-ai-banner.png)



<h1 align="center">CTM-AI: A Blueprint for Implementing a General AI System Inspired by Consciousness Theory</h1>

<div align="center">

[![pypi](https://img.shields.io/pypi/v/ctm-ai.svg)](https://pypi.org/project/ctm-ai/)
[![Python 3.10](https://img.shields.io/badge/python-%E2%89%A53.10-blue)](https://www.python.org/downloads/release/python-3109/)
[![GitHub pull request](https://img.shields.io/badge/PRs-welcome-red)](https://github.com/hiyouga/LLaMA-Factory/pulls)

</div>

## News

* [Jan 19] We release our python package `pip install ctm-ai` to use in one click.

## Introduction

**CTM-AI** is a component-based multimodal training and inference framework that support any modality input and text-form output. Its key architecture is motivated by Conscious Turing Machine (CTM) [[paper]](https://arxiv.org/abs/2107.13704). Each CTM includes multiple processors to handle inputs from different modalities and it includes up-tree and down-tree process to conduct iterative inference process.

## Get started

### Install from pip

You can install `ctm-ai` from `pypi` to use it as a package:

```bash
pip install ctm-ai
```

### Install from scratch

Use a virtual environment, e.g. with anaconda3:

```bash
conda create -n ctm-space python=3.10
conda activate ctm-space
curl -sSL https://install.python-poetry.org | python3
export PATH="$HOME/.local/bin:$PATH"
```

### Running the examples
To run examples provided in the `examples`:

```bash
poetry install
cd examples
python sarcasm_detection.py
```

## Developing

#### Develop Demo

To develop the CTM-AI inference demo (both frontend and backend), please follow the instructions below.

For frontend development:

```bash
cd frontend
npm install
npm start
```

For backend development:

```bash
poetry install -E backend
uvicorn backend.app.main:app --reload
```

#### Install dev options

Follow the installation instruction above and then, instead of running `python -m pip install -e .`, run the following commands:

```
python -m pip install -e ".[dev]"
mypy --install-types --non-interactive ctm-ai
python -m pip install pre-commit
pre-commit clean
pre-commit install
```

The installation of pre-commit would avoid formatting error and large file injects into github commits.

