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
This guide walks you through the process of deploying your application on an AWS EC2 instance.
- Go to the Amazon AWS console and search for "EC2".
- Click on "Launch Instance".
- Provide a name for your instance.
- Select the instance type that suits your needs.
- Click on "Edit" in the Network Settings section.
- Click on "Add security group rule".
- Add port range 8501 and set the source type to "Anywhere".
- Click on "Launch Instance".
- Once the instance is launched, click on the instance ID.
- Click on "Connect".
-
In the CLI, change to superuser:
sudo su
-
Install git:
yum install git
- Install Python3-pip:
yum install python3-pip
-
Clone your repository:
git clone <your_repo_link>
-
Create a Python virtual environment:
python3 -m venv myenv
- Install necessary libraries:
pip install --no-cache-dir streamlit sentence-transformers pinecone-client openai==0.28 pdfplumber
-
Change directory to your repo:
cd <directory_name>
-
Edit your Python file to add your API key:
nano <Your_pythonfile.py>
-
Run your script:
streamlit run <Your_pythonfile.py>
-
For continuous running of the instance even after closing the tab:
nohup python3 -m streamlit run <Your_pythonfile.py> &
Congratulations! Your application should now be deployed and running on AWS EC2.