From a7f959a82ea4db03c970e836308f255b0ed8950b Mon Sep 17 00:00:00 2001 From: ColorFilter Date: Fri, 23 Aug 2024 13:04:46 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20AI=20model=20update?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../analysis-form/analysis-counter.tsx | 5 +++-- .../analysis-form/model-choice-group.tsx | 19 +++++++++---------- .../syntax-analyzer/constants/settings.ts | 13 ++++++++----- .../schemes/analysis-form-schema.ts | 2 +- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/features/syntax-analyzer/components/analysis-form/analysis-counter.tsx b/src/features/syntax-analyzer/components/analysis-form/analysis-counter.tsx index 3b9bb3d..1158a3d 100644 --- a/src/features/syntax-analyzer/components/analysis-form/analysis-counter.tsx +++ b/src/features/syntax-analyzer/components/analysis-form/analysis-counter.tsx @@ -14,8 +14,9 @@ import { import { CenteredDivider } from '@/base'; import { + ANALYSIS_DECREMENT_COUNT, + AnalysisModel, DAILY_ANALYSIS_LIMIT, - GPT_4_DECREMENT_COUNT, useRemainingCountQuery, } from '@/features/syntax-analyzer'; @@ -25,7 +26,7 @@ export default function AnalysisCounter({ ...stackProps }: StackProps) { }); const countTitle = `남은 분석 횟수 ${count}회`; - const limitDesc = `하루 최대 ${DAILY_ANALYSIS_LIMIT}회까지 분석할 수 있어요 (GPT-4 모델은 요청당 ${GPT_4_DECREMENT_COUNT}회 차감)`; + const limitDesc = `하루 최대 ${DAILY_ANALYSIS_LIMIT}회까지 분석할 수 있어요 (GPT-4o 모델은 요청당 ${ANALYSIS_DECREMENT_COUNT[AnalysisModel.GPT_4O_FT]}회 차감)`; return ( diff --git a/src/features/syntax-analyzer/components/analysis-form/model-choice-group.tsx b/src/features/syntax-analyzer/components/analysis-form/model-choice-group.tsx index 8c6270a..ebabb3d 100644 --- a/src/features/syntax-analyzer/components/analysis-form/model-choice-group.tsx +++ b/src/features/syntax-analyzer/components/analysis-form/model-choice-group.tsx @@ -9,25 +9,24 @@ import { import { Control, Controller } from 'react-hook-form'; import { + ANALYSIS_DECREMENT_COUNT, AnalysisFormValues, AnalysisModel, - GPT_3_5_DECREMENT_COUNT, - GPT_4_DECREMENT_COUNT, } from '@/features/syntax-analyzer'; const MODEL_FIELDS = [ { - value: AnalysisModel.GPT_3_5_FT, - label: 'GPT-3.5 (Fine-Tuned)', - desc: '정확도는 GPT 4와 비슷하거나 다소 낮지만 속도가 빨라요', - count: GPT_3_5_DECREMENT_COUNT, + value: AnalysisModel.GPT_4O_MINI_FT, + label: 'GPT-4o-mini', + desc: '대부분의 문장을 잘 분석해요', + count: ANALYSIS_DECREMENT_COUNT[AnalysisModel.GPT_4O_MINI_FT], recommend: true, }, { - value: AnalysisModel.GPT_4, - label: 'GPT-4', - desc: '정확도는 높지만 속도가 느려요', - count: GPT_4_DECREMENT_COUNT, + value: AnalysisModel.GPT_4O_FT, + label: 'GPT-4o', + desc: '정확도가 조금 더 높아요', + count: ANALYSIS_DECREMENT_COUNT[AnalysisModel.GPT_4O_FT], recommend: false, }, ]; diff --git a/src/features/syntax-analyzer/constants/settings.ts b/src/features/syntax-analyzer/constants/settings.ts index 7099d52..87dfe04 100644 --- a/src/features/syntax-analyzer/constants/settings.ts +++ b/src/features/syntax-analyzer/constants/settings.ts @@ -1,8 +1,5 @@ export const DAILY_ANALYSIS_LIMIT = 10; -export const GPT_4_DECREMENT_COUNT = 5; -export const GPT_3_5_DECREMENT_COUNT = 1; - export const MAX_TOPIC_ADDITION = 3; export const DAILY_SENTENCE_LIMIT = 20; @@ -16,7 +13,13 @@ export const DEFAULT_PICKER_COUNT = 3; export const MAX_SENTENCE_LENGTH = 80; export const MIN_SENTENCE_WORDS = 3; +/** 서버 허용값과 일치 필요 */ export enum AnalysisModel { - GPT_3_5_FT = 'gpt-3.5-ft', - GPT_4 = 'gpt-4', + GPT_4O_MINI_FT = 'gpt-4o-mini-ft', + GPT_4O_FT = 'gpt-4o-ft', } + +export const ANALYSIS_DECREMENT_COUNT = { + [AnalysisModel.GPT_4O_MINI_FT]: 1, + [AnalysisModel.GPT_4O_FT]: 2, +}; diff --git a/src/features/syntax-analyzer/schemes/analysis-form-schema.ts b/src/features/syntax-analyzer/schemes/analysis-form-schema.ts index a441ddb..a1634b7 100644 --- a/src/features/syntax-analyzer/schemes/analysis-form-schema.ts +++ b/src/features/syntax-analyzer/schemes/analysis-form-schema.ts @@ -12,6 +12,6 @@ export const createAnalysisFormSchema = yup.object({ model: yup .mixed() .oneOf(Object.values(AnalysisModel)) - .default(AnalysisModel.GPT_3_5_FT), + .default(AnalysisModel.GPT_4O_MINI_FT), sentence: englishSentenceSchema.ensure(), });