chore: update backend parameters and logs reading frequency
This commit is contained in:
@@ -72,7 +72,7 @@ const LogsList: React.FC<LogsListProps> = forwardRef((props, ref) => {
|
||||
|
||||
const isBottom = scrollTop + clientHeight + 150 >= scrollHeight;
|
||||
// is scroll to top
|
||||
if (scrollTop === 0) {
|
||||
if (scrollTop <= 10) {
|
||||
onScroll?.({
|
||||
isTop: true,
|
||||
isBottom: false
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { convertFileSize } from '@/utils';
|
||||
import { throttle } from 'lodash';
|
||||
import qs from 'query-string';
|
||||
import { useEffect, useRef } from 'react';
|
||||
@@ -42,13 +43,19 @@ const useSetChunkFetch = () => {
|
||||
const readTextEventStreamData = async (
|
||||
response: Response,
|
||||
callback: HandlerFunction,
|
||||
delay = 200
|
||||
delay = 100
|
||||
) => {
|
||||
class BufferManager {
|
||||
private buffer: any[] = [];
|
||||
private contentLength: number | null = null;
|
||||
private progress: number = 0;
|
||||
private percent: number = 0;
|
||||
private speedHistory: number[] = [];
|
||||
private maxHistory = 5;
|
||||
private lastTime: number = performance.now();
|
||||
private lastBytes: number = 0;
|
||||
private totalBytes: number = 0;
|
||||
private avgSpeed: number = 0;
|
||||
|
||||
constructor(private options: { contentLength?: string | null }) {
|
||||
this.contentLength = options.contentLength
|
||||
@@ -63,6 +70,28 @@ const useSetChunkFetch = () => {
|
||||
}
|
||||
}
|
||||
|
||||
private logSpeed(speedBps: number) {
|
||||
this.speedHistory.push(speedBps);
|
||||
if (this.speedHistory.length > this.maxHistory) {
|
||||
this.speedHistory.shift();
|
||||
}
|
||||
this.avgSpeed =
|
||||
this.speedHistory.reduce((a, b) => a + b, 0) /
|
||||
this.speedHistory.length;
|
||||
console.log(`瞬时均值: ${convertFileSize(this.avgSpeed)}/s`);
|
||||
}
|
||||
|
||||
public updateSpeed(bytes: number) {
|
||||
const now = performance.now();
|
||||
const elapsed = (now - this.lastTime) / 1000;
|
||||
if (elapsed > 0.3) {
|
||||
const speed = (this.totalBytes + bytes - this.lastBytes) / elapsed;
|
||||
this.logSpeed(speed);
|
||||
this.lastTime = now;
|
||||
this.lastBytes = this.totalBytes + bytes;
|
||||
}
|
||||
}
|
||||
|
||||
public add(data: any) {
|
||||
this.buffer.push(data);
|
||||
this.updateProgress(data);
|
||||
|
||||
@@ -604,6 +604,10 @@ const options = [
|
||||
{
|
||||
label: '--no-enable-reasoning',
|
||||
value: '--no-enable-reasoning'
|
||||
},
|
||||
{
|
||||
label: '--override-tensor',
|
||||
value: '--override-tensor'
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -183,6 +183,14 @@ const options = [
|
||||
{
|
||||
label: '--moe-tensor-parallel-size',
|
||||
value: '--moe-tensor-parallel-size'
|
||||
},
|
||||
{
|
||||
label: '--enable-multi-token-prediction',
|
||||
value: '--enable-multi-token-prediction'
|
||||
},
|
||||
{
|
||||
label: '--multi-token-prediction-tokens',
|
||||
value: '--multi-token-prediction-tokens'
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user