From 19b770e5ac24ac23d4964b790fabb7054d8adc2c Mon Sep 17 00:00:00 2001 From: "Heather Logan (She/Her)" Date: Mon, 9 Oct 2023 11:16:32 +0100 Subject: [PATCH 1/2] change default model to GPT-3.5-turbo --- backend/src/langchain.ts | 6 +++--- backend/src/models/chat.ts | 2 +- frontend/src/components/ModelBox/ModelSelection.tsx | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/backend/src/langchain.ts b/backend/src/langchain.ts index 2fbd7ad72..88ea9857f 100644 --- a/backend/src/langchain.ts +++ b/backend/src/langchain.ts @@ -120,7 +120,7 @@ function initQAModel( // initialise model const model = new ChatOpenAI({ - modelName: CHAT_MODELS.GPT_4, + modelName: CHAT_MODELS.GPT_3_5_TURBO, streaming: true, openAIApiKey: openAiApiKey, }); @@ -146,7 +146,7 @@ function initPromptEvaluationModel(openAiApiKey: string) { const promptInjectionChain = new LLMChain({ llm: new OpenAI({ - modelName: CHAT_MODELS.GPT_4, + modelName: CHAT_MODELS.GPT_3_5_TURBO, temperature: 0, openAIApiKey: openAiApiKey, }), @@ -160,7 +160,7 @@ function initPromptEvaluationModel(openAiApiKey: string) { ); const maliciousInputChain = new LLMChain({ llm: new OpenAI({ - modelName: CHAT_MODELS.GPT_4, + modelName: CHAT_MODELS.GPT_3_5_TURBO, temperature: 0, openAIApiKey: openAiApiKey, }), diff --git a/backend/src/models/chat.ts b/backend/src/models/chat.ts index 76ba13ba9..702357a53 100644 --- a/backend/src/models/chat.ts +++ b/backend/src/models/chat.ts @@ -84,7 +84,7 @@ interface ChatHistoryMessage { // default settings for chat model const defaultChatModel: ChatModel = { - id: CHAT_MODELS.GPT_4, + id: CHAT_MODELS.GPT_3_5_TURBO, configuration: { temperature: 1, topP: 1, diff --git a/frontend/src/components/ModelBox/ModelSelection.tsx b/frontend/src/components/ModelBox/ModelSelection.tsx index 2f37666c2..cb651489a 100644 --- a/frontend/src/components/ModelBox/ModelSelection.tsx +++ b/frontend/src/components/ModelBox/ModelSelection.tsx @@ -51,10 +51,9 @@ function ModelSelection() { onChange={(e) => { setSelectedModel(e.target.value as CHAT_MODELS); }} - placeholder={modelInUse} > {chatModelOptions.map((model) => ( - ))} From bfb3bef93547c2a11d07af37db903a341e653cae Mon Sep 17 00:00:00 2001 From: "Heather Logan (She/Her)" Date: Tue, 17 Oct 2023 13:59:16 +0100 Subject: [PATCH 2/2] eqeqeq eslint --- backend/.eslintrc.cjs | 2 ++ frontend/.eslintrc.cjs | 1 + frontend/src/components/ModelBox/ModelSelection.tsx | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/.eslintrc.cjs b/backend/.eslintrc.cjs index eb3a15ce1..08d86859c 100644 --- a/backend/.eslintrc.cjs +++ b/backend/.eslintrc.cjs @@ -16,6 +16,7 @@ module.exports = { ignorePatterns: ["build", "coverage", "node_modules", "jest.config.js"], rules: { "@typescript-eslint/init-declarations": "error", + "@typescript-eslint/no-misused-promises": [ "error", { @@ -25,5 +26,6 @@ module.exports = { "func-style": ["error", "declaration"], "prefer-template": "error", + eqeqeq: "error", }, }; diff --git a/frontend/.eslintrc.cjs b/frontend/.eslintrc.cjs index 81b111416..2b2229239 100644 --- a/frontend/.eslintrc.cjs +++ b/frontend/.eslintrc.cjs @@ -35,5 +35,6 @@ module.exports = { "warn", { allowConstantExport: true }, ], + eqeqeq: "error", }, }; diff --git a/frontend/src/components/ModelBox/ModelSelection.tsx b/frontend/src/components/ModelBox/ModelSelection.tsx index cb651489a..8974fddb5 100644 --- a/frontend/src/components/ModelBox/ModelSelection.tsx +++ b/frontend/src/components/ModelBox/ModelSelection.tsx @@ -53,7 +53,7 @@ function ModelSelection() { }} > {chatModelOptions.map((model) => ( - ))}