Comwork AI API that bring all the AI models you want as an API using a ModelDriver's abstract:
class ModelDriver(ABC):
@abstractmethod
def load_model(self):
pass
@abstractmethod
def generate_response(self, prompt: Prompt):
passThis API is also used as an internal component for Comwork Cloud, more details here: https://doc.cloud.comwork.io/docs/tutorials/cwai
You can also find a frontend client here to test the API: https://gitlab.comwork.io/oss/cwai/cwai-chat
- Main repo: https://gitlab.comwork.io/oss/cwai/cwai-api.git
- Github mirror: https://github.com/comworkio/cwai-api.git
- Gitlab mirror: https://gitlab.com/ineumann/cwai-api.git
cp .env.dist .env # replace your variables in the .env file you just createddocker-compose -f docker-compose-local.yml up --build --force-recreateThen you can open http://localhost:8000 and test the API via Swagger.
- GPT2
- bert-base-multilingual-uncased-sentiment
- nltk
- Textblob
In order to avoid downloading to much data, you can override the list of the models with this variable:
ENABLED_MODELS='["gpt2", "mock"]'
For example here, we only load the 500mb of data coming from GPT2