Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
pablomarin committed Apr 28, 2023
2 parents b3c5397 + 0e1522d commit 3edb265
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 35 deletions.
Binary file added Azure Open AI GPT Smart Search - Pitch Deck .pdf
Binary file not shown.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
Your organization needs a search engine that can make sense of all kinds of types of data, stored in different locations, and that can return the links of similar documents, but more importantly, provide the answer to the question! In other words, you want private and secured ChatGPT for your organization that can interpret, comprehend, and answer questions about your business data.

The goal of the MVP workshop is to show/prove the value of a GPT Smart Search Engine built with the Azure Services, with your own data in your own environment. The repo is made to teach customers step-by-step on how to build a Smart Search Engine. Each Notebook builds on top of each other.
For more information on the 2 day workshop, click the powerpoint presentation below:
For more information on the 3 day workshop, click the powerpoint presentation below:

[Accelerator Pitch Deck](https://microsoft-my.sharepoint.com/:p:/p/jheseltine/Ee0OFL6hWNBCtRpoFRHIdj8BPGCzq01xTxkmEp0scLwSAg?e=EIz9is)
[Accelerator Pitch Deck](https://github.com/pablomarin/GPT-Azure-Search-Engine/blob/main/Azure%20Open%20AI%20GPT%20Smart%20Search%20-%20Pitch%20Deck%20.pdf)


**Prerequisites Client 2-Day Workshop**
**Prerequisites Client 3-Day Workshop**
* Azure subscription
* Accepted Application to Azure Open AI
* Microsoft members need to be added as Guests in clients Azure AD
Expand Down Expand Up @@ -96,7 +96,7 @@ A: Because using STUFF type with all the content of the pages as context, uses t
A: Quoting the [OpenAI documentation](https://platform.openai.com/docs/guides/fine-tuning): "GPT-3 has been pre-trained on a vast amount of text from the open internet. When given a prompt with just a few examples, it can often intuit what task you are trying to perform and generate a plausible completion. This is often called "few-shot learning.
Fine-tuning improves on few-shot learning by training on many more examples than can fit in the prompt, letting you achieve better results on a wide number of tasks. Once a model has been fine-tuned, you won't need to provide examples in the prompt anymore. This saves costs and enables lower-latency requests"

So training/fine tunning the model requires that we provide hundreds/thousands of Prompt and Completion tuples, or in other words, we need to provide samples of query-responses. For a company knowledge base of Terabytes of information this is not feasible. To come up with all the possible tuples that users my request, is simply not possible. So the search engine is absolutely necessary for a company data search engine using OpenAI.
So training/fine tunning the model requires that we provide hundreds/thousands of Prompt and Completion tuples, or in other words, we need to provide samples of query-responses. For a company knowledge base of Terabytes of information this is not feasible. To come up with all the possible tuples that users might request, it is simply not possible. So the search engine is absolutely necessary for a company data search engine using OpenAI.

---

Expand Down
34 changes: 18 additions & 16 deletions app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ Example: https://myComputeInstance-8501.southcentralus.instances.azureml.ms/

### [Local Git deployment to Azure App Service](https://learn.microsoft.com/en-us/azure/app-service/deploy-local-git?tabs=cli)


1. In the Azure portal, navigate to your app's management page.
2. From the left menu, select Deployment Center > Settings. Select Local Git in Source, then click Save.

![Shows how to enable local Git deployment for App Service in the Azure portal](https://learn.microsoft.com/en-us/azure/app-service/media/deploy-local-git/enable-portal.png)

3. In the Local Git section, copy the Git Clone Uri for later. This Uri doesn't contain any credentials.
4. In a local terminal window, change the directory to the root of your Git repository, and add a Git remote using the URL you got from your app. If your chosen method doesn't give you a URL, use https://<app-name>.scm.azurewebsites.net/<app-name>.git with your app name in <app-name>.
```bash
Expand All @@ -75,24 +76,25 @@ git push azure master```.

## Troubleshoot

- If WebApp deployed succesfully but the Application didn't start
1. Go to Azure portal -> Your Webapp -> Settings -> Configuration -> General Settings
2. Make sure that StartUp Command has: python -m streamlit run app/Home.py --server.port 8000 --server.address 0.0.0.0

- If deployment fails with error "Cannot find SourceControlToken with name Github" you can try the following
1. Wait 20 mins and Retry
2. Delete the browser cache and retry
3. Go to the deployed WebApp and Authorize azure to deploy and build code directly from Github

![Authorize Github](../images/error-authorize-github.jpeg "Authorize Github" )
1. If WebApp deployed succesfully but the Application didn't start
1. Go to Azure portal -> Your Webapp -> Settings -> Configuration -> General Settings
2. Make sure that StartUp Command has: python -m streamlit run app/Home.py --server.port 8000 --server.address 0.0.0.0

- If running locally fails with error "TypeError: unsupported operand type(s) for |: 'type' and '_GenericAlias'"
2. If running locally fails with error "TypeError: unsupported operand type(s) for |: 'type' and '_GenericAlias'"
Check your list of conda environments and activate one with Python 3.10 or higher
For example, if you are running the app on an Azure ML compute instance:
```
conda env list
conda activate azureml_py310_sdkv2
```
```
conda env list
conda activate azureml_py310_sdkv2
```

3. If deployment fails with error "Cannot find SourceControlToken with name Github" you can try the following
1. Wait 20 mins and Retry
2. Delete the browser cache and retry
3. Go to the deployed WebApp and Authorize azure to deploy and build code directly from Github

![Authorize Github](../images/error-authorize-github.jpeg "Authorize Github" )




Expand Down
14 changes: 0 additions & 14 deletions app/azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,8 @@
"sku": {
"type": "string",
"allowedValues": [
<<<<<<< HEAD
"B3",
"S3"
=======
"B2",
"B3",
"S2",
"S3",
"P1",
"P2",
"P3",
"P4"
>>>>>>> e1e3a3643eec37d32b81aa4b9305542f625be58c
],
"defaultValue": "B3",
"metadata": {
Expand Down Expand Up @@ -93,13 +82,10 @@
"linuxFxVersion": "[parameters('linuxFxVersion')]",
"appSettings": [
{
<<<<<<< HEAD
"name": "DATASOURCE_SAS_TOKEN",
"value": ""
},
{
=======
>>>>>>> e1e3a3643eec37d32b81aa4b9305542f625be58c
"name": "AZURE_SEARCH_ENDPOINT",
"value": ""
},
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ pypdf
tenacity
sentence_transformers
sqlalchemy
pyodbc
pyodbc

0 comments on commit 3edb265

Please sign in to comment.