Welcome to the Azure OpenAI hackathon organized by Microsoft in partnership with Tiger Analytics. This repository contains information (data, instructions for the workshop, and reference material) related to Setting RAG solutioning using Azure AI services conducted by Microsoft and Tiger Analytics.
- The sample data that will be used during the session is available in the data folder
- The presentation that will be used during the session is available in the references folder
- Detailed instructions to follow during the session are available in the instructions folder
- Additional references can be found in the references folder. It also contains some sample prompts and questions that can be asked on the dataset.
Please feel free to reach out to the trainers during the session, for any questions or issues related to access or the solution. We hope you have a rewarding experience during the hack event.
An Azure account is necessary for resources provided in the code. You can use your organization's Azure account if available. If not create one from here: https://azure.microsoft.com/en-us/free/
Windows and Linux are the preferred operating systems for the hack event. They're preferred as the tools and libraries are tested in Windows and Linux. Macbooks can be used if there are no alternatives, but challenges are to be expected.
Python version 3.9 needs to be installed on the local machine used for the hack. Refer to the instructions below to install Miniconda and create a Python 3.9 environment.
- Install Miniconda following the documentation (skip this step if you already have Anaconda or Miniconda installed): https://docs.anaconda.com/free/miniconda/#quick-command-line-install. If you have Anaconda or Miniconda already installed in your system, you can skip this step.
- Clone or download the main branch of this repository in your local system
- For Windows users, it is preferred to add
conda
as aPATH
variable. Open a new terminal and try entering the command:conda
. If you get a message saying "Conda command not recognized", then please addconda
toPATH
manually by following the steps in this link. This is an optional step and can be skipped if you want to use the Anaconda prompt instead of the command prompt during the hack. - Create the conda virtual environment by running the following command in your terminal from the repository root:
For Windows and Linux users:
conda env create -n tiger_hack -f codes/deploy/conda.yaml
For Mac users:
conda env create -n tiger_hack -f codes/deploy/conda_mac.yaml
- If you already have an IDE setup in your system, you can skip this section
- Install VSCode from this website
- Install Python and Jupyter extensions from the VSCode marketplace
- Open the downloaded Source code folder in the VSCode
Azure CLI should be installed on the laptop to provide authentication to the Azure services.
-
Installation: Azure CLI can be installed by following the instructions in the below links:
- Windows: https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-windows?tabs=azure-cli#install-or-update
- Linux: https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt#option-1-install-with-one-command
- Mac: https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-macos
-
Azure CLI Login: Execute the following commands in Powershell once Azure CLI is installed to log in to Azure using your credentials.
az config set core.allow_broker=true az account clear az login
- If you already have Java installed in your system, you can skip this step
- Please download and install Java from this website
Follow the mentioned guideline to build and test RAG using azure AI studio. This step is a prerequisite to run the sdk application.
-
Sign in with Azure CLI before starting with running the notebook using the command and complete the login in the browser using the Azure ID that you want to use for the hack. If you are not sure what ID to use, please check with the support team available in the hack
az login
-
Validate that you are logged in using the correct ID (the previous step prints the ID on your terminal along with other information)
-
Update the configuration files. Please follow the user guide for environment variable and config json.
- Populate relevant environment variables in environment_variables.env
- Populate AI Studio project variables in config.json
-
Open the end-to-end notebook in VSCode
-
Click on Select Kernel and select
tiger_hack
virtual environment. If you don't seetiger_hack
in the Python Environments, please reload the VSCode and try again. If you still don't see thetiger_hack
, please add it manually by locating the path where the environment is created. Please check with the support team available in the hack if you are not sure how to do this. -
Run the cells in the notebook
Sample questions for ch3 data can be found in ch3 sample questions file.
-
The code used in the notebook is also available as a Python package in the
codes/src
folder and can be installed in your environment. Activate the conda environment and install the package using the below commandsconda activate tiger_hack pip install -e codes/
-
The web chatbot can be launched using the following command.
cd codes streamlit run src/rag_ai_studio/app.py
We greatly value your feedback and welcome any suggestions for improvement. Please share your thoughts here. You can also scan the QR code below to provide your feedback:
If you have any questions, please feel free to get in touch with us at [email protected]
Note: The Azure service accesses used in this event are only valid during the event. Please contact your respective Microsoft account teams to follow up on the continued access or further questions.