Spaces:
Sleeping
Sleeping
File size: 1,553 Bytes
0fc4dff 9639e4c 0fc4dff 9639e4c 0fc4dff 9639e4c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
#!/bin/bash
# Check if Git is installed
if ! command -v git &> /dev/null; then
echo "Git is not installed. Please install Git and try again."
exit 1
fi
# Check if Conda is installed
if ! command -v conda &> /dev/null; then
echo "Conda is not installed. Please install Conda and try again."
exit 1
fi
# Clone the repository if it doesn't exist
REPO_URL="https://github.com/username/HealthyAiExpert.git"
DIR_NAME="HealthyAiExpert"
if [ ! -d "$DIR_NAME" ]; then
git clone $REPO_URL $DIR_NAME
echo "Cloned repository into $DIR_NAME"
else
echo "Directory $DIR_NAME already exists. Skipping clone."
fi
cd $DIR_NAME
# Create .env file if it doesn't exist
if [ ! -f ".env" ]; then
touch .env
echo "Created .env file. Please add the necessary variables."
else
echo ".env file already exists. Please ensure it has the correct variables."
fi
# Create .gitignore file
echo "__pycache__/" > .gitignore
echo "*.pyc" >> .gitignore
echo ".env" >> .gitignore
echo "Created .gitignore with default entries."
# Create Conda environment if it doesn't exist
ENV_NAME="myenv"
PYTHON_VERSION="3.11"
if ! conda env list | grep -q $ENV_NAME; then
conda create --name $ENV_NAME python=$PYTHON_VERSION -y
echo "Created Conda environment: $ENV_NAME"
else
echo "Conda environment $ENV_NAME already exists."
fi
# Activate the Conda environment
eval "$(conda shell.bash hook)"
conda activate $ENV_NAME
# Install required packages
pip install -r requirements.txt
echo "Setup complete. To run the project, use: python app.py" |