A multi-modal LLM integrated ChatGPT with Azure Cognitive Service
Project description
CogsGPT
A multi-modal LLM which integrates ChatGPT with Azure Cognitive Service.
Now you can go to CogsGPT on HuggingFace Space to experice the full capabilities of CogsGPT!!!
If you find this repo useful, please consider giving it a star!
Overview
What is Azure Cognitive Service
(Answered by ChatGPT)
Azure Cognitive Services is a collection of pre-built machine learning models that developers can use to add intelligent features to their applications without requiring extensive knowledge of data science or machine learning. These services include vision, speech, language, and decision-making capabilities, such as text translation, speech recognition, image recognition, and sentiment analysis. Azure Cognitive Services allows developers to quickly and easily incorporate advanced AI features into their applications, reducing the time and cost of building such features from scratch. It also provides enterprise-level security, scalability, and availability for applications that require high levels of reliability and performance.
What is CogsGPT
CogsGPT is a multi-modal LLM which utilizes the ChatGPT model as the controller and integrates with Azure Cognitive Services as collaborative executors to achieve multimodal capabilities to some extent. Using CogsGPT, you can simply access Azure Cognitive Services via natural language to process image or audio inputs, without any knowledge of the underlying APIs. You can even ask CogsGPT to perform some complex tasks such as summarizing a long speech into a short audio clip while retaining the main information. CogsGPT will automatically decide which services to use and how to use them to achieve the goal.
How does it work
The workflow of CogsGPT consists of three stages:
- Task Planing Stage: In this stage, CogsGPT will leverage ChatGPT to first think of the user's request carefully, and then parse it into a sequence of Cognitive Service tasks which have the most potentials to solve user's request. Each task may depend on the execution result of previous tasks.
- Task Execution Stage: In this stage, CogsGPT will execute the tasks one by one. The execution result will be stored for future reference.
- Response Generation Stage: In this stage, CogsGPT will leverage ChatGPT again to generate a final response to user's request based on the execution results of the second stage. The response may be a text, an image, an audio, or a combination of them.
Getting Started
Prerequisites
- Python 3.8+
- OpenAI API key
- Azure Cognitive Multi-Service deployment (How to deploy)
- Set the following environment variables:
# OpenAI export OPENAI_API_TYPE="openai" export OPENAI_API_KEY="<OpenAI API Key>" # Azure Cognitive Service export COGS_ENDPOINT="<Azure Cognitive Service Endpoint>" export COGS_KEY="<Azure Cognitive Service Key>" export COGS_REGION="<Azure Cognitive Service Region>"
Quick Install
pip install cogsgpt
Usage
You can use CogsGPT in your own application to process image or audio inputs within three lines of codes:
from cogsgpt import CogsGPT
agent = CogsGPT(model_name="gpt-3.5-turbo")
agent.chat("What's the content in a.jpg?")
For more details on the usage, please refer to the API Reference
Gradio Demo
The CogsGPT Gradio demo is now available on HuggingFace Space! To make it easier and more affordable to try out the capabilities of CogsGPT, we are offering an Azure Cognitive Service resource for FREE to use in the demo! All you need is an OpenAI API key to get started chatting with CogsGPT!
You can also use the following commands to run the demo locally with your own Azure Cognitive Service (Don't forget to set the environment variables first!):
pip install gradio
python app.py
Now open your favorite browser and ENJOY YOUR CHAT!
Acknowledgments
This project is inspired by HuggingGPT, and is built on top of LangChain.
License
This project is licensed under the MIT License - see the LICENSE file for details
Contributing
As an open source project, we welcome contributions and suggestions. Please follow the fork and pull request workflow to contribute to this project. Please do not try to push directly to this repo unless you are maintainer.
Contact
If you have any questions, please feel free to contact us via weitian.bnu@gmail.com
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
Built Distribution
File details
Details for the file cogsgpt-0.0.4.tar.gz
.
File metadata
- Download URL: cogsgpt-0.0.4.tar.gz
- Upload date:
- Size: 26.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e7029a335753733e071f993d122be4af659f26a40c944aab9209b5a3be393f1 |
|
MD5 | 839b002f233cc237f7d077b0a1376546 |
|
BLAKE2b-256 | 1a4988e7d197d7775d846ca8873f1d90eee7d215130c6a73cce53b478b6505f5 |
File details
Details for the file cogsgpt-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: cogsgpt-0.0.4-py3-none-any.whl
- Upload date:
- Size: 27.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d40c4a09442bf9846817de2e6040b82741db3a7794629012c85943985295d8e |
|
MD5 | 1d23143ec2105f9b28482c87d263140f |
|
BLAKE2b-256 | 874decd578f276c2fc0a3c0a6aedd504b632c0e68579044cda48bc31990d1018 |