turns-00003.parquet:90138
1b0f51db21a435d7ebf5abfd
turn 1/1gpt-4-0314EnglishIndia727 words
degenerate_repetitionAbsentFinal dense release
USER
Give complete solution for the below project stepwise in docker Project: AI Toolchain is a collection of tools for quickly building and deploying machine learning models for various use cases. Currently, the toolchain includes a text translation model, and more models may be added in the future. It abstracts the dirty details of how a model works similar to Huggingface and gives a clean API that you can orchestrate at aenter code here BFF level. Features to be implemented Abstract the layer of deployment for AI Tools. Anyone should be easily add a new model to the stack without thinking about deployments. We should be able to deploy AI Tools in such a way where each model (every model can be packaged as a container) should be independently scalable. As a user, I should be able to access APIs associated with any model. Product Set Up https://github.com/Samagra-Development/ai-tools#setup GitHub (Dont use the same): Added a centralised docker compose file @pSN0WpSN0W committed 16 hours ago commit 3e1f7db313c84295d41bf1f0d030abb68b408c0c 68 changes: 68 additions & 0 deletions68 docker-compose-restructure.yml Comment on this file @@ -11,3 +11,71 @@ services: environment: - PYTHONUNBUFFERED=1 - PYTHONDONTWRITEBYTECODE=1 asr_google: build: context: src/asr/google/remote/. dockerfile: Dockerfile ports: - “8002:8000” conversation_terminator: build: context: src/conversation_terminator/remote/. dockerfile: Dockerfile ports: - “8003:8000” coref_spacy: build: context: src/coref/spacy/local/. dockerfile: Dockerfile ports: - “8004:8000” translation_bhasini: build: context: src/text_translation/bhashini/remote/. dockerfile: Dockerfile ports: - “8005:8000” lang_detection_bhasini: build: context: src/text_lang_detection/bhashini/remote/. dockerfile: Dockerfile ports: - “8006:8000” embedding_openai: build: context: /home/sn0w/Desktop/SamagraX/ai-tools/src/embeddings/openai/remote/. dockerfile: Dockerfile ports: - “8007:8000” environment: - OPENAI_API_KEY=“ABC” llm_openai_gpt3: build: context: src/llm/openai/chatgpt3/. dockerfile: Dockerfile ports: - “8008:8000” environment: - OPENAI_API_KEY=“ABC” llm_openai_gpt4: build: context: src/llm/openai/chatgpt4/. dockerfile: Dockerfile ports: - “8009:8000” environment: - OPENAI_API_KEY=“ABC” t2embedding_openai: build: context: src/t2embedding/openai/remote/. dockerfile: Dockerfile ports: - “8010:8000” environment: - OPENAI_API_KEY=“ABC” translation_google: build: context: src/text_translation/google/remote/. dockerfile: Dockerfile ports: - “8011:8000” 2 changes: 1 addition & 1 deletion2 src/asr/google/remote/requirements.txt Comment on this file @@ -2,6 +2,6 @@ aiohttp==3.8.4 quart==0.18.3 async-cache==1.1.1 requests google-cloud-speech==1.5.0 google-cloud-speech google-auth pydub 3 changes: 1 addition & 2 deletions3 src/embeddings/openai/remote/requirements.txt Comment on this file @@ -6,5 +6,4 @@ openai numpy pandas tiktoken sklearn AST sklearn 14 changes: 14 additions & 0 deletions14 src/llm/openai/chatgpt4/Dockerfile Comment on this file @@ -0,0 +1,14 @@ # Use an official Python runtime as a parent image FROM python:3.9-slim WORKDIR /app COPY requirements.txt requirements.txt RUN pip3 install -r requirements.txt # Copy the rest of the application code to the working directory COPY . /app/ EXPOSE 8000 # Set the entrypoint for the container CMD [“hypercorn”, “–bind”, “0.0.0.0:8000”, “api:app”] 7 changes: 7 additions & 0 deletions7 src/llm/openai/chatgpt4/requirements.txt Comment on this file @@ -0,0 +1,7 @@ aiohttp==3.8.4 quart==0.18.3 async-cache==1.1.1 requests openai openai_async tenacity
ASSISTANT
Here's the complete solution for implementing the AI Toolchain using Docker step by step. 1. Clone the AI Toolchain repo from Github: ``` git clone https://github.com/Samagra-Development/ai-tools.git cd ai-tools ``` 2. Create a centralized `docker-compose.yml` file in the root directory of the project to define all the AI Toolchain services. You can use the given `docker-compose-restructure.yml` as a starting point. This will ensure each model can be independently scalable and accessible. 3. Update the `docker-compose.yml` file with the correct paths and environmental variables as needed. 4. Make sure you have Docker and Docker Compose installed on your machine. If not, follow the official installation guide for Docker [here](https://docs.docker.com/engine/install/) and for Docker Compose [here](https://docs.docker.com/compose/install/). 5. Build and start all the services using Docker Compose: ```bash docker-compose up -d ``` This command will build the Docker images for each service and start the containers in the background. 6. You can now access APIs associated with any model through the defined ports in the `docker-compose.yml` file. For example, if the translation_bhasini service has port "8005:8000", you can access the API at `http://localhost:8005`. To add a new model to the AI Toolchain: 1. Create a new directory for the new model under the `src` directory and add the necessary files, such as Dockerfile, requirements.txt, and the code files. 2. Update the `docker-compose.yml` file to include the new service, specifying the build context, Dockerfile, ports, and any required environment variables. 3. Rebuild and restart the services with the updated `docker-compose.yml` file: ```bash docker-compose up -d --build ``` 4. The new model's API should now be accessible through the specified port in the `docker-compose.yml` file. That's it! By following these steps, you should have successfully deployed the AI Toolchain using Docker. You can now easily add new models by updating the `docker-compose.yml` file and scale the services independently.