style: add worker content
This commit is contained in:
@@ -48,14 +48,8 @@ const ReferenceParams = (props: ReferenceParamsProps) => {
|
||||
<Tooltip
|
||||
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>
|
||||
<span>TPOT: {_.round(usage.time_per_output_token_ms, 2)} ms</span>
|
||||
<span>TTFT: {_.round(usage.time_to_first_token_ms, 2)} ms</span>
|
||||
</Space>
|
||||
}
|
||||
>
|
||||
|
||||
@@ -74,7 +74,7 @@ const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
|
||||
const systemList = systemMessage
|
||||
? [{ role: 'system', content: systemMessage }]
|
||||
: [];
|
||||
const code = `const OpenAI = require("openai");\n\nconst openai = new OpenAI({\n "apiKey": "YOUR_GPUSTACK_API_KEY",\n "baseURL": "${BaseURL}"\n});\n\n\nasync function main(){\n const params = ${JSON.stringify(
|
||||
const code = `const OpenAI = require("openai");\n\nconst openai = new OpenAI({\n "apiKey": "YOUR_GPUSTACK_API_KEY",\n "baseURL": "${BaseURL}"\n});\n\nasync function main(){\n const params = ${JSON.stringify(
|
||||
{
|
||||
...parameters,
|
||||
messages: [
|
||||
@@ -194,24 +194,6 @@ const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
|
||||
language={lang}
|
||||
value={codeValue}
|
||||
options={editorConfig}
|
||||
overrideServices={{
|
||||
quickSuggestions: {
|
||||
other: false,
|
||||
comments: false,
|
||||
strings: false
|
||||
},
|
||||
disableLayerHinting: true,
|
||||
languages: {
|
||||
typescript: {
|
||||
moduleKind: '2',
|
||||
diagnosticsOptions: {
|
||||
noSemanticValidation: false,
|
||||
noSyntaxValidation: false,
|
||||
diagnosticCodesToIgnore: [80001]
|
||||
}
|
||||
}
|
||||
}
|
||||
}}
|
||||
beforeMount={handleBeforeMount}
|
||||
onMount={handleEditorDidMount}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user