Skip to content

whyashthakker/RAG

Repository files navigation

Running the project

python3.11 -m venv myenv

source myenv/bin/activate

pip install requests beautifulsoup4 langchain langchain-openai faiss-cpu numpy lxml openai

pip install --upgrade pip

pip install -r requirements.txt

AWS Deployment Guide

This guide walks you through the process of deploying your application on an AWS EC2 instance.

1. Launch EC2 Instance

  1. Go to the Amazon AWS console and search for "EC2".
  2. Click on "Launch Instance".
  3. Provide a name for your instance.
View Screenshot

Step 1

  1. Select the instance type that suits your needs.
View Screenshot

Step 2

2. Configure Network Settings

  1. Click on "Edit" in the Network Settings section.
View Screenshot

Step 3

  1. Click on "Add security group rule".
View Screenshot

Step 4

  1. Add port range 8501 and set the source type to "Anywhere".
  2. Click on "Launch Instance".
View Screenshot

Step 5

3. Connect to Your Instance

  1. Once the instance is launched, click on the instance ID.
View Screenshot

Step 6

  1. Click on "Connect".
View Screenshot

Step 7

4. Set Up the Environment

  1. In the CLI, change to superuser:

    sudo su
    
  2. Install git:

    yum install git
    
View Screenshot

Step 8

  1. Install Python3-pip:
    yum install python3-pip
    
View Screenshot

Step 9

  1. Clone your repository:

    git clone <your_repo_link>
    
  2. Create a Python virtual environment:

    python3 -m venv myenv
    
View Screenshot

Step 10

  1. Install necessary libraries:
    pip install --no-cache-dir streamlit sentence-transformers pinecone-client openai==0.28 pdfplumber
    
View Screenshot

Step 11

5. Configure and Run Your Application

  1. Change directory to your repo:

    cd <directory_name>
    
  2. Edit your Python file to add your API key:

    nano <Your_pythonfile.py>
    
View Screenshot

Step 12

  1. Run your script:

    streamlit run <Your_pythonfile.py>
    
  2. For continuous running of the instance even after closing the tab:

    nohup python3 -m streamlit run <Your_pythonfile.py> &
    
View Screenshot

Step 13

Congratulations! Your application should now be deployed and running on AWS EC2.