Skip to content

ainize-team/TTI-Worker

Repository files navigation

TTI-Worker

Serving Text To Image Model Using FastAPI and Celery

How to start

Using docker-compose(recommended)

  1. Create RabbitMQ and FastAPI container(refer to TTI-FastAPI)

  2. Clone repository

git clone https://github.com/ainize-team/TTI-Worker
cd TTI-Worker
  1. Edit docker-compose.yml and .env file for your project.
  1. Run worker container
docker-compose up -d

# If you want to run a specific worker container, write service name.
docker-compose up -d <service name>

Using docker

  1. Run RabbitMQ comtainer as a broker
docker run -d --name tti-rabbitmq -p 5672:5672 -p 15672:15672 --restart=unless-stopped rabbitmq:3.11.2-management
  1. Clone repository
git clone https://github.com/ainize-team/TTI-Worker
cd TTI-Worker
  1. Build docker image
docker build -t tti-worker .
  1. Create docker container
docker run -d --name <worker_container_name> \
--gpus='"device=0"' -e BROKER_URI=<broker_uri> \
-e DATABASE_URL=<firebase_realtime_database_url> \
-e STORAGE_BUCKET=<firebase_storage_url> \
-v <firebase_credential_path>:/app/key -v <model_local_path>:/app/model \
tti-worker

Or, you can use the .env file to run as follows.

docker run -d --name <worker_container_name> \
--gpus='"device=0"' \
--env-file <env filename> \
-v <firebase_credential_path>:/app/key -v <model_local_path>:/app/model \
tti-worker

Test with FastAPI

For Developers

  1. Install dev package
pip install -r requirements.txt
pip install -r requirements-dev.txt
  1. Install pre-commit
pre-commit install

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •