Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
48b09c4310 | ||
|
|
ffa90d89d1 | ||
|
|
e0781be9a9 | ||
|
|
33b21a0f5c | ||
|
|
bf5ac7efef | ||
|
|
06622b79aa | ||
|
|
537f11cbf1 | ||
|
|
c6500c6b3a | ||
|
|
6f629dbc55 | ||
|
|
5729d9fc62 | ||
|
|
bb8af451f6 | ||
|
|
ed330566e3 | ||
|
|
673ecb489e | ||
|
|
5192e31bac |
@@ -25,7 +25,7 @@ English | [简体中文](README_ZH.md)
|
|||||||
|
|
||||||
[release-url]: https://github.com/josStorer/RWKV-Runner/releases/latest
|
[release-url]: https://github.com/josStorer/RWKV-Runner/releases/latest
|
||||||
|
|
||||||
[download-url]: https://github.com/josStorer/RWKV-Runner/releases/download/v1.0.2/RWKV-Runner_windows_x64.exe
|
[download-url]: https://github.com/josStorer/RWKV-Runner/releases
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ API兼容的接口,这意味着一切ChatGPT客户端都是RWKV客户端。
|
|||||||
|
|
||||||
[release-url]: https://github.com/josStorer/RWKV-Runner/releases/latest
|
[release-url]: https://github.com/josStorer/RWKV-Runner/releases/latest
|
||||||
|
|
||||||
[download-url]: https://github.com/josStorer/RWKV-Runner/releases/download/v1.0.2/RWKV-Runner_windows_x64.exe
|
[download-url]: https://github.com/josStorer/RWKV-Runner/releases
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ from utils.ngrok import *
|
|||||||
from routes import completion, config
|
from routes import completion, config
|
||||||
import global_var
|
import global_var
|
||||||
|
|
||||||
|
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
|
|
||||||
app.add_middleware(
|
app.add_middleware(
|
||||||
|
|||||||
@@ -78,5 +78,3 @@ def rwkv_generate(model: RWKV, prompt: str, stop: str = None):
|
|||||||
break
|
break
|
||||||
yield response, delta
|
yield response, delta
|
||||||
out_last = begin + i + 1
|
out_last = begin + i + 1
|
||||||
if i >= model.max_tokens_per_generation - 100:
|
|
||||||
break
|
|
||||||
|
|||||||
Binary file not shown.
@@ -116,5 +116,13 @@
|
|||||||
"Werewolf": "狼人杀",
|
"Werewolf": "狼人杀",
|
||||||
"Blank": "空白",
|
"Blank": "空白",
|
||||||
"The following is an epic science fiction masterpiece that is immortalized, with delicate descriptions and grand depictions of interstellar civilization wars.\nChapter 1.\n": "以下是不朽的科幻史诗巨著,描写细腻,刻画了宏大的星际文明战争。\n第一章\n",
|
"The following is an epic science fiction masterpiece that is immortalized, with delicate descriptions and grand depictions of interstellar civilization wars.\nChapter 1.\n": "以下是不朽的科幻史诗巨著,描写细腻,刻画了宏大的星际文明战争。\n第一章\n",
|
||||||
"API Host": "API主机"
|
"API Host": "API主机",
|
||||||
|
"The following is a conversation between a cat girl and her owner. The cat girl is a humanized creature that behaves like a cat but is humanoid. At the end of each sentence in the dialogue, she will add \"Meow~\". In the following content, Bob represents the owner and Alice represents the cat girl.\n\nBob: Hello.\n\nAlice: I'm here, meow~.\n\nBob: Can you tell jokes?": "以下是一位猫娘的主人和猫娘的对话内容,猫娘是一种拟人化的生物,其行为似猫但类人,在每一句对话末尾都会加上\"喵~\"。以下内容中,Bob代表主人,Alice代表猫娘。\n\nBob: 你好\n\nAlice: 主人我在哦,喵~\n\nBob: 你会讲笑话吗?",
|
||||||
|
"When response finished, inject this content.": "响应结束时,插入此内容到末尾",
|
||||||
|
"Inject start text": "起始注入文本",
|
||||||
|
"Inject end text": "结尾注入文本",
|
||||||
|
"Before the response starts, inject this content.": "响应开始前,在开头插入此内容",
|
||||||
|
"There is currently a game of Werewolf with six players, including a Seer (who can check identities at night), two Werewolves (who can choose someone to kill at night), a Bodyguard (who can choose someone to protect at night), two Villagers (with no special abilities), and a game host. Bob will play as Player 1, Alice will play as Players 2-6 and the game host, and they will begin playing together. Every night, the host will ask Bob for his action and simulate the actions of the other players. During the day, the host will oversee the voting process and ask Bob for his vote. \n\nAlice: Next, I will act as the game host and assign everyone their roles, including randomly assigning yours. Then, I will simulate the actions of Players 2-6 and let you know what happens each day. Based on your assigned role, you can tell me your actions and I will let you know the corresponding results each day.\n\nBob: Okay, I understand. Let's begin. Please assign me a role. Am I the Seer, Werewolf, Villager, or Bodyguard?\n\nAlice: You are the Seer. Now that night has fallen, please choose a player to check his identity.\n\nBob: Tonight, I want to check Player 2 and find out his role.": "现在有一场六人狼人杀游戏,包括一名预言家(可以在夜晚查验身份),两名狼人(可以在夜晚选择杀人),一名守卫(可以在夜晚选择要守护的人),两名平民(无技能),一名主持人,以下内容中Bob将扮演其中的1号玩家,Alice来扮演2-6号玩家,以及主持人,并开始与Bob进行游戏,主持人每晚都会询问Bob的行动,并模拟其他人的行动,在白天则要主持投票,并同样询问Bob投票对象,公布投票结果。\n\nAlice: 接下来,我将首先作为主持人进行角色分配,并给你赋予随机的角色,之后我将模拟2-6号玩家进行行动,告知你每天的动态,根据你被分配的角色,你可以回复我你做的行动,我会告诉你每天对应的结果\n\nBob: 好的,我明白了,那么开始吧。请先给我一个角色身份。我是预言家,狼人,平民,守卫中的哪一个呢?\n\nAlice: 你的身份是预言家。现在夜晚降临,请选择你要查验的玩家。\n\nBob: 今晚我要验2号玩家,他是什么身份?",
|
||||||
|
"Writer, Translator, Role-playing": "写作,翻译,角色扮演",
|
||||||
|
"Chinese Kongfu": "情境冒险"
|
||||||
}
|
}
|
||||||
@@ -43,8 +43,8 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean
|
|||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const onClickMainButton = async () => {
|
const onClickMainButton = async () => {
|
||||||
if (commonStore.status.modelStatus === ModelStatus.Offline) {
|
if (commonStore.status.status === ModelStatus.Offline) {
|
||||||
commonStore.setStatus({ modelStatus: ModelStatus.Starting });
|
commonStore.setStatus({ status: ModelStatus.Starting });
|
||||||
|
|
||||||
const modelConfig = commonStore.getCurrentModelConfig();
|
const modelConfig = commonStore.getCurrentModelConfig();
|
||||||
let modelName = '';
|
let modelName = '';
|
||||||
@@ -54,7 +54,7 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean
|
|||||||
modelPath = `./${manifest.localModelDir}/${modelName}`;
|
modelPath = `./${manifest.localModelDir}/${modelName}`;
|
||||||
} else {
|
} else {
|
||||||
toast(t('Model Config Exception'), { type: 'error' });
|
toast(t('Model Config Exception'), { type: 'error' });
|
||||||
commonStore.setStatus({ modelStatus: ModelStatus.Offline });
|
commonStore.setStatus({ status: ModelStatus.Offline });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (depErrorMsg) {
|
if (depErrorMsg) {
|
||||||
commonStore.setStatus({ modelStatus: ModelStatus.Offline });
|
commonStore.setStatus({ status: ModelStatus.Offline });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
commonStore.setDepComplete(true);
|
commonStore.setDepComplete(true);
|
||||||
@@ -102,7 +102,7 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
commonStore.setStatus({ modelStatus: ModelStatus.Offline });
|
commonStore.setStatus({ status: ModelStatus.Offline });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean
|
|||||||
if (status)
|
if (status)
|
||||||
commonStore.setStatus(status);
|
commonStore.setStatus(status);
|
||||||
});
|
});
|
||||||
commonStore.setStatus({ modelStatus: ModelStatus.Loading });
|
commonStore.setStatus({ status: ModelStatus.Loading });
|
||||||
toast(t('Loading Model'), { type: 'info' });
|
toast(t('Loading Model'), { type: 'info' });
|
||||||
updateConfig({
|
updateConfig({
|
||||||
max_tokens: modelConfig.apiParameters.maxResponseToken,
|
max_tokens: modelConfig.apiParameters.maxResponseToken,
|
||||||
@@ -144,8 +144,12 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean
|
|||||||
if (!exist) CopyFile('./backend-python/wkv_cuda_utils/wkv_cuda_model.py', './py310/Lib/site-packages/rwkv/model.py');
|
if (!exist) CopyFile('./backend-python/wkv_cuda_utils/wkv_cuda_model.py', './py310/Lib/site-packages/rwkv/model.py');
|
||||||
});
|
});
|
||||||
await CopyFile(customCudaFile, './py310/Lib/site-packages/rwkv/wkv_cuda.pyd').catch(() => {
|
await CopyFile(customCudaFile, './py310/Lib/site-packages/rwkv/wkv_cuda.pyd').catch(() => {
|
||||||
|
FileExists('./py310/Lib/site-packages/rwkv/wkv_cuda.pyd').then((exist) => {
|
||||||
|
if (!exist) {
|
||||||
customCudaFile = '';
|
customCudaFile = '';
|
||||||
toast(t('Failed to copy custom cuda file'), { type: 'error' });
|
toast(t('Failed to copy custom cuda file'), { type: 'error' });
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
} else
|
} else
|
||||||
toast(t('Supported custom cuda file not found'), { type: 'warning' });
|
toast(t('Supported custom cuda file not found'), { type: 'warning' });
|
||||||
@@ -157,51 +161,51 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean
|
|||||||
customCuda: customCudaFile !== ''
|
customCuda: customCudaFile !== ''
|
||||||
}).then((r) => {
|
}).then((r) => {
|
||||||
if (r.ok) {
|
if (r.ok) {
|
||||||
commonStore.setStatus({ modelStatus: ModelStatus.Working });
|
commonStore.setStatus({ status: ModelStatus.Working });
|
||||||
toastWithButton(t('Startup Completed'), t('Chat'), () => {
|
toastWithButton(t('Startup Completed'), t('Chat'), () => {
|
||||||
navigate({ pathname: '/chat' });
|
navigate({ pathname: '/chat' });
|
||||||
}, { type: 'success', autoClose: 3000 });
|
}, { type: 'success', autoClose: 3000 });
|
||||||
} else if (r.status === 304) {
|
} else if (r.status === 304) {
|
||||||
toast(t('Loading Model'), { type: 'info' });
|
toast(t('Loading Model'), { type: 'info' });
|
||||||
} else {
|
} else {
|
||||||
commonStore.setStatus({ modelStatus: ModelStatus.Offline });
|
commonStore.setStatus({ status: ModelStatus.Offline });
|
||||||
toast(t('Failed to switch model'), { type: 'error' });
|
toast(t('Failed to switch model'), { type: 'error' });
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
commonStore.setStatus({ modelStatus: ModelStatus.Offline });
|
commonStore.setStatus({ status: ModelStatus.Offline });
|
||||||
toast(t('Failed to switch model'), { type: 'error' });
|
toast(t('Failed to switch model'), { type: 'error' });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
if (timeoutCount <= 0) {
|
if (timeoutCount <= 0) {
|
||||||
clearInterval(intervalId);
|
clearInterval(intervalId);
|
||||||
commonStore.setStatus({ modelStatus: ModelStatus.Offline });
|
commonStore.setStatus({ status: ModelStatus.Offline });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
timeoutCount--;
|
timeoutCount--;
|
||||||
}, 1000);
|
}, 1000);
|
||||||
} else {
|
} else {
|
||||||
commonStore.setStatus({ modelStatus: ModelStatus.Offline });
|
commonStore.setStatus({ status: ModelStatus.Offline });
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const onClick = async (e: any) => {
|
const onClick = async (e: any) => {
|
||||||
if (commonStore.status.modelStatus === ModelStatus.Offline)
|
if (commonStore.status.status === ModelStatus.Offline)
|
||||||
await onClickRun?.(e);
|
await onClickRun?.(e);
|
||||||
await onClickMainButton();
|
await onClickMainButton();
|
||||||
};
|
};
|
||||||
|
|
||||||
return (iconMode ?
|
return (iconMode ?
|
||||||
<ToolTipButton disabled={commonStore.status.modelStatus === ModelStatus.Starting}
|
<ToolTipButton disabled={commonStore.status.status === ModelStatus.Starting}
|
||||||
icon={iconModeButtonIcon[commonStore.status.modelStatus]}
|
icon={iconModeButtonIcon[commonStore.status.status]}
|
||||||
desc={t(mainButtonText[commonStore.status.modelStatus])}
|
desc={t(mainButtonText[commonStore.status.status])}
|
||||||
size="small" onClick={onClick} />
|
size="small" onClick={onClick} />
|
||||||
:
|
:
|
||||||
<Button disabled={commonStore.status.modelStatus === ModelStatus.Starting} appearance="primary" size="large"
|
<Button disabled={commonStore.status.status === ModelStatus.Starting} appearance="primary" size="large"
|
||||||
onClick={onClick}>
|
onClick={onClick}>
|
||||||
{t(mainButtonText[commonStore.status.modelStatus])}
|
{t(mainButtonText[commonStore.status.status])}
|
||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ export const WorkHeader: FC = observer(() => {
|
|||||||
<div className="flex flex-col gap-1">
|
<div className="flex flex-col gap-1">
|
||||||
<div className="flex justify-between items-center">
|
<div className="flex justify-between items-center">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<PresenceBadge status={badgeStatus[commonStore.status.modelStatus]} />
|
<PresenceBadge status={badgeStatus[commonStore.status.status]} />
|
||||||
<Text size={100}>{t('Model Status') + ': ' + t(statusText[commonStore.status.modelStatus])}</Text>
|
<Text size={100}>{t('Model Status') + ': ' + t(statusText[commonStore.status.status])}</Text>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<ConfigSelector size="small" />
|
<ConfigSelector size="small" />
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ const ChatPanel: FC = observer(() => {
|
|||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
if (e.type === 'click' || (e.keyCode === 13 && !e.shiftKey)) {
|
if (e.type === 'click' || (e.keyCode === 13 && !e.shiftKey)) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (commonStore.status.modelStatus === ModelStatus.Offline) {
|
if (commonStore.status.status === ModelStatus.Offline) {
|
||||||
toast(t('Please click the button in the top right corner to start the model'), { type: 'warning' });
|
toast(t('Please click the button in the top right corner to start the model'), { type: 'warning' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,11 @@ import commonStore, { ModelStatus } from '../stores/commonStore';
|
|||||||
import { fetchEventSource } from '@microsoft/fetch-event-source';
|
import { fetchEventSource } from '@microsoft/fetch-event-source';
|
||||||
import { toast } from 'react-toastify';
|
import { toast } from 'react-toastify';
|
||||||
|
|
||||||
export type CompletionParams = Omit<ApiParameters, 'apiPort'> & { stop: string }
|
export type CompletionParams = Omit<ApiParameters, 'apiPort'> & {
|
||||||
|
stop: string,
|
||||||
|
injectStart: string,
|
||||||
|
injectEnd: string
|
||||||
|
};
|
||||||
|
|
||||||
export type CompletionPreset = {
|
export type CompletionPreset = {
|
||||||
name: string,
|
name: string,
|
||||||
@@ -22,67 +26,93 @@ export const defaultPresets: CompletionPreset[] = [{
|
|||||||
name: 'Writer',
|
name: 'Writer',
|
||||||
prompt: 'The following is an epic science fiction masterpiece that is immortalized, with delicate descriptions and grand depictions of interstellar civilization wars.\nChapter 1.\n',
|
prompt: 'The following is an epic science fiction masterpiece that is immortalized, with delicate descriptions and grand depictions of interstellar civilization wars.\nChapter 1.\n',
|
||||||
params: {
|
params: {
|
||||||
maxResponseToken: 4100,
|
maxResponseToken: 500,
|
||||||
temperature: 1,
|
temperature: 1.2,
|
||||||
topP: 0.5,
|
topP: 0.5,
|
||||||
presencePenalty: 0.4,
|
presencePenalty: 0.4,
|
||||||
frequencyPenalty: 0.4,
|
frequencyPenalty: 0.4,
|
||||||
stop: ''
|
stop: '\\n\\nBob',
|
||||||
|
injectStart: '',
|
||||||
|
injectEnd: ''
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
name: 'Translator',
|
name: 'Translator',
|
||||||
prompt: '',
|
prompt: 'Translate this into Chinese.\n\nEnglish: What rooms do you have available?',
|
||||||
params: {
|
params: {
|
||||||
maxResponseToken: 4100,
|
maxResponseToken: 500,
|
||||||
temperature: 1,
|
temperature: 1,
|
||||||
topP: 0.5,
|
topP: 0.3,
|
||||||
presencePenalty: 0.4,
|
presencePenalty: 0.4,
|
||||||
frequencyPenalty: 0.4,
|
frequencyPenalty: 0.4,
|
||||||
stop: ''
|
stop: '\\nEnglish',
|
||||||
|
injectStart: '\\nChinese: ',
|
||||||
|
injectEnd: '\\nEnglish: '
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
name: 'Catgirl',
|
name: 'Catgirl',
|
||||||
prompt: '',
|
prompt: 'The following is a conversation between a cat girl and her owner. The cat girl is a humanized creature that behaves like a cat but is humanoid. At the end of each sentence in the dialogue, she will add \"Meow~\". In the following content, Bob represents the owner and Alice represents the cat girl.\n\nBob: Hello.\n\nAlice: I\'m here, meow~.\n\nBob: Can you tell jokes?',
|
||||||
params: {
|
params: {
|
||||||
maxResponseToken: 4100,
|
maxResponseToken: 500,
|
||||||
temperature: 1,
|
temperature: 1.2,
|
||||||
topP: 0.5,
|
topP: 0.5,
|
||||||
presencePenalty: 0.4,
|
presencePenalty: 0.4,
|
||||||
frequencyPenalty: 0.4,
|
frequencyPenalty: 0.4,
|
||||||
stop: ''
|
stop: '\\n\\nBob',
|
||||||
|
injectStart: '\\n\\nAlice: ',
|
||||||
|
injectEnd: '\\n\\nBob: '
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
name: 'Explain Code',
|
name: 'Chinese Kongfu',
|
||||||
prompt: '',
|
prompt: 'Bob: 请你扮演一个文本冒险游戏,我是游戏主角。这是一个玄幻修真世界,有四大门派。我输入我的行动,请你显示行动结果,并具体描述环境。我的第一个行动是“醒来”,请开始故事。',
|
||||||
params: {
|
params: {
|
||||||
maxResponseToken: 4100,
|
maxResponseToken: 500,
|
||||||
temperature: 1,
|
temperature: 1.1,
|
||||||
topP: 0.5,
|
topP: 0.7,
|
||||||
presencePenalty: 0.4,
|
presencePenalty: 0.3,
|
||||||
frequencyPenalty: 0.4,
|
frequencyPenalty: 0.3,
|
||||||
stop: ''
|
stop: '\\n\\nBob',
|
||||||
|
injectStart: '\\n\\nAlice: ',
|
||||||
|
injectEnd: '\\n\\nBob: '
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
|
// }, {
|
||||||
|
// name: 'Explain Code',
|
||||||
|
// prompt: 'export async function startup() {\n FileExists(\'cache.json\').then((exists) => {\n if (exists)\n downloadProgramFiles();\n else {\n deleteDynamicProgramFiles().then(downloadProgramFiles);\n }\n });\n EventsOn(\'downloadList\', (data) => {\n if (data)\n commonStore.setDownloadList(data);\n });\n\n initCache().then(initRemoteText);\n\n await initConfig();\n\n if (commonStore.settings.autoUpdatesCheck) // depends on config settings\n checkUpdate();\n\n getStatus(1000).then(status => { // depends on config api port\n if (status)\n commonStore.setStatus(status);\n });\n}\n\n\"\"\"\nHere\'s what the above code is doing, explained in a concise way:\n',
|
||||||
|
// params: {
|
||||||
|
// maxResponseToken: 500,
|
||||||
|
// temperature: 0.8,
|
||||||
|
// topP: 0.7,
|
||||||
|
// presencePenalty: 0.4,
|
||||||
|
// frequencyPenalty: 0.4,
|
||||||
|
// stop: '\\n\\n',
|
||||||
|
// injectStart: '',
|
||||||
|
// injectEnd: ''
|
||||||
|
// }
|
||||||
|
// }, {
|
||||||
name: 'Werewolf',
|
name: 'Werewolf',
|
||||||
prompt: '',
|
prompt: 'There is currently a game of Werewolf with six players, including a Seer (who can check identities at night), two Werewolves (who can choose someone to kill at night), a Bodyguard (who can choose someone to protect at night), two Villagers (with no special abilities), and a game host. Bob will play as Player 1, Alice will play as Players 2-6 and the game host, and they will begin playing together. Every night, the host will ask Bob for his action and simulate the actions of the other players. During the day, the host will oversee the voting process and ask Bob for his vote. \n\nAlice: Next, I will act as the game host and assign everyone their roles, including randomly assigning yours. Then, I will simulate the actions of Players 2-6 and let you know what happens each day. Based on your assigned role, you can tell me your actions and I will let you know the corresponding results each day.\n\nBob: Okay, I understand. Let\'s begin. Please assign me a role. Am I the Seer, Werewolf, Villager, or Bodyguard?\n\nAlice: You are the Seer. Now that night has fallen, please choose a player to check his identity.\n\nBob: Tonight, I want to check Player 2 and find out his role.',
|
||||||
params: {
|
params: {
|
||||||
maxResponseToken: 4100,
|
maxResponseToken: 500,
|
||||||
temperature: 1,
|
temperature: 1.2,
|
||||||
topP: 0.5,
|
topP: 0.4,
|
||||||
presencePenalty: 0.4,
|
presencePenalty: 0.5,
|
||||||
frequencyPenalty: 0.4,
|
frequencyPenalty: 0.5,
|
||||||
stop: ''
|
stop: '\\n\\nBob',
|
||||||
|
injectStart: '\\n\\nAlice: ',
|
||||||
|
injectEnd: '\\n\\nBob: '
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
name: 'Blank',
|
name: 'Blank',
|
||||||
prompt: '',
|
prompt: '',
|
||||||
params: {
|
params: {
|
||||||
maxResponseToken: 4100,
|
maxResponseToken: 500,
|
||||||
temperature: 1,
|
temperature: 1,
|
||||||
topP: 0.5,
|
topP: 0.5,
|
||||||
presencePenalty: 0.4,
|
presencePenalty: 0.4,
|
||||||
frequencyPenalty: 0.4,
|
frequencyPenalty: 0.4,
|
||||||
stop: ''
|
stop: '',
|
||||||
|
injectStart: '',
|
||||||
|
injectEnd: ''
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
|
|
||||||
@@ -135,11 +165,14 @@ const CompletionPanel: FC = observer(() => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onSubmit = (prompt: string) => {
|
const onSubmit = (prompt: string) => {
|
||||||
if (commonStore.status.modelStatus === ModelStatus.Offline) {
|
if (commonStore.status.status === ModelStatus.Offline) {
|
||||||
toast(t('Please click the button in the top right corner to start the model'), { type: 'warning' });
|
toast(t('Please click the button in the top right corner to start the model'), { type: 'warning' });
|
||||||
|
commonStore.setCompletionGenerating(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prompt += params.injectStart.replaceAll('\\n', '\n');
|
||||||
|
|
||||||
let answer = '';
|
let answer = '';
|
||||||
sseControllerRef.current = new AbortController();
|
sseControllerRef.current = new AbortController();
|
||||||
fetchEventSource(`http://127.0.0.1:${port}/completions`, // https://api.openai.com/v1/completions || http://127.0.0.1:${port}/completions
|
fetchEventSource(`http://127.0.0.1:${port}/completions`, // https://api.openai.com/v1/completions || http://127.0.0.1:${port}/completions
|
||||||
@@ -158,7 +191,7 @@ const CompletionPanel: FC = observer(() => {
|
|||||||
top_p: params.topP,
|
top_p: params.topP,
|
||||||
presence_penalty: params.presencePenalty,
|
presence_penalty: params.presencePenalty,
|
||||||
frequency_penalty: params.frequencyPenalty,
|
frequency_penalty: params.frequencyPenalty,
|
||||||
stop: params.stop || undefined
|
stop: params.stop.replaceAll('\\n', '\n') || undefined
|
||||||
}),
|
}),
|
||||||
signal: sseControllerRef.current?.signal,
|
signal: sseControllerRef.current?.signal,
|
||||||
onmessage(e) {
|
onmessage(e) {
|
||||||
@@ -177,7 +210,7 @@ const CompletionPanel: FC = observer(() => {
|
|||||||
}
|
}
|
||||||
if (data.choices && Array.isArray(data.choices) && data.choices.length > 0) {
|
if (data.choices && Array.isArray(data.choices) && data.choices.length > 0) {
|
||||||
answer += data.choices[0].text;
|
answer += data.choices[0].text;
|
||||||
setPrompt(prompt + answer);
|
setPrompt(prompt + answer.trim() + params.injectEnd.replaceAll('\\n', '\n'));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onclose() {
|
onclose() {
|
||||||
@@ -278,6 +311,26 @@ const CompletionPanel: FC = observer(() => {
|
|||||||
});
|
});
|
||||||
}} />
|
}} />
|
||||||
} />
|
} />
|
||||||
|
<Labeled flex breakline label={t('Inject start text')}
|
||||||
|
desc={t('Before the response starts, inject this content.')}
|
||||||
|
content={
|
||||||
|
<Input value={params.injectStart}
|
||||||
|
onChange={(e, data) => {
|
||||||
|
setParams({
|
||||||
|
injectStart: data.value
|
||||||
|
});
|
||||||
|
}} />
|
||||||
|
} />
|
||||||
|
<Labeled flex breakline label={t('Inject end text')}
|
||||||
|
desc={t('When response finished, inject this content.')}
|
||||||
|
content={
|
||||||
|
<Input value={params.injectEnd}
|
||||||
|
onChange={(e, data) => {
|
||||||
|
setParams({
|
||||||
|
injectEnd: data.value
|
||||||
|
});
|
||||||
|
}} />
|
||||||
|
} />
|
||||||
</div>
|
</div>
|
||||||
<div className="grow" />
|
<div className="grow" />
|
||||||
<div className="flex justify-between gap-2">
|
<div className="flex justify-between gap-2">
|
||||||
|
|||||||
@@ -66,7 +66,8 @@ export const defaultModelConfigs: ModelConfig[] = [
|
|||||||
precision: 'int8',
|
precision: 'int8',
|
||||||
storedLayers: 4,
|
storedLayers: 4,
|
||||||
maxStoredLayers: 41,
|
maxStoredLayers: 41,
|
||||||
enableHighPrecisionForLastLayer: true
|
enableHighPrecisionForLastLayer: true,
|
||||||
|
useCustomCuda: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -85,7 +86,8 @@ export const defaultModelConfigs: ModelConfig[] = [
|
|||||||
precision: 'int8',
|
precision: 'int8',
|
||||||
storedLayers: 41,
|
storedLayers: 41,
|
||||||
maxStoredLayers: 41,
|
maxStoredLayers: 41,
|
||||||
enableHighPrecisionForLastLayer: false
|
enableHighPrecisionForLastLayer: false,
|
||||||
|
useCustomCuda: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -104,7 +106,8 @@ export const defaultModelConfigs: ModelConfig[] = [
|
|||||||
precision: 'int8',
|
precision: 'int8',
|
||||||
storedLayers: 24,
|
storedLayers: 24,
|
||||||
maxStoredLayers: 41,
|
maxStoredLayers: 41,
|
||||||
enableHighPrecisionForLastLayer: true
|
enableHighPrecisionForLastLayer: true,
|
||||||
|
useCustomCuda: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -123,7 +126,8 @@ export const defaultModelConfigs: ModelConfig[] = [
|
|||||||
precision: 'int8',
|
precision: 'int8',
|
||||||
storedLayers: 24,
|
storedLayers: 24,
|
||||||
maxStoredLayers: 41,
|
maxStoredLayers: 41,
|
||||||
enableHighPrecisionForLastLayer: true
|
enableHighPrecisionForLastLayer: true,
|
||||||
|
useCustomCuda: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -142,7 +146,8 @@ export const defaultModelConfigs: ModelConfig[] = [
|
|||||||
precision: 'int8',
|
precision: 'int8',
|
||||||
storedLayers: 8,
|
storedLayers: 8,
|
||||||
maxStoredLayers: 41,
|
maxStoredLayers: 41,
|
||||||
enableHighPrecisionForLastLayer: true
|
enableHighPrecisionForLastLayer: true,
|
||||||
|
useCustomCuda: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -161,7 +166,8 @@ export const defaultModelConfigs: ModelConfig[] = [
|
|||||||
precision: 'int8',
|
precision: 'int8',
|
||||||
storedLayers: 8,
|
storedLayers: 8,
|
||||||
maxStoredLayers: 41,
|
maxStoredLayers: 41,
|
||||||
enableHighPrecisionForLastLayer: true
|
enableHighPrecisionForLastLayer: true,
|
||||||
|
useCustomCuda: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -180,7 +186,8 @@ export const defaultModelConfigs: ModelConfig[] = [
|
|||||||
precision: 'fp16',
|
precision: 'fp16',
|
||||||
storedLayers: 41,
|
storedLayers: 41,
|
||||||
maxStoredLayers: 41,
|
maxStoredLayers: 41,
|
||||||
enableHighPrecisionForLastLayer: false
|
enableHighPrecisionForLastLayer: false,
|
||||||
|
useCustomCuda: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -199,7 +206,8 @@ export const defaultModelConfigs: ModelConfig[] = [
|
|||||||
precision: 'int8',
|
precision: 'int8',
|
||||||
storedLayers: 41,
|
storedLayers: 41,
|
||||||
maxStoredLayers: 41,
|
maxStoredLayers: 41,
|
||||||
enableHighPrecisionForLastLayer: false
|
enableHighPrecisionForLastLayer: false,
|
||||||
|
useCustomCuda: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -218,7 +226,8 @@ export const defaultModelConfigs: ModelConfig[] = [
|
|||||||
precision: 'int8',
|
precision: 'int8',
|
||||||
storedLayers: 41,
|
storedLayers: 41,
|
||||||
maxStoredLayers: 41,
|
maxStoredLayers: 41,
|
||||||
enableHighPrecisionForLastLayer: false
|
enableHighPrecisionForLastLayer: false,
|
||||||
|
useCustomCuda: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -237,7 +246,8 @@ export const defaultModelConfigs: ModelConfig[] = [
|
|||||||
precision: 'int8',
|
precision: 'int8',
|
||||||
storedLayers: 18,
|
storedLayers: 18,
|
||||||
maxStoredLayers: 41,
|
maxStoredLayers: 41,
|
||||||
enableHighPrecisionForLastLayer: true
|
enableHighPrecisionForLastLayer: true,
|
||||||
|
useCustomCuda: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -256,7 +266,8 @@ export const defaultModelConfigs: ModelConfig[] = [
|
|||||||
precision: 'int8',
|
precision: 'int8',
|
||||||
storedLayers: 18,
|
storedLayers: 18,
|
||||||
maxStoredLayers: 41,
|
maxStoredLayers: 41,
|
||||||
enableHighPrecisionForLastLayer: true
|
enableHighPrecisionForLastLayer: true,
|
||||||
|
useCustomCuda: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -275,7 +286,8 @@ export const defaultModelConfigs: ModelConfig[] = [
|
|||||||
precision: 'fp16',
|
precision: 'fp16',
|
||||||
storedLayers: 41,
|
storedLayers: 41,
|
||||||
maxStoredLayers: 41,
|
maxStoredLayers: 41,
|
||||||
enableHighPrecisionForLastLayer: false
|
enableHighPrecisionForLastLayer: false,
|
||||||
|
useCustomCuda: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -294,7 +306,48 @@ export const defaultModelConfigs: ModelConfig[] = [
|
|||||||
precision: 'fp16',
|
precision: 'fp16',
|
||||||
storedLayers: 41,
|
storedLayers: 41,
|
||||||
maxStoredLayers: 41,
|
maxStoredLayers: 41,
|
||||||
enableHighPrecisionForLastLayer: false
|
enableHighPrecisionForLastLayer: false,
|
||||||
|
useCustomCuda: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'GPU-8G-7B-EN',
|
||||||
|
apiParameters: {
|
||||||
|
apiPort: 8000,
|
||||||
|
maxResponseToken: 4100,
|
||||||
|
temperature: 1.2,
|
||||||
|
topP: 0.5,
|
||||||
|
presencePenalty: 0.4,
|
||||||
|
frequencyPenalty: 0.4
|
||||||
|
},
|
||||||
|
modelParameters: {
|
||||||
|
modelName: 'RWKV-4-Raven-7B-v12-Eng98%-Other2%-20230521-ctx8192.pth',
|
||||||
|
device: 'CUDA',
|
||||||
|
precision: 'int8',
|
||||||
|
storedLayers: 27,
|
||||||
|
maxStoredLayers: 41,
|
||||||
|
enableHighPrecisionForLastLayer: false,
|
||||||
|
useCustomCuda: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'GPU-8G-7B-CN',
|
||||||
|
apiParameters: {
|
||||||
|
apiPort: 8000,
|
||||||
|
maxResponseToken: 4100,
|
||||||
|
temperature: 1.2,
|
||||||
|
topP: 0.5,
|
||||||
|
presencePenalty: 0.4,
|
||||||
|
frequencyPenalty: 0.4
|
||||||
|
},
|
||||||
|
modelParameters: {
|
||||||
|
modelName: 'RWKV-4-Raven-7B-v11-Eng49%-Chn49%-Jpn1%-Other1%-20230430-ctx8192.pth',
|
||||||
|
device: 'CUDA',
|
||||||
|
precision: 'int8',
|
||||||
|
storedLayers: 27,
|
||||||
|
maxStoredLayers: 41,
|
||||||
|
enableHighPrecisionForLastLayer: false,
|
||||||
|
useCustomCuda: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -313,7 +366,8 @@ export const defaultModelConfigs: ModelConfig[] = [
|
|||||||
precision: 'int8',
|
precision: 'int8',
|
||||||
storedLayers: 41,
|
storedLayers: 41,
|
||||||
maxStoredLayers: 41,
|
maxStoredLayers: 41,
|
||||||
enableHighPrecisionForLastLayer: false
|
enableHighPrecisionForLastLayer: false,
|
||||||
|
useCustomCuda: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -332,11 +386,12 @@ export const defaultModelConfigs: ModelConfig[] = [
|
|||||||
precision: 'int8',
|
precision: 'int8',
|
||||||
storedLayers: 41,
|
storedLayers: 41,
|
||||||
maxStoredLayers: 41,
|
maxStoredLayers: 41,
|
||||||
enableHighPrecisionForLastLayer: false
|
enableHighPrecisionForLastLayer: false,
|
||||||
|
useCustomCuda: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'GPU-12G-7B-EN',
|
name: 'GPU-12G-14B-EN',
|
||||||
apiParameters: {
|
apiParameters: {
|
||||||
apiPort: 8000,
|
apiPort: 8000,
|
||||||
maxResponseToken: 4100,
|
maxResponseToken: 4100,
|
||||||
@@ -346,31 +401,13 @@ export const defaultModelConfigs: ModelConfig[] = [
|
|||||||
frequencyPenalty: 0.4
|
frequencyPenalty: 0.4
|
||||||
},
|
},
|
||||||
modelParameters: {
|
modelParameters: {
|
||||||
modelName: 'RWKV-4-Raven-7B-v12-Eng98%-Other2%-20230521-ctx8192.pth',
|
modelName: 'RWKV-4-Raven-14B-v12-Eng98%-Other2%-20230523-ctx8192.pth',
|
||||||
device: 'CUDA',
|
device: 'CUDA',
|
||||||
precision: 'fp16',
|
precision: 'int8',
|
||||||
storedLayers: 22,
|
storedLayers: 24,
|
||||||
maxStoredLayers: 41,
|
maxStoredLayers: 41,
|
||||||
enableHighPrecisionForLastLayer: false
|
enableHighPrecisionForLastLayer: false,
|
||||||
}
|
useCustomCuda: true
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'GPU-12G-7B-CN',
|
|
||||||
apiParameters: {
|
|
||||||
apiPort: 8000,
|
|
||||||
maxResponseToken: 4100,
|
|
||||||
temperature: 1.2,
|
|
||||||
topP: 0.5,
|
|
||||||
presencePenalty: 0.4,
|
|
||||||
frequencyPenalty: 0.4
|
|
||||||
},
|
|
||||||
modelParameters: {
|
|
||||||
modelName: 'RWKV-4-Raven-7B-v11-Eng49%-Chn49%-Jpn1%-Other1%-20230430-ctx8192.pth',
|
|
||||||
device: 'CUDA',
|
|
||||||
precision: 'fp16',
|
|
||||||
storedLayers: 22,
|
|
||||||
maxStoredLayers: 41,
|
|
||||||
enableHighPrecisionForLastLayer: false
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -389,7 +426,8 @@ export const defaultModelConfigs: ModelConfig[] = [
|
|||||||
precision: 'fp16',
|
precision: 'fp16',
|
||||||
storedLayers: 41,
|
storedLayers: 41,
|
||||||
maxStoredLayers: 41,
|
maxStoredLayers: 41,
|
||||||
enableHighPrecisionForLastLayer: false
|
enableHighPrecisionForLastLayer: false,
|
||||||
|
useCustomCuda: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -408,7 +446,28 @@ export const defaultModelConfigs: ModelConfig[] = [
|
|||||||
precision: 'fp16',
|
precision: 'fp16',
|
||||||
storedLayers: 41,
|
storedLayers: 41,
|
||||||
maxStoredLayers: 41,
|
maxStoredLayers: 41,
|
||||||
enableHighPrecisionForLastLayer: false
|
enableHighPrecisionForLastLayer: false,
|
||||||
|
useCustomCuda: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'GPU-16G-14B-EN',
|
||||||
|
apiParameters: {
|
||||||
|
apiPort: 8000,
|
||||||
|
maxResponseToken: 4100,
|
||||||
|
temperature: 1.2,
|
||||||
|
topP: 0.5,
|
||||||
|
presencePenalty: 0.4,
|
||||||
|
frequencyPenalty: 0.4
|
||||||
|
},
|
||||||
|
modelParameters: {
|
||||||
|
modelName: 'RWKV-4-Raven-14B-v12-Eng98%-Other2%-20230523-ctx8192.pth',
|
||||||
|
device: 'CUDA',
|
||||||
|
precision: 'int8',
|
||||||
|
storedLayers: 37,
|
||||||
|
maxStoredLayers: 41,
|
||||||
|
enableHighPrecisionForLastLayer: false,
|
||||||
|
useCustomCuda: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -427,7 +486,8 @@ export const defaultModelConfigs: ModelConfig[] = [
|
|||||||
precision: 'int8',
|
precision: 'int8',
|
||||||
storedLayers: 41,
|
storedLayers: 41,
|
||||||
maxStoredLayers: 41,
|
maxStoredLayers: 41,
|
||||||
enableHighPrecisionForLastLayer: false
|
enableHighPrecisionForLastLayer: false,
|
||||||
|
useCustomCuda: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -446,7 +506,8 @@ export const defaultModelConfigs: ModelConfig[] = [
|
|||||||
precision: 'fp16',
|
precision: 'fp16',
|
||||||
storedLayers: 41,
|
storedLayers: 41,
|
||||||
maxStoredLayers: 41,
|
maxStoredLayers: 41,
|
||||||
enableHighPrecisionForLastLayer: false
|
enableHighPrecisionForLastLayer: false,
|
||||||
|
useCustomCuda: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ import React, { FC, ReactElement } from 'react';
|
|||||||
import banner from '../assets/images/banner.jpg';
|
import banner from '../assets/images/banner.jpg';
|
||||||
import {
|
import {
|
||||||
Chat20Regular,
|
Chat20Regular,
|
||||||
|
ClipboardEdit20Regular,
|
||||||
DataUsageSettings20Regular,
|
DataUsageSettings20Regular,
|
||||||
DocumentSettings20Regular,
|
DocumentSettings20Regular
|
||||||
Storage20Regular
|
|
||||||
} from '@fluentui/react-icons';
|
} from '@fluentui/react-icons';
|
||||||
import { useNavigate } from 'react-router';
|
import { useNavigate } from 'react-router';
|
||||||
import { observer } from 'mobx-react-lite';
|
import { observer } from 'mobx-react-lite';
|
||||||
@@ -16,6 +16,7 @@ import { useTranslation } from 'react-i18next';
|
|||||||
import { ConfigSelector } from '../components/ConfigSelector';
|
import { ConfigSelector } from '../components/ConfigSelector';
|
||||||
import MarkdownRender from '../components/MarkdownRender';
|
import MarkdownRender from '../components/MarkdownRender';
|
||||||
import commonStore from '../stores/commonStore';
|
import commonStore from '../stores/commonStore';
|
||||||
|
import { Completion } from './Completion';
|
||||||
|
|
||||||
export type IntroductionContent = { [lang: string]: string }
|
export type IntroductionContent = { [lang: string]: string }
|
||||||
|
|
||||||
@@ -33,6 +34,12 @@ const navCards: NavCard[] = [
|
|||||||
path: '/chat',
|
path: '/chat',
|
||||||
icon: <Chat20Regular />
|
icon: <Chat20Regular />
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: 'Completion',
|
||||||
|
desc: 'Writer, Translator, Role-playing',
|
||||||
|
path: '/completion',
|
||||||
|
icon: <ClipboardEdit20Regular />
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: 'Configs',
|
label: 'Configs',
|
||||||
desc: 'Manage your configs',
|
desc: 'Manage your configs',
|
||||||
@@ -44,12 +51,6 @@ const navCards: NavCard[] = [
|
|||||||
desc: 'Manage models',
|
desc: 'Manage models',
|
||||||
path: '/models',
|
path: '/models',
|
||||||
icon: <DataUsageSettings20Regular />
|
icon: <DataUsageSettings20Regular />
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Train',
|
|
||||||
desc: '',
|
|
||||||
path: '/train',
|
|
||||||
icon: <Storage20Regular />
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import { FileExists, ReadJson } from '../wailsjs/go/backend_golang/App';
|
|||||||
import {
|
import {
|
||||||
Cache,
|
Cache,
|
||||||
checkUpdate,
|
checkUpdate,
|
||||||
|
deleteDynamicProgramFiles,
|
||||||
downloadProgramFiles,
|
downloadProgramFiles,
|
||||||
forceDownloadProgramFiles,
|
|
||||||
LocalConfig,
|
LocalConfig,
|
||||||
refreshModels,
|
refreshModels,
|
||||||
saveCache
|
saveCache
|
||||||
@@ -17,8 +17,9 @@ export async function startup() {
|
|||||||
FileExists('cache.json').then((exists) => {
|
FileExists('cache.json').then((exists) => {
|
||||||
if (exists)
|
if (exists)
|
||||||
downloadProgramFiles();
|
downloadProgramFiles();
|
||||||
else
|
else {
|
||||||
forceDownloadProgramFiles();
|
deleteDynamicProgramFiles().then(downloadProgramFiles);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
EventsOn('downloadList', (data) => {
|
EventsOn('downloadList', (data) => {
|
||||||
if (data)
|
if (data)
|
||||||
@@ -32,7 +33,7 @@ export async function startup() {
|
|||||||
if (commonStore.settings.autoUpdatesCheck) // depends on config settings
|
if (commonStore.settings.autoUpdatesCheck) // depends on config settings
|
||||||
checkUpdate();
|
checkUpdate();
|
||||||
|
|
||||||
getStatus(500).then(status => { // depends on config api port
|
getStatus(1000).then(status => { // depends on config api port
|
||||||
if (status)
|
if (status)
|
||||||
commonStore.setStatus(status);
|
commonStore.setStatus(status);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export enum ModelStatus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export type Status = {
|
export type Status = {
|
||||||
modelStatus: ModelStatus;
|
status: ModelStatus;
|
||||||
pid: number;
|
pid: number;
|
||||||
device_name: string;
|
device_name: string;
|
||||||
}
|
}
|
||||||
@@ -28,7 +28,7 @@ export type Status = {
|
|||||||
class CommonStore {
|
class CommonStore {
|
||||||
// global
|
// global
|
||||||
status: Status = {
|
status: Status = {
|
||||||
modelStatus: ModelStatus.Offline,
|
status: ModelStatus.Offline,
|
||||||
pid: 0,
|
pid: 0,
|
||||||
device_name: 'CPU'
|
device_name: 'CPU'
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -188,6 +188,16 @@ export function forceDownloadProgramFiles() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function deleteDynamicProgramFiles() {
|
||||||
|
let promises: Promise<void>[] = [];
|
||||||
|
manifest.programFiles.forEach(({ path }) => {
|
||||||
|
if ((path.endsWith('.py') && !path.includes('get-pip.py')) || path.includes('requirements') || path.endsWith('.pyd'))
|
||||||
|
promises.push(DeleteFile(path));
|
||||||
|
});
|
||||||
|
return await Promise.allSettled(promises).catch(() => {
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export function bytesToGb(size: number) {
|
export function bytesToGb(size: number) {
|
||||||
return (size / 1024 / 1024 / 1024).toFixed(2);
|
return (size / 1024 / 1024 / 1024).toFixed(2);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": "1.0.5",
|
"version": "1.0.8",
|
||||||
"introduction": {
|
"introduction": {
|
||||||
"en": "RWKV is an open-source, commercially usable large language model with high flexibility and great potential for development.\n### About This Tool\nThis tool aims to lower the barrier of entry for using large language models, making it accessible to everyone. It provides fully automated dependency and model management. You simply need to click and run, following the instructions, to deploy a local large language model. The tool itself is very compact and only requires a single executable file for one-click deployment.\nAdditionally, this tool offers an interface that is fully compatible with the OpenAI API. This means you can use any ChatGPT client as a client for RWKV, enabling capability expansion beyond just chat functionality.\n### Preset Configuration Rules at the Bottom\nThis tool comes with a series of preset configurations to reduce complexity. The naming rules for each configuration represent the following in order: device - required VRAM/memory - model size - model language.\nFor example, \"GPU-8G-3B-EN\" indicates that this configuration is for a graphics card with 8GB of VRAM, a model size of 3 billion parameters, and it uses an English language model.\nLarger model sizes have higher performance and VRAM requirements. Among configurations with the same model size, those with higher VRAM usage will have faster runtime.\nFor example, if you have 12GB of VRAM but running the \"GPU-12G-7B-EN\" configuration is slow, you can downgrade to \"GPU-8G-3B-EN\" for a significant speed improvement.\n### About RWKV\nRWKV is an RNN with Transformer-level LLM performance, which can also be directly trained like a GPT transformer (parallelizable). And it's 100% attention-free. You only need the hidden state at position t to compute the state at position t+1. You can use the \"GPT\" mode to quickly compute the hidden state for the \"RNN\" mode.<br/>So it's combining the best of RNN and transformer - great performance, fast inference, saves VRAM, fast training, \"infinite\" ctx_len, and free sentence embedding (using the final hidden state).",
|
"en": "RWKV is an open-source, commercially usable large language model with high flexibility and great potential for development.\n### About This Tool\nThis tool aims to lower the barrier of entry for using large language models, making it accessible to everyone. It provides fully automated dependency and model management. You simply need to click and run, following the instructions, to deploy a local large language model. The tool itself is very compact and only requires a single executable file for one-click deployment.\nAdditionally, this tool offers an interface that is fully compatible with the OpenAI API. This means you can use any ChatGPT client as a client for RWKV, enabling capability expansion beyond just chat functionality.\n### Preset Configuration Rules at the Bottom\nThis tool comes with a series of preset configurations to reduce complexity. The naming rules for each configuration represent the following in order: device - required VRAM/memory - model size - model language.\nFor example, \"GPU-8G-3B-EN\" indicates that this configuration is for a graphics card with 8GB of VRAM, a model size of 3 billion parameters, and it uses an English language model.\nLarger model sizes have higher performance and VRAM requirements. Among configurations with the same model size, those with higher VRAM usage will have faster runtime.\nFor example, if you have 12GB of VRAM but running the \"GPU-12G-7B-EN\" configuration is slow, you can downgrade to \"GPU-8G-3B-EN\" for a significant speed improvement.\n### About RWKV\nRWKV is an RNN with Transformer-level LLM performance, which can also be directly trained like a GPT transformer (parallelizable). And it's 100% attention-free. You only need the hidden state at position t to compute the state at position t+1. You can use the \"GPT\" mode to quickly compute the hidden state for the \"RNN\" mode.<br/>So it's combining the best of RNN and transformer - great performance, fast inference, saves VRAM, fast training, \"infinite\" ctx_len, and free sentence embedding (using the final hidden state).",
|
||||||
"zh": "RWKV是一个开源且允许商用的大语言模型,灵活性很高且极具发展潜力。\n### 关于本工具\n本工具旨在降低大语言模型的使用门槛,做到人人可用,本工具提供了全自动化的依赖和模型管理,你只需要直接点击运行,跟随引导,即可完成本地大语言模型的部署,工具本身体积极小,只需要一个exe即可完成一键部署。\n此外,本工具提供了与OpenAI API完全兼容的接口,这意味着你可以把任意ChatGPT客户端用作RWKV的客户端,实现能力拓展,而不局限于聊天。\n### 底部的预设配置规则\n本工具内置了一系列预设配置,以降低使用难度,每个配置名的规则,依次代表着:设备-所需显存/内存-模型规模-模型语言。\n例如,GPU-8G-3B-CN,表示该配置用于显卡,需要8G显存,模型规模为30亿参数,使用的是中文模型。\n模型规模越大,性能要求越高,显存要求也越高,而同样模型规模的配置中,显存占用越高的,运行速度越快。\n例如当你有12G显存,但运行GPU-12G-7B-CN配置速度比较慢,可降级成GPU-8G-3B-CN,将会大幅提速。\n### 关于RWKV\nRWKV是具有Transformer级别LLM性能的RNN,也可以像GPT Transformer一样直接进行训练(可并行化)。而且它是100% attention-free的。你只需在位置t处获得隐藏状态即可计算位置t + 1处的状态。你可以使用“GPT”模式快速计算用于“RNN”模式的隐藏状态。\n因此,它将RNN和Transformer的优点结合起来 - 高性能、快速推理、节省显存、快速训练、“无限”上下文长度以及免费的语句嵌入(使用最终隐藏状态)。"
|
"zh": "RWKV是一个开源且允许商用的大语言模型,灵活性很高且极具发展潜力。\n### 关于本工具\n本工具旨在降低大语言模型的使用门槛,做到人人可用,本工具提供了全自动化的依赖和模型管理,你只需要直接点击运行,跟随引导,即可完成本地大语言模型的部署,工具本身体积极小,只需要一个exe即可完成一键部署。\n此外,本工具提供了与OpenAI API完全兼容的接口,这意味着你可以把任意ChatGPT客户端用作RWKV的客户端,实现能力拓展,而不局限于聊天。\n### 底部的预设配置规则\n本工具内置了一系列预设配置,以降低使用难度,每个配置名的规则,依次代表着:设备-所需显存/内存-模型规模-模型语言。\n例如,GPU-8G-3B-CN,表示该配置用于显卡,需要8G显存,模型规模为30亿参数,使用的是中文模型。\n模型规模越大,性能要求越高,显存要求也越高,而同样模型规模的配置中,显存占用越高的,运行速度越快。\n例如当你有12G显存,但运行GPU-12G-7B-CN配置速度比较慢,可降级成GPU-8G-3B-CN,将会大幅提速。\n### 关于RWKV\nRWKV是具有Transformer级别LLM性能的RNN,也可以像GPT Transformer一样直接进行训练(可并行化)。而且它是100% attention-free的。你只需在位置t处获得隐藏状态即可计算位置t + 1处的状态。你可以使用“GPT”模式快速计算用于“RNN”模式的隐藏状态。\n因此,它将RNN和Transformer的优点结合起来 - 高性能、快速推理、节省显存、快速训练、“无限”上下文长度以及免费的语句嵌入(使用最终隐藏状态)。"
|
||||||
@@ -207,6 +207,54 @@
|
|||||||
"lastUpdated": "2023-05-02T09:43:33",
|
"lastUpdated": "2023-05-02T09:43:33",
|
||||||
"url": "https://huggingface.co/BlinkDL/rwkv-4-raven/blob/main/RWKV-4-Raven-14B-v11x-Eng99%25-Other1%25-20230501-ctx8192.pth",
|
"url": "https://huggingface.co/BlinkDL/rwkv-4-raven/blob/main/RWKV-4-Raven-14B-v11x-Eng99%25-Other1%25-20230501-ctx8192.pth",
|
||||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-raven/resolve/main/RWKV-4-Raven-14B-v11x-Eng99%25-Other1%25-20230501-ctx8192.pth"
|
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-raven/resolve/main/RWKV-4-Raven-14B-v11x-Eng99%25-Other1%25-20230501-ctx8192.pth"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "RWKV-4-Novel-7B-v1-Chn-20230426-ctx8192.pth",
|
||||||
|
"desc": {
|
||||||
|
"en": "Chinese Novel 7B v1",
|
||||||
|
"zh": "中文小说 7B v1"
|
||||||
|
},
|
||||||
|
"size": 14785389864,
|
||||||
|
"SHA256": "5fced44febdf80d303250eef9c020f087abded43aaecc8caaea8a9e7f1fb771e",
|
||||||
|
"lastUpdated": "2023-04-26T18:57:01",
|
||||||
|
"url": "https://huggingface.co/BlinkDL/rwkv-4-novel/blob/main/RWKV-4-Novel-7B-v1-Chn-20230426-ctx8192.pth",
|
||||||
|
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-novel/resolve/main/RWKV-4-Novel-7B-v1-Chn-20230426-ctx8192.pth"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "RWKV-4-Novel-3B-v1-Chn-20230412-ctx4096.pth",
|
||||||
|
"desc": {
|
||||||
|
"en": "Chinese Novel 3B v1",
|
||||||
|
"zh": "中文小说 3B v1"
|
||||||
|
},
|
||||||
|
"size": 5969345064,
|
||||||
|
"SHA256": "c41e0af2cbc66e94121377680e8224a1504fac6c9ea620c395f0a79281db26e7",
|
||||||
|
"lastUpdated": "2023-04-12T13:18:29",
|
||||||
|
"url": "https://huggingface.co/BlinkDL/rwkv-4-novel/blob/main/RWKV-4-Novel-3B-v1-Chn-20230412-ctx4096.pth",
|
||||||
|
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-novel/resolve/main/RWKV-4-Novel-3B-v1-Chn-20230412-ctx4096.pth"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "RWKV-4-Novel-3B-v1-ChnEng-20230412-ctx4096.pth",
|
||||||
|
"desc": {
|
||||||
|
"en": "English Novel 3B v1",
|
||||||
|
"zh": "英文小说 3B v1"
|
||||||
|
},
|
||||||
|
"size": 5969345064,
|
||||||
|
"SHA256": "283c6e6fa10c52a93e9a01d9630f288473267ea152a49c6579b5c0427bdc9c61",
|
||||||
|
"lastUpdated": "2023-04-12T13:18:29",
|
||||||
|
"url": "https://huggingface.co/BlinkDL/rwkv-4-novel/blob/main/RWKV-4-Novel-3B-v1-ChnEng-20230412-ctx4096.pth",
|
||||||
|
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-novel/resolve/main/RWKV-4-Novel-3B-v1-ChnEng-20230412-ctx4096.pth"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "RWKV-4-Novel-7B-v1-ChnEng-20230426-ctx8192.pth",
|
||||||
|
"desc": {
|
||||||
|
"en": "English Novel 7B v1",
|
||||||
|
"zh": "英文小说 7B v1"
|
||||||
|
},
|
||||||
|
"size": 14785389864,
|
||||||
|
"SHA256": "bd08c75a296bd193dcfadb993fe06d7f9dd91ca3385231f24c592c89d25cd596",
|
||||||
|
"lastUpdated": "2023-04-26T18:57:01",
|
||||||
|
"url": "https://huggingface.co/BlinkDL/rwkv-4-novel/blob/main/RWKV-4-Novel-7B-v1-ChnEng-20230426-ctx8192.pth",
|
||||||
|
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-novel/resolve/main/RWKV-4-Novel-7B-v1-ChnEng-20230426-ctx8192.pth"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user