Skip to content

Commit

Permalink
Merge pull request #203 from microsoft/dayland/revert-search-index-sk…
Browse files Browse the repository at this point in the history
…illset-changes-for-unknown-lang

Fix token size default and model variant support
  • Loading branch information
dayland authored Sep 13, 2023
2 parents 4dd898c + 302fb3c commit 439f428
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ The Information Assistant Accelerator requires access to one of the following Az
Model Name | Supported Versions
---|---
gpt-35-turbo | 0301, 0613
gpt-35-turbo-16k | N/A
**gpt-35-turbo-16k** | N/A
**gpt-4** | N/A
gpt-4-32k | N/A

**Important:** It is recommended to use gpt-4 models to achieve the best results from the IA Accelerator. Access to gpt-4 requires approval which can be requested [here](https://aka.ms/oai/get-gpt4). If gpt-4 access is not available gpt-35-turbo (0613) is recommended.
**Important:** It is recommended to use gpt-4 models to achieve the best results from the IA Accelerator. Access to gpt-4 requires approval which can be requested [here](https://aka.ms/oai/get-gpt4). If gpt-4 access is not available gpt-35-turbo-16k (0613) is recommended.

---

Expand Down
4 changes: 2 additions & 2 deletions app/backend/approaches/chatreadretrieveread.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def run(self, history: Sequence[dict[str, str]], overrides: dict[str, Any]) -> A
# STEP 3: Generate a contextual and content-specific answer using the search results and chat history.
#Added conditional block to use different system messages for different models.

if self.model_name == "gpt-35-turbo":
if self.model_name.startswith("gpt-35-turbo"):
messages = self.get_messages_from_history(
system_message,
self.chatgpt_deployment,
Expand Down Expand Up @@ -292,7 +292,7 @@ def run(self, history: Sequence[dict[str, str]], overrides: dict[str, Any]) -> A
n=1
)

elif self.model_name == "gpt-4":
elif self.model_name.startswith("gpt-4"):
messages = self.get_messages_from_history(
"Sources:\n" + content + "\n\n" + system_message,
# system_message + "\n\nSources:\n" + content,
Expand Down
5 changes: 3 additions & 2 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ param searchIndexName string = 'all-files-index'
param chatGptDeploymentName string = 'chat'
param chatGptModelName string = 'gpt-35-turbo'
param chatGptDeploymentCapacity int = 30
// metadata in our chunking strategy adds about 180 tokens to the size of the chunk, our default target size is 750 tokens so the prameter is set to 570
param chunkTargetSize string = '570'
// metadata in our chunking strategy adds about 180-200 tokens to the size of the chunks,
// our default target size is 750 tokens so the chunk files that get indexed will be around 950 tokens each
param chunkTargetSize string = '750'
param targetPages string = 'ALL'
param formRecognizerApiVersion string = '2022-08-31'
param pdfSubmitQueue string = 'pdf-submit-queue'
Expand Down

0 comments on commit 439f428

Please sign in to comment.