This repo does content moderation for text data in general
There needs to be a .env
file with following parameters.
ProcessNumCPUPerReplica=0.1
ProcessNumReplicas=1
ProcessMaxCon=100
PromotionNumCPUPerReplica=0.1
PromotionNumReplicas=1
PromotionMaxCon=100
LeetNumCPUPerReplica=0.1
LeetNumReplicas=1
LeetMaxCon=100
ModerateNumCPUPerReplica=0.01
ModerateNumGPUPerReplica=0.33
ModerateNumReplicas=1
ModerateMaxCon=100
CombineNumCPUPerReplica=0.1
CombineNumReplicas=1
CombineMaxCon=100
SnowflakeResultsQueue=content_moderation_text_comment-results_dev
SnowflakeProfileResultsQueue=content_moderation_text_profile-results_dev
AiModelBucket=datalake-dev
For DS Team internal testing, we also need to add the following env vars to the .env
file:
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-2
TBC
- Ensure there are environment variables or
.env
file, see section above for environment variables. - Ensure GPU for docker is enabled. See section below.
- Once the container is able to detect the GPU, we can follow the normal process of
docker-compose build
docker-compose up
To enable the GPU for Docker, make sure Nvidia drivers for the system are installed. Refer link for details
Commands which can help install Nvidia drivers are:
unbuntu-drivers devices
sudo ubuntu-drivers autoinstall
Then nvidia-docker2 tools needs to be installed. To install follow the below instructions. Refer link for details
curl https://get.docker.com | sh && sudo systemctl --now enable docker
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) && curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - && curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update
sudo apt-get install -y nvidia-docker2
sudo systemctl restart docker
- Test if the code is working as expected. Firstly on terminal, do:
ray start --head --port=6300
- Then, deploy the ray services:
python serve_tasks/tasks.py
- Run this:
python serve_demo.py