Skip to content

Commit

Permalink
Models to BW
Browse files Browse the repository at this point in the history
  • Loading branch information
AI-Maria committed May 30, 2024
1 parent 44d7c29 commit 1e9d3d0
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4,185 deletions.
2 changes: 1 addition & 1 deletion src/components/AboutMenu/AboutMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const AboutMenu = () => {
>
<div className='p-6 border-b border-gray-200 dark:border-gray-600'>
<div className='min-w-fit text-gray-900 dark:text-gray-300 text-sm flex flex-col gap-3 leading-relaxed'>
<h1>{t('bw', { ns: 'about' })} <a href="https://bestwaifu.top/" target="_blank" className="link">BestWaifu</a></h1>
<h1 className='text-lg font-bold text-red'>{t('bw', { ns: 'about' })} <a href="https://bestwaifu.top/" target="_blank" className="link">BestWaifu</a></h1>
<p>{t('description', { ns: 'about' })}</p>
<p>
<Trans
Expand Down
4 changes: 2 additions & 2 deletions src/components/SettingsMenu/TotalTokenCost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const TotalTokenCost = () => {
<thead className='text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400'>
<tr>
<th className='px-4 py-2'>{t('model', { ns: 'model' })}</th>
<th className='px-4 py-2'>USD</th>
<th className='px-4 py-2'>kWT</th>
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -128,7 +128,7 @@ export const TotalTokenCostDisplay = () => {
return (
<a className='flex py-2 px-2 items-center gap-3 rounded-md hover:bg-gray-500/10 transition-colors duration-200 text-white text-sm'>
<CalculatorIcon />
{`USD ${totalCost.toPrecision(3)}`}
{`${totalCost.toPrecision(3)} kWT`}
</a>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/TokenCount/TokenCount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const TokenCount = React.memo(() => {
return (
<div className='absolute top-[-16px] right-0'>
<div className='text-xs italic text-gray-900 dark:text-gray-300'>
Tokens: {tokenCount} (${cost})
Tokens: {tokenCount} ({cost} kWT)
</div>
</div>
);
Expand Down
34 changes: 17 additions & 17 deletions src/constants/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ const dateString =
export const _defaultSystemMessage =
import.meta.env.VITE_DEFAULT_SYSTEM_MESSAGE ??
`You are ChatGPT, a large language model trained by OpenAI.
Carefully heed the user's instructions.
Carefully heed the user's instructions.
Respond using Markdown.`;

export const modelOptions: ModelOptions[] = [
'gpt-3.5-turbo',
'gpt-3.5-turbo-16k',
'gpt-3.5-turbo-1106',
'gpt-3.5-turbo-0125',
'gpt-4',
'gpt-4-32k',
'gpt-4-1106-preview',
'gpt-4-0125-preview',
'gpt-4-turbo',
'gpt-4-turbo-2024-04-09',
'gpt-4o',
'gpt-4o-2024-05-13',
// 'gpt-3.5-turbo-16k',
// 'gpt-3.5-turbo-1106',
// 'gpt-3.5-turbo-0125',
// 'gpt-4',
// 'gpt-4-32k',
// 'gpt-4-1106-preview',
// 'gpt-4-0125-preview',
// 'gpt-4-turbo',
// 'gpt-4-turbo-2024-04-09',
// 'gpt-4o',
// 'gpt-4o-2024-05-13',
// 'gpt-3.5-turbo-0301',
// 'gpt-4-0314',
// 'gpt-4-32k-0314',
Expand All @@ -38,7 +38,7 @@ export const modelOptions: ModelOptions[] = [
export const defaultModel = 'gpt-3.5-turbo';

export const modelMaxToken = {
'gpt-3.5-turbo': 4096,
'gpt-3.5-turbo': 8192,
'gpt-3.5-turbo-0301': 4096,
'gpt-3.5-turbo-0613': 4096,
'gpt-3.5-turbo-16k': 16384,
Expand All @@ -61,8 +61,8 @@ export const modelMaxToken = {

export const modelCost = {
'gpt-3.5-turbo': {
prompt: { price: 0.0015, unit: 1000 },
completion: { price: 0.002, unit: 1000 },
prompt: { price: 5, unit: 1000 },
completion: { price: 15, unit: 1000 },
},
'gpt-3.5-turbo-0301': {
prompt: { price: 0.0015, unit: 1000 },
Expand Down Expand Up @@ -143,8 +143,8 @@ export const defaultUserMaxToken = 4000;
export const _defaultChatConfig: ConfigInterface = {
model: defaultModel,
max_tokens: defaultUserMaxToken,
temperature: 1,
presence_penalty: 0,
temperature: 0.4,
presence_penalty: 0.1,
top_p: 1,
frequency_penalty: 0,
};
Expand Down
Loading

0 comments on commit 1e9d3d0

Please sign in to comment.