Introduction:
OpenAI has revolutionized the world, prompting many individuals to seek its integration into their own data models. However, concerns regarding data privacy, security, and governance have arisen when utilizing OpenAI models. These considerations hold paramount importance in ensuring the responsible use of AI technologies.
Thankfully, there is a solution: Azure OpenAI Cognitive Services. Microsoft has introduced Azure OpenAI, which enables the deployment of OpenAI models for customized applications while benefiting from the robust security and governance measures provided by Microsoft.
In this article, we will explore the utilization of Azure
OpenAI Services to access the ChatGPT model (gpt-3.5-turbo) and leverage Azure
Cognitive Search for efficient data indexing and retrieval. Through these
technologies, we will demonstrate how to create ChatGPT-like experiences using
custom data, all while upholding the necessary privacy, security, and
governance protocols.
Prerequisites:
- Access to OpenAI Service on Azure
- Please note that access to Azure OpenAI is currently limited. If your tenant doesn't have access, you can apply for it here. - Your Azure Account must have the necessary permissions, such as Microsoft.Authorization/roleAssignments/write operation permissions (E.g., User Access Administrator or Owner).
- Azure Developer CLI
- Python 3+
- Make sure you can run python --version from the console. - Node.js
- Git
- PowerShell 7+ (pwsh)
- Verify that you can run "pwsh.exe" from a PowerShell command. If this fails, it's likely that you need to upgrade your PowerShell version.
Installation:
- Create a new folder and open it in the Command Prompt.
- Run the command "azd auth login". This will open a browser window for authentication. Enter your Azure credentials in the browser window.
- Note: Once the authentication is complete, you can close the browser window. - You should see a message like "Logged in to Azure" in the terminal window, indicating a successful authentication:
- Run the command "azd init -t azure-search-openai-demo". This command will initialize a git repository.
- When prompted for a new environment name, you can either keep the default name or change it as needed. Press Enter to keep the default name.
- After this step, you
will see a message like "SUCCESS: New project initialized!":
Custom Data Files:
- Navigate to the
folder where the project is initialized. Inside this folder, you will find a
directory called "data".
- Access the
"data" folder and you will find sample data files already present.
You can replace or copy your own files into this folder.
Azure Deployment:
Now that everything is set up locally, we can proceed with
deploying the project on Azure. Follow the steps below:
- Open the terminal.
- Run the command "azd up".
- Select the
appropriate subscription and press Enter:
- Choose the desired
region for deployment. Note that the regions currently supporting the models
used in this sample are East US or South Central US. For an
up-to-date list of regions and models, you can refer to the documentation here.
- The deployment process will begin, which includes packaging up the services and deploying them to Azure. Please be patient as this process may take some time.
- Once the deployment
is complete, you will see a message in the terminal similar to:
No comments:
Post a Comment