Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ You can choose to set up the backend manually or use an automated shell script.
```
- This script will automatically download and extract the Sense2Vec model, install Python dependencies, and start the Flask app.

### 🪟 Windows Users
If using Git Bash:
- Replace `python3` with `python` if needed.
- Use `source venv/Scripts/activate` instead of `source venv/bin/activate`.
- If `wget` is not available, `curl -L -o` is used in script.


### Troubleshooting

- If the script fails to run, ensure that you have execution permissions:
Expand Down
14 changes: 12 additions & 2 deletions backend/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,17 @@ REPO_DIR="EduAid"
S2V_ARCHIVE="s2v_reddit_2015_md.tar.gz"
S2V_DIR="s2v_old"

echo "Running on $OSTYPE"

if [ ! -d "venv" ]; then
python3 -m venv venv
python3 -m venv venv || python -m venv venv
fi

if [[ "$OSTYPE" == "msys"* || "$OSTYPE" == "cygwin"* || "$OSTYPE" == "win32" ]]; then
source venv/Scripts/activate
else
source venv/bin/activate
fi
source venv/bin/activate

Expand All @@ -17,12 +26,13 @@ fi

if [ ! -f "$S2V_ARCHIVE" ]; then
wget $S2V_URL -O $S2V_ARCHIVE
curl -L $S2V_URL -o $S2V_ARCHIVE
fi

if [ ! -d "$REPO_DIR/$S2V_DIR" ]; then
mkdir -p $REPO_DIR/$S2V_DIR
tar -xzvf $S2V_ARCHIVE -C $REPO_DIR/$S2V_DIR --strip-components=1
fi

# Deactivate virtual environment after completion
source deactivate
source deactivate