Chinnu AI: Quantum-inspired chatbot framework with deep learning integration.
Project description
Chinnu AI with Quantum Integration
Gift for my best friend
Chinnu AI is a quantum-inspired chatbot framework that merges traditional deep learning methods with quantum computing concepts to deliver advanced conversational experiences.
Features
- Quantum State Representation: Utilize
QuantumStatefor quantum-inspired computations. - Training Framework: Train quantum-enhanced neural networks using
QuantumTrainer. - Dynamic Neural Network: Leverage PyTorch-based deep learning for conversational AI.
- JSON-based Conversations: Enable flexible interaction using structured JSON inputs.
- Modular Design: Easily extend or integrate into existing systems.
Installation
-
Clone the repository:
git clone https://github.com/yourusername/chinnu-ai.git cd chinnu-ai
-
Install dependencies:
pip install -r requirements.txt
-
Install the package:
pip install .
Usage
Training Chinnu AI
Here is an example to train Chinnu AI with quantum integration:
import torch
from ChinnuAi import QuantumState, QuantumTrainer, initialize_chinnu_ai, train_chinnu_ai
# Initialize Quantum State and Trainer
initial_state = [1, 0, 0, 0]
target_state = [0.5, 0.5, 0.5, 0.5]
quantum_model = QuantumState(initial_state)
quantum_trainer = QuantumTrainer(quantum_model, training_data=None)
# Initialize Neural Network
input_size = 4
hidden_size = 8
output_size = 4
model = initialize_chinnu_ai(input_size, hidden_size, output_size)
# Example Dataset
dataset = [
(torch.tensor([1, 0, 0, 0]), torch.tensor([0.5, 0.5, 0.5, 0.5])),
(torch.tensor([0, 1, 0, 0]), torch.tensor([0.5, 0.5, 0.5, 0.5])),
]
dataloader = torch.utils.data.DataLoader(dataset, batch_size=1, shuffle=True)
# Train the Model
epochs = 10
learning_rate = 0.01
train_chinnu_ai(model, quantum_trainer, target_state, dataloader, epochs, learning_rate)
Live Chat with Chinnu AI
Chinnu AI can engage in real-time conversations based on JSON input:
from ChinnuAi import chat_with_chinnu_ai
import json
# Example JSON input
json_input = '{"input": [1, 0, 0, 0], "responses": ["Hello!", "How can I assist?", "Here is your data.", "Goodbye!"]}'
response = chat_with_chinnu_ai(model, quantum_model, json_input)
print("Chinnu AI response:", response)
Quantum State Manipulation
Chinnu AI allows you to directly manipulate quantum states for advanced computations:
from ChinnuAi import QuantumState
# Initialize a Quantum State
qs = QuantumState([1, 0, 0, 0])
# Apply a Quantum Gate
qs.apply_gate(QuantumGates.H)
print("State after Hadamard Gate:", qs)
# Measure the State
measurement = qs.measure()
print("Measurement Outcome:", measurement)
Example JSON Dataset
A sample JSON dataset for batch testing:
{
"data": [
{
"input": [1, 0, 0, 0],
"responses": ["Welcome to Chinnu AI!", "How can I assist you today?", "Here is your data.", "Goodbye!"]
},
{
"input": [0, 1, 0, 0],
"responses": ["Hello again!", "Need assistance?", "Fetching details.", "See you soon!"]
}
]
}
Batch Testing with JSON
import json
from ChinnuAi import chat_with_chinnu_ai
# Load the JSON file
with open('test_data.json', 'r') as file:
test_data = json.load(file)
# Process each entry
for entry in test_data['data']:
json_input = json.dumps(entry)
response = chat_with_chinnu_ai(model, quantum_model, json_input)
print("Input:", entry["input"], "Response:", response)
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! Open an issue or submit a pull request to improve Chinnu AI.
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
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 chinnuai-1.2.5.tar.gz.
File metadata
- Download URL: chinnuai-1.2.5.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
065ca24d393e53734f5f888d6d3518178254d5737e92f9a31c4e6c155df70ff3
|
|
| MD5 |
4741e15209afd4f86a49a374bdd3a8a3
|
|
| BLAKE2b-256 |
0c2397f6ddbd8367ccc013d377668d5dff3af7d0863eab3ac51dd82a30a7030c
|
File details
Details for the file ChinnuAi-1.2.5-py3-none-any.whl.
File metadata
- Download URL: ChinnuAi-1.2.5-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c5a361fdeb897f14eccfe47e22533f65582d1d6df45ed9b3a8ae03e19438a38
|
|
| MD5 |
7069d9d1766212097f4dbf09f2208c93
|
|
| BLAKE2b-256 |
1d869aee3292fcabb2a48bb598f9227350bf8e09870d6a96897eda801fdd05e3
|