Setup#

Note

Link to the repo: ai-workshop-ise/ai-hands-on-lab

Pre-requisites:#

1. Set up the environment#

Set up a Python virtual environment in Visual Studio Code#

  1. Open the Command Palette (Ctrl+Shift+P).

  2. Search for Python: Create Environment.

  3. Select Venv.

  4. Select a Python interpreter.

  5. Select workshop\book\requirements.txt as dependencies to install.

It can take a minute to set up. If you run into problems, see Python environments in VS Code.

If the dependencies were not installed, run the following in a Terminal:

For Windows, at the root of the repo:

. .venv/Scripts/activate
pip install -r ./book/requirements.txt

For Mac Os / Linux:

. .venv/bin/activate
pip install -r ./book/requirements.txt

2. Deploy required Azure resources:#

You can either deploy them manually or through a script.

a) Using the script:

  1. First, create a resource group in Sweden Central (swedencentral).

  2. Then, run deploy-infra.sh script, passing the resource group name (RGNAME), subscription ID (SUSCRIPTION_ID) and tenant ID (TENANT_ID):

bicep/scripts/deploy-infra.sh -r "[RGNAME]" -s "[SUSCRIPTION_ID]" -t "[TENANT_ID]"

b) Creating the resources manually:

3. Configure .env file#

If you created the resources through the script, the .env should be already created. Double check if that’s the case.

If you created the resources manually:

  • Create .env under book folder.

  • Copy the content from .env.sample to .env and update the values accordingly.

4. Initialize the git submodule#

In a terminal, go to data folder and run:

git submodule update --init --recursive

Note

Great! You are now all set. Once you cloned the repo, you will find all the Jupyter Notebooks in the book folder. You should follow each chapter one by one and run each cell locally. Sometimes the cells are collapsed to give you time to think how you would implement the requirement, before actually seeing a potential solution.

Start with 1.rag-intr.ipynb for a short introduction to RAG.