Developing a website to make finding spiritual guidance easier for members of the religious community of Sathya Sai Baba.
-
Clone the Project: Clone the project from GitHub:
git clone https://github.com/abhiramkolluri/ask-sai-baba.git
-
Install Python and pip: Make sure you have Python and pip installed. You can download Python from the official Python website. Pip usually comes with Python, but if it's not installed, you can install it separately.
-
Navigate to the Project Directory: Switch to the cloned project directory:
cd ask-sai-baba
-
Create and Activate a Virtual Environment:
python -m venv venv
- On Windows:
venv\Scripts\activate
- On macOS and Linux:
source venv/bin/activate
- On Windows:
-
Navigate to the Backend Directory:
cd backend
-
Install Dependencies:
pip install -r requirements.txt
-
Set Up OpenAI API Key: Create a new file named
openai.ini
inside the backend directory. Add the following content:[OpenAI] api_key = YOUR_API_KEY
Replace
YOUR_API_KEY
with your actual OpenAI API key (without quotation marks). -
Establish MongoDB Database Connection (FOR ADMINS ONLY):
- Go to MongoDB Atlas and create a username and password.
- Navigate to SECURITY > Database Access > ADD NEW DATABASE USER.
- Under Authentication Method, ensure "Password" is highlighted. Enter the username and password, assign a Built-in Role, and click Add User.
-
Configure MongoDB Credentials:
- Create a new file named
.env
inside the backend directory. - Add the MongoDB URI with the credentials provided by the ADMIN:
Replace
MONGO_URI=mongodb+srv://<username>:<password>@ask-sai-vidya.rk7x0ch.mongodb.net/?retryWrites=true&w=majority&appName=ask-sai-vidya"
<username>
and<password>
with the credentials provided.
- Create a new file named
-
Run the Project:
-
Export DEBUG mode to avoid restarting the project with every change:
- On Windows:
set FLASK_DEBUG=1
- On macOS and Linux:
export FLASK_DEBUG=1
- On Windows:
-
Run the project:
- Note: You can run on any port number
flask run --port=8000
-
Run the project on AWS EC2:
nohup flask run --port=8000 > flask_output.log 2>&1 &
This will initiate a process to create a new model on OpenAI using the training data found in
query_finetune.jsonl
in the backend directory. The process should take about 10 minutes to complete. Once completed, the app will return a response to the default question "What is right to do?" on the terminal, indicating a successful setup. -
Download Postman from https://www.postman.com/downloads/
You can now test the project's endpoints using Postman. Make sure the backend server is running, and use the appropriate endpoints to test the project's functionality.
By following these steps, you can successfully set up and run the Ask-Sai-Baba project on your local machine. If you have any issues, please consult the project's documentation or seek assistance from the project maintainers.
Open any browser and go to the URL http://localhost:8000/