style: playground output tips

This commit is contained in:
jialin
2024-07-15 11:17:42 +08:00
parent a834d79b7d
commit 21e151ac28
6 changed files with 30 additions and 8 deletions
+3 -1
View File
@@ -12,6 +12,8 @@ export default {
'You can use the following code to start integrating your current prompt and settings into your application.', 'You can use the following code to start integrating your current prompt and settings into your application.',
'playground.completion': 'Completion', 'playground.completion': 'Completion',
'playground.prompt': 'Prompt', 'playground.prompt': 'Prompt',
'playground.timeToFirstToken': 'Time to first token',
'playground.timePerOutputToken': 'Time per output token',
'playground.tokenusage': 'Token Usage', 'playground.tokenusage': 'Token Usage',
'models.openinplayground': 'Open in Playground', 'models.openinplayground': 'Open in Playground',
'playground.tokenoutput': 'Output', 'playground.tokenoutput': 'Output',
@@ -25,6 +27,6 @@ export default {
'If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result.', 'If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result.',
'playground.params.stop.tips': 'playground.params.stop.tips':
'A stop sequence is a predefined or user-specified text string that signals the AI to stop generating further tokens when these sequences appear.', 'A stop sequence is a predefined or user-specified text string that signals the AI to stop generating further tokens when these sequences appear.',
'playground.viewcode.tips': 'Your API Key can be found {here}.', 'playground.viewcode.tips': 'Your API Key can be found {here}',
'playground.viewcode.here': 'here' 'playground.viewcode.here': 'here'
}; };
+2
View File
@@ -12,6 +12,8 @@ export default {
'你可以使用以下代码将当前的提示和设置集成到你的应用程序中。', '你可以使用以下代码将当前的提示和设置集成到你的应用程序中。',
'playground.completion': '补全', 'playground.completion': '补全',
'playground.prompt': '提示', 'playground.prompt': '提示',
'playground.timeToFirstToken': '输出首个 token 时间',
'playground.timePerOutputToken': '生成每个 token 时间',
'playground.tokenusage': 'Token 使用量', 'playground.tokenusage': 'Token 使用量',
'models.openinplayground': '打开试验场', 'models.openinplayground': '打开试验场',
'playground.tokenoutput': '输出', 'playground.tokenoutput': '输出',
@@ -121,9 +121,7 @@ const InstanceItem: React.FC<InstanceItemProps> = ({
</Col> </Col>
<Col span={5}> <Col span={5}>
<span style={{ paddingLeft: 38 }}> <span style={{ paddingLeft: 38 }}>
{dayjs(item.created_at) {dayjs(item.created_at).format('YYYY-MM-DD HH:mm:ss')}
.local()
.format('YYYY-MM-DD HH:mm:ss')}
</span> </span>
</Col> </Col>
<Col span={4}> <Col span={4}>
+1 -2
View File
@@ -378,8 +378,7 @@ const Models: React.FC<ModelsProps> = ({
showSorterTooltip={false} showSorterTooltip={false}
sorter={true} sorter={true}
render={(text, row) => { render={(text, row) => {
console.log('val=time===', text, row.name, row, row.created_at); return dayjs(text).format('YYYY-MM-DD HH:mm:ss');
return dayjs(text).local().format('YYYY-MM-DD HH:mm:ss');
}} }}
/> />
<SealColumn <SealColumn
@@ -9,6 +9,8 @@ interface ReferenceParamsProps {
prompt_tokens: number; prompt_tokens: number;
total_tokens: number; total_tokens: number;
tokens_per_second: number; tokens_per_second: number;
time_per_output_token_ms: number;
time_to_first_token_ms: number;
}; };
} }
@@ -43,8 +45,26 @@ const ReferenceParams = (props: ReferenceParamsProps) => {
</span> </span>
<span> <span>
{intl.formatMessage({ id: 'playground.tokenoutput' })}:{' '} <Tooltip
{_.round(usage.tokens_per_second, 2)} Tokens/s trigger={['click']}
title={
<Space>
<span>
{intl.formatMessage({ id: 'playground.timePerOutputToken' })}:{' '}
{_.round(usage.time_per_output_token_ms, 2)} ms
</span>
<span>
{intl.formatMessage({ id: 'playground.timeToFirstToken' })}:{' '}
{_.round(usage.time_to_first_token_ms, 2)} ms
</span>
</Space>
}
>
<span>
{intl.formatMessage({ id: 'playground.tokenoutput' })}:{' '}
{_.round(usage.tokens_per_second, 2)} Tokens/s
</span>
</Tooltip>
</span> </span>
</div> </div>
); );
@@ -177,6 +177,7 @@ const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
size="small" size="small"
href="#/api-keys" href="#/api-keys"
target="_blank" target="_blank"
style={{ paddingInline: 2 }}
> >
<span> <span>
{' '} {' '}