training queue

This commit is contained in:
archer
2023-05-26 23:08:25 +08:00
parent 69f32a0861
commit dc1c1d1355
32 changed files with 528 additions and 493 deletions

View File

@@ -5,8 +5,6 @@ import type { Pool } from 'pg';
declare global {
var mongodb: Mongoose | string | null;
var pgClient: Pool | null;
var generatingQA: boolean;
var generatingVector: boolean;
var httpsAgent: Agent;
var particlesJS: any;
var grecaptcha: any;

View File

@@ -1,6 +1,6 @@
import { ModelStatusEnum } from '@/constants/model';
import type { ModelSchema, kbSchema } from './mongoSchema';
import { ChatModelType, ModelVectorSearchModeEnum } from '@/constants/model';
import { ChatModelType, appVectorSearchModeEnum } from '@/constants/model';
export type ModelListItemType = {
_id: string;

View File

@@ -2,12 +2,13 @@ import type { ChatItemType } from './chat';
import {
ModelStatusEnum,
ModelNameEnum,
ModelVectorSearchModeEnum,
appVectorSearchModeEnum,
ChatModelType,
EmbeddingModelType
} from '@/constants/model';
import type { DataType } from './data';
import { BillTypeEnum } from '@/constants/user';
import { TrainingTypeEnum } from '@/constants/plugin';
export interface UserModelSchema {
_id: string;
@@ -44,7 +45,7 @@ export interface ModelSchema {
updateTime: number;
chat: {
relatedKbs: string[];
searchMode: `${ModelVectorSearchModeEnum}`;
searchMode: `${appVectorSearchModeEnum}`;
systemPrompt: string;
temperature: number;
chatModel: ChatModelType; // 聊天时用的模型,训练后就是训练的模型
@@ -68,13 +69,14 @@ export interface CollectionSchema {
export type ModelDataType = 0 | 1;
export interface SplitDataSchema {
export interface TrainingDataSchema {
_id: string;
userId: string;
kbId: string;
lockTime: Date;
vectorList: { q: string; a: string }[];
prompt: string;
errorText: string;
textList: string[];
qaList: string[];
}
export interface ChatSchema {

15
src/types/plugin.d.ts vendored
View File

@@ -1,5 +1,4 @@
import type { kbSchema } from './mongoSchema';
import { PluginTypeEnum } from '@/constants/plugin';
/* kb type */
export interface KbItemType extends kbSchema {
@@ -16,20 +15,6 @@ export interface KbDataItemType {
userId: string;
}
/* plugin */
export interface PluginConfig {
name: string;
desc: string;
url: string;
category: `${PluginTypeEnum}`;
uniPrice: 22; // 1k token
params: [
{
type: '';
}
];
}
export type TextPluginRequestParams = {
input: string;
};