Setup#
Note
Link to the repo: ai-workshop-ise/ai-hands-on-lab
Pre-requisites:#
Access to Azure OpenAI Service: Request Access to Azure OpenAI Service
Visual Studio Code
Python
1. Set up the environment#
Set up a Python virtual environment in Visual Studio Code#
Open the Command Palette (Ctrl+Shift+P).
Search for Python: Create Environment.
Select Venv.
Select a Python interpreter.
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:
First, create a resource group in Sweden Central (swedencentral).
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:
Azure OpenAI Service with the following models:
text-embedding-ada-002
GPT3.5
Optional: GPT4 for LLM as a judge. Alternatively, you can use GPT3.5 as judge.
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
underbook
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.