fix: completion response handler

This commit is contained in:
jialin
2024-06-29 21:39:55 +08:00
parent d47e53114c
commit afb2a13b80
12 changed files with 57 additions and 39 deletions
@@ -65,19 +65,19 @@ const SystemLoad = () => {
<Row style={{ height: largeChartHeight, width: '100%' }}>
<Col span={12} style={{ height: smallChartHeight }}>
<UitilBar
title="GPU Compute Utilization"
title="GPU Utilization"
percent={_.round(data.gpu?.utilization_rate || 0, 1)}
></UitilBar>
</Col>
<Col span={12} style={{ height: smallChartHeight }}>
<UitilBar
title="GPU Memory Utilization"
title="VRAM Utilization"
percent={_.round(data.gpu_memory?.utilization_rate || 0, 1)}
></UitilBar>
</Col>
<Col span={12} style={{ height: smallChartHeight }}>
<UitilBar
title="CPU Compute Utilization"
title="CPU Utilization"
percent={_.round(data.cpu?.utilization_rate || 0, 1)}
></UitilBar>
</Col>
+4 -8
View File
@@ -134,8 +134,7 @@ const Usage = () => {
tokenList.push({
time: dayjs(item.timestamp * 1000).format('YYYY-MM-DD'),
name: 'completion_token',
color:
'linear-gradient(90deg,rgba(84, 204, 152,0.8) 0%,rgb(0, 168, 143,.7) 100%)',
color: 'rgba(84, 204, 152,0.8)',
value: item.value
});
});
@@ -143,8 +142,7 @@ const Usage = () => {
tokenList.push({
time: dayjs(item.timestamp * 1000).format('YYYY-MM-DD'),
name: 'prompt_token',
color:
'linear-gradient(90deg,rgba(0, 170, 173, 0.8) 0%,rgba(0, 109, 193, 0.7) 100%)',
color: 'rgba(0, 170, 173, 0.8)',
value: item.value
});
});
@@ -153,15 +151,13 @@ const Usage = () => {
userList.push({
name: item.username,
type: 'completion_token',
color:
'linear-gradient(90deg,rgba(84, 204, 152,0.8) 0%,rgb(0, 168, 143,.7) 100%)',
color: 'rgba(84, 204, 152,0.8)',
value: item.completion_token_count
});
userList.push({
name: item.username,
type: 'prompt_token',
color:
'linear-gradient(90deg,rgba(0, 170, 173, 0.8) 0%,rgba(0, 109, 193, 0.7) 100%)',
color: 'rgba(0, 170, 173, 0.8)',
value: item.prompt_token_count
});
});