Skip to content

Commit

Permalink
Improvements to Windows setup documentation (cohere-ai#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneLightsOn authored May 30, 2024
1 parent 84c320e commit d24d5f4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,17 @@ reset-db:
setup:
poetry install --with setup,community --verbose
poetry run python3 src/backend/cli/main.py
win-setup:
poetry install --with setup,community --verbose
poetry run python src/backend/cli/main.py
lint:
poetry run black .
poetry run isort .
first-run:
make setup
make migrate
make dev
win-first-run:
make win-setup
make migrate
make dev
28 changes: 21 additions & 7 deletions docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ make first-run
```

Follow the instructions to configure the model - either AWS Sagemaker, Bedrock, Azure, or Cohere's platform. This can also be done by running `make setup` (See Option 2 below), which will help generate a file for you, or by manually creating a `.env` file and copying the contents of the provided `.env-template`. Then replacing the values with the correct ones.
For Windows systems see the detailed setup below.

#### Detailed environment setup

Expand All @@ -29,42 +30,55 @@ Follow the instructions to configure the model - either AWS Sagemaker, Bedrock,

1. Install [docker](https://docs.docker.com/desktop/install/windows-install/)
2. Install [git]https://git-scm.com/download/win
3. In PowerShell (Terminal), install [scoop](https://scoop.sh/). After installing, run scoop bucket add extras
3. In PowerShell (Terminal), install [scoop](https://scoop.sh/). After installing, run the following commands:
```bash
scoop bucket add extras
```
4. Install pipx
```bash
scoop install pipx
pipx ensurepath
```
5. Install poetry >= 1.7.1 using
5. Install poetry == 1.7.1 using
```bash
pipx install poetry
pipx install poetry==1.7.1
```
6. Install miniconda using
```bash
scoop install miniconda3
conda init powershell
conda init cmd.exe
```
7. Restart PowerShell
8. Install the following:
```bash
scoop install postgresql
scoop install make
```
9. Create a new virtual environment with Python 3.11
9. Create a new virtual environment with Python 3.11 using CMD terminal
```bash
conda create -n toolkit python=3.11
conda activate toolkit
```
10. Clone the repo
11. Alternatively to `make first-run` or `make setup`, run
11. Alternatively to `make win-first-run` or `make win-setup`, run
```bash
poetry install --only setup --verbose
poetry install --with setup,community --verbose
poetry run python src/backend/cli/main.py
make migrate
make dev
```
12. Navigate to https://localhost:4000 in your browser

### Possible issues
- If you encounter on error on running `poetry install` related to `llama-cpp-python`, please run the following command:
```bash
poetry source add pypi
poetry source add llama-cpp-python https://abetlen.github.io/llama-cpp-python/whl/cpu
poetry lock
```
and then run the commands in step 11 again.
For more information and additional installation instructions, see [llama-cpp-python documentation](https://github.com/abetlen/llama-cpp-python)

</details>

<details>
Expand Down

0 comments on commit d24d5f4

Please sign in to comment.