Skip to content

Commit

Permalink
⚡️ AI model update
Browse files Browse the repository at this point in the history
  • Loading branch information
romantech committed Aug 23, 2024
1 parent 31822e6 commit a7f959a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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 (
<AnalysisCounterBox {...stackProps}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
];
Expand Down
13 changes: 8 additions & 5 deletions src/features/syntax-analyzer/constants/settings.ts
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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,
};
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ export const createAnalysisFormSchema = yup.object({
model: yup
.mixed<AnalysisModel>()
.oneOf(Object.values(AnalysisModel))
.default(AnalysisModel.GPT_3_5_FT),
.default(AnalysisModel.GPT_4O_MINI_FT),
sentence: englishSentenceSchema.ensure(),
});

0 comments on commit a7f959a

Please sign in to comment.