Compare commits

...

8 Commits

Author SHA1 Message Date
josc146
96ae47989e release v1.3.4 2023-07-03 22:31:37 +08:00
josc146
368932a610 improve finetune compatibility 2023-07-03 22:28:01 +08:00
josc146
f2cd531fcb fix build for macos and linux 2023-07-03 22:22:55 +08:00
josc146
511652b71c improve finetune compatibility 2023-07-03 22:19:20 +08:00
github-actions[bot]
525fb132d6 release v1.3.3 2023-07-03 13:40:51 +00:00
josc146
5acb1fd958 release v1.3.3 2023-07-03 21:40:22 +08:00
josc146
76761ee453 improve lora finetune process (need to be refactored) 2023-07-03 21:40:16 +08:00
github-actions[bot]
134b2884e6 release v1.3.2 2023-07-03 09:43:01 +00:00
13 changed files with 174 additions and 117 deletions

View File

@@ -83,6 +83,8 @@ jobs:
go install github.com/wailsapp/wails/v2/cmd/wails@latest
rm -rf ./backend-python/wkv_cuda_utils
rm ./backend-python/get-pip.py
sed -i '1,2d' ./backend-golang/wsl_not_windows.go
rm ./backend-golang/wsl.go
make
mv build/bin/RWKV-Runner build/bin/RWKV-Runner_linux_x64
@@ -102,6 +104,8 @@ jobs:
go install github.com/wailsapp/wails/v2/cmd/wails@latest
rm -rf ./backend-python/wkv_cuda_utils
rm ./backend-python/get-pip.py
sed -i '1,2d' ./backend-golang/wsl_not_windows.go
rm ./backend-golang/wsl.go
make
cp build/darwin/Readme_Install.txt build/bin/Readme_Install.txt
cp build/bin/RWKV-Runner.app/Contents/MacOS/RWKV-Runner build/bin/RWKV-Runner_darwin_universal

View File

@@ -1,7 +1,7 @@
## Changes
- lora finetune (need to be refactored)
- reduce package size for linux and macos
- improve finetune compatibility
- fix build for macos and linux
## Install

View File

@@ -1,3 +1,5 @@
//go:build windows
package backend_golang
import (
@@ -8,7 +10,6 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
"time"
@@ -37,10 +38,6 @@ func isWslRunning() (bool, error) {
}
func (a *App) WslStart() error {
if runtime.GOOS != "windows" {
return errors.New("wsl not supported")
}
running, err := isWslRunning()
if err != nil {
return err
@@ -100,10 +97,6 @@ func (a *App) WslStart() error {
}
func (a *App) WslCommand(command string) error {
if runtime.GOOS != "windows" {
return errors.New("wsl not supported")
}
running, err := isWslRunning()
if err != nil {
return err
@@ -119,10 +112,6 @@ func (a *App) WslCommand(command string) error {
}
func (a *App) WslStop() error {
if runtime.GOOS != "windows" {
return errors.New("wsl not supported")
}
running, err := isWslRunning()
if err != nil {
return err
@@ -142,10 +131,6 @@ func (a *App) WslStop() error {
}
func (a *App) WslIsEnabled() error {
if runtime.GOOS != "windows" {
return errors.New("wsl not supported")
}
ex, err := os.Executable()
if err != nil {
return err
@@ -177,10 +162,6 @@ func (a *App) WslIsEnabled() error {
}
func (a *App) WslEnable(forceMode bool) error {
if runtime.GOOS != "windows" {
return errors.New("wsl not supported")
}
cmd := `/online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux`
_, err := su.ShellExecute(su.RUNAS, "dism", cmd, `C:\`)
if err != nil {
@@ -193,10 +174,6 @@ func (a *App) WslEnable(forceMode bool) error {
}
func (a *App) WslInstallUbuntu() error {
if runtime.GOOS != "windows" {
return errors.New("wsl not supported")
}
exec.Command("start", "ms-windows-store://pdp/?ProductId=9PN20MSR04DW").Start()
return nil
_, err := Cmd("ms-windows-store://pdp/?ProductId=9PN20MSR04DW")
return err
}

View File

@@ -0,0 +1,31 @@
//go:build darwin || linux
package backend_golang
import (
"errors"
)
func (a *App) WslStart() error {
return errors.New("wsl not supported")
}
func (a *App) WslCommand(command string) error {
return errors.New("wsl not supported")
}
func (a *App) WslStop() error {
return errors.New("wsl not supported")
}
func (a *App) WslIsEnabled() error {
return errors.New("wsl not supported")
}
func (a *App) WslEnable(forceMode bool) error {
return errors.New("wsl not supported")
}
func (a *App) WslInstallUbuntu() error {
return errors.New("wsl not supported")
}

View File

@@ -11,13 +11,13 @@ fi
if dpkg -s "python3-pip" >/dev/null 2>&1; then
echo "pip installed"
else
sudo apt install python3-pip
sudo apt -y install python3-pip
fi
if dpkg -s "ninja-build" >/dev/null 2>&1; then
echo "ninja installed"
else
sudo apt install ninja-build
sudo apt -y install ninja-build
fi
if dpkg -s "cuda" >/dev/null 2>&1; then

View File

@@ -17,11 +17,14 @@
"""Processing data for pretraining."""
import argparse
import multiprocessing
import os
import sys
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
import argparse
import multiprocessing
import lm_dataformat as lmd
import numpy as np

View File

@@ -195,7 +195,7 @@
"Please convert data first.": "请先转换数据",
"Ubuntu is not installed, do you want to install it?": "Ubuntu未安装是否安装",
"Install Ubuntu": "安装Ubuntu",
"Please install Ubuntu using Microsoft Store": "请用Microsoft Store安装Ubuntu",
"Please install Ubuntu using Microsoft Store, after installation click the Open button in Microsoft Store and then click the Train button": "请用Microsoft Store安装Ubuntu安装完成后点击Microsoft Store界面的“打开”按钮然后点击“训练”按钮",
"WSL is not enabled, do you want to enable it?": "WSL未启用是否启用",
"Enable WSL": "启用WSL",
"After installation, please restart your computer to enable WSL": "安装完成后请重启电脑以启用WSL",
@@ -221,5 +221,7 @@
"Pre-FFN": "前馈网络预处理",
"None": "空",
"Merge model successfully": "合并模型成功",
"Convert Data successfully": "数据转换成功"
"Convert Data successfully": "数据转换成功",
"Please select a LoRA model": "请选择一个LoRA模型",
"You are using sample data for training. For formal training, please make sure to create your own jsonl file.": "你正在使用示例数据训练对于正式训练场合请务必创建你自己的jsonl训练数据"
}

View File

@@ -1,23 +1,16 @@
import React, { FC, MouseEventHandler, ReactElement } from 'react';
import commonStore, { ModelStatus } from '../stores/commonStore';
import {
AddToDownloadList,
CopyFile,
DepCheck,
FileExists,
InstallPyDep,
StartServer
} from '../../wailsjs/go/backend_golang/App';
import { AddToDownloadList, CopyFile, FileExists, StartServer } from '../../wailsjs/go/backend_golang/App';
import { Button } from '@fluentui/react-components';
import { observer } from 'mobx-react-lite';
import { exit, getStatus, readRoot, switchModel, updateConfig } from '../apis';
import { toast } from 'react-toastify';
import { getStrategy, getSupportedCustomCudaFile, toastWithButton } from '../utils';
import { checkDependencies, getStrategy, getSupportedCustomCudaFile, toastWithButton } from '../utils';
import { useTranslation } from 'react-i18next';
import { ToolTipButton } from './ToolTipButton';
import { Play16Regular, Stop16Regular } from '@fluentui/react-icons';
import { useNavigate } from 'react-router';
import { BrowserOpenURL, WindowShow } from '../../wailsjs/runtime/runtime';
import { WindowShow } from '../../wailsjs/runtime/runtime';
const mainButtonText = {
[ModelStatus.Offline]: 'Run',
@@ -57,52 +50,9 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean
return;
}
if (!commonStore.depComplete) {
let depErrorMsg = '';
await DepCheck(commonStore.settings.customPythonPath).catch((e) => {
depErrorMsg = e.message || e;
WindowShow();
if (depErrorMsg === 'python zip not found') {
toastWithButton(t('Python target not found, would you like to download it?'), t('Download'), () => {
toastWithButton(`${t('Downloading')} Python`, t('Check'), () => {
navigate({ pathname: '/downloads' });
}, { autoClose: 3000 });
AddToDownloadList('python-3.10.11-embed-amd64.zip', 'https://www.python.org/ftp/python/3.10.11/python-3.10.11-embed-amd64.zip');
});
} else if (depErrorMsg.includes('DepCheck Error')) {
if (depErrorMsg.includes('vc_redist')) {
toastWithButton(t('Microsoft Visual C++ Redistributable is not installed, would you like to download it?'), t('Download'), () => {
BrowserOpenURL('https://aka.ms/vs/16/release/vc_redist.x64.exe');
});
} else {
toast(depErrorMsg, { type: 'info', position: 'bottom-left' });
if (commonStore.platform != 'linux')
toastWithButton(t('Python dependencies are incomplete, would you like to install them?'), t('Install'), () => {
InstallPyDep(commonStore.settings.customPythonPath, commonStore.settings.cnMirror).catch((e) => {
const errMsg = e.message || e;
toast(t('Error') + ' - ' + errMsg, { type: 'error' });
});
setTimeout(WindowShow, 1000);
}, {
autoClose: 8000
});
else
toastWithButton(t('On Linux system, you must manually install python dependencies.'), t('Check'), () => {
BrowserOpenURL('https://github.com/josStorer/RWKV-Runner/blob/master/build/linux/Readme_Install.txt');
});
}
} else {
toast(depErrorMsg, { type: 'error' });
}
});
if (depErrorMsg) {
commonStore.setStatus({ status: ModelStatus.Offline });
return;
}
commonStore.setDepComplete(true);
if (commonStore.platform === 'windows')
CopyFile('./backend-python/wkv_cuda_utils/wkv_cuda_model.py', './py310/Lib/site-packages/rwkv/model.py');
}
const ok = await checkDependencies(navigate);
if (!ok)
return;
const currentModelSource = commonStore.modelSourceList.find(item => item.name === modelName);

View File

@@ -17,7 +17,7 @@ import { toast } from 'react-toastify';
import commonStore from '../stores/commonStore';
import { observer } from 'mobx-react-lite';
import { SelectTabEventHandler } from '@fluentui/react-tabs';
import { refreshLocalModels, toastWithButton } from '../utils';
import { checkDependencies, refreshLocalModels, toastWithButton } from '../utils';
import { Section } from '../components/Section';
import { Labeled } from '../components/Labeled';
import { ToolTipButton } from '../components/ToolTipButton';
@@ -36,6 +36,7 @@ import {
} from 'chart.js';
import { Line } from 'react-chartjs-2';
import { ChartJSOrUndefined } from 'react-chartjs-2/dist/types';
import { WindowShow } from '../../wailsjs/runtime';
ChartJS.register(
CategoryScale,
@@ -187,10 +188,10 @@ const Terminal: FC = observer(() => {
WslStart().then(() => {
addWslMessage('WSL> ' + input);
setInput('');
WslCommand(input).catch((e) => {
WslCommand(input).catch((e: any) => {
toast((e.message || e), { type: 'error' });
});
}).catch((e) => {
}).catch((e: any) => {
toast((e.message || e), { type: 'error' });
});
}
@@ -207,7 +208,7 @@ const Terminal: FC = observer(() => {
<Button onClick={() => {
WslStop().then(() => {
toast(t('Command Stopped'), { type: 'success' });
}).catch((e) => {
}).catch((e: any) => {
toast((e.message || e), { type: 'error' });
});
}}>
@@ -250,13 +251,28 @@ const LoraFinetune: FC = observer(() => {
});
}, []);
const StartLoraFinetune = () => {
const StartLoraFinetune = async () => {
const ok = await checkDependencies(navigate);
if (!ok)
return;
const convertedDataPath = `./finetune/json2binidx_tool/data/${dataParams.dataPath.split('/').pop()!.split('.')[0]}_text_document`;
if (!await FileExists(convertedDataPath + '.idx')) {
toast(t('Please convert data first.'), { type: 'error' });
return;
}
WslIsEnabled().then(() => {
WslStart().then(async () => {
const convertedDataPath = `./finetune/json2binidx_tool/data/${dataParams.dataPath.split('/').pop()!.split('.')[0]}_text_document`;
if (!await FileExists(convertedDataPath + '.idx')) {
toast(t('Please convert data first.'), { type: 'error' });
return;
WslStart().then(() => {
setTimeout(WindowShow, 1000);
let ctxLen = loraParams.ctxLen;
if (dataParams.dataPath === 'finetune/data/sample.jsonl') {
ctxLen = 150;
toast(t('You are using sample data for training. For formal training, please make sure to create your own jsonl file.'), {
type: 'info',
autoClose: 6000
});
}
commonStore.setChartData({
@@ -272,12 +288,13 @@ const LoraFinetune: FC = observer(() => {
});
WslCommand(`export cnMirror=${commonStore.settings.cnMirror ? '1' : '0'} ` +
`&& export loadModel=models/${loraParams.baseModel} ` +
`&& sed -i 's/\\r$//' finetune/install-wsl-dep-and-train.sh ` +
`&& chmod +x finetune/install-wsl-dep-and-train.sh && ./finetune/install-wsl-dep-and-train.sh ` +
(loraParams.baseModel ? `--load_model models/${loraParams.baseModel} ` : '') +
(loraParams.loraLoad ? `--lora_load lora-models/${loraParams.loraLoad} ` : '') +
`--data_file ${convertedDataPath} ` +
`--vocab_size ${loraParams.baseModel.toLowerCase().includes('world') ? '65536' : '50277'} ` +
`--ctx_len ${loraParams.ctxLen} --epoch_steps ${loraParams.epochSteps} --epoch_count ${loraParams.epochCount} ` +
`--ctx_len ${ctxLen} --epoch_steps ${loraParams.epochSteps} --epoch_count ${loraParams.epochCount} ` +
`--epoch_begin ${loraParams.epochBegin} --epoch_save ${loraParams.epochSave} ` +
`--micro_bsz ${loraParams.microBsz} --accumulate_grad_batches ${loraParams.accumGradBatches} ` +
`--pre_ffn ${loraParams.preFfn ? '1' : '0'} --head_qk ${loraParams.headQk ? '1' : '0'} --lr_init ${loraParams.lrInit} --lr_final ${loraParams.lrFinal} ` +
@@ -285,15 +302,20 @@ const LoraFinetune: FC = observer(() => {
`--beta1 ${loraParams.beta1} --beta2 ${loraParams.beta2} --adam_eps ${loraParams.adamEps} ` +
`--devices ${loraParams.devices} --precision ${loraParams.precision} ` +
`--grad_cp ${loraParams.gradCp ? '1' : '0'} ` +
`--lora_r ${loraParams.loraR} --lora_alpha ${loraParams.loraAlpha} --lora_dropout ${loraParams.loraDropout}`).catch((e) => {
`--lora_r ${loraParams.loraR} --lora_alpha ${loraParams.loraAlpha} --lora_dropout ${loraParams.loraDropout}`).catch((e: any) => {
toast((e.message || e), { type: 'error' });
});
}).catch(e => {
const msg = e.message || e;
if (msg === 'ubuntu not found') {
WindowShow();
toastWithButton(t('Ubuntu is not installed, do you want to install it?'), t('Install Ubuntu'), () => {
WslInstallUbuntu().then(() => {
toast(t('Please install Ubuntu using Microsoft Store'), { type: 'info', autoClose: 6000 });
WindowShow();
toast(t('Please install Ubuntu using Microsoft Store, after installation click the Open button in Microsoft Store and then click the Train button'), {
type: 'info',
autoClose: 10000
});
});
});
}
@@ -302,8 +324,10 @@ const LoraFinetune: FC = observer(() => {
const msg = e.message || e;
const enableWsl = (forceMode: boolean) => {
WindowShow();
toastWithButton(t('WSL is not enabled, do you want to enable it?'), t('Enable WSL'), () => {
WslEnable(forceMode).then(() => {
WindowShow();
toast(t('After installation, please restart your computer to enable WSL'), {
type: 'info',
autoClose: false
@@ -380,7 +404,7 @@ const LoraFinetune: FC = observer(() => {
'./finetune/json2binidx_tool/data/' + dataParams.dataPath.split('/').pop()!.split('.')[0],
dataParams.vocabPath).then(() => {
toast(t('Convert Data successfully'), { type: 'success' });
}).catch((e) => {
}).catch((e: any) => {
toast((e.message || e), { type: 'error' });
});
}}>{t('Convert')}</Button>
@@ -424,15 +448,22 @@ const LoraFinetune: FC = observer(() => {
<option key={index} value={name}>{name}</option>
)}
</Select>
<Button onClick={() => {
MergeLora(commonStore.settings.customPythonPath, true, loraParams.loraAlpha,
'models/' + loraParams.baseModel, 'lora-models/' + loraParams.loraLoad,
`models/${loraParams.baseModel}-LoRA-${loraParams.loraLoad}`).then(() => {
toast(t('Merge model successfully'), { type: 'success' });
refreshLocalModels({ models: commonStore.modelSourceList }, false);
}).catch((e) => {
toast((e.message || e), { type: 'error' });
});
<Button onClick={async () => {
const ok = await checkDependencies(navigate);
if (!ok)
return;
if (loraParams.loraLoad) {
MergeLora(commonStore.settings.customPythonPath, true, loraParams.loraAlpha,
'models/' + loraParams.baseModel, 'lora-models/' + loraParams.loraLoad,
`models/${loraParams.baseModel}-LoRA-${loraParams.loraLoad}`).then(() => {
toast(t('Merge model successfully'), { type: 'success' });
refreshLocalModels({ models: commonStore.modelSourceList }, false);
}).catch((e: any) => {
toast((e.message || e), { type: 'error' });
});
} else {
toast(t('Please select a LoRA model'), { type: 'info' });
}
}}>{t('Merge Model')}</Button>
</div>
{
@@ -491,7 +522,7 @@ const LoraFinetune: FC = observer(() => {
<Button appearance="secondary" size="large" onClick={() => {
WslStop().then(() => {
toast(t('Command Stopped'), { type: 'success' });
}).catch((e) => {
}).catch((e: any) => {
toast((e.message || e), { type: 'error' });
});
}}>{t('Stop')}</Button>

View File

@@ -59,6 +59,9 @@ async function initConfig() {
if (configData.dataProcessParams)
commonStore.setDataProcessParams(configData.dataProcessParams, false);
if (configData.loraFinetuneParams)
commonStore.setLoraFinetuneParameters(configData.loraFinetuneParams, false);
if (configData.modelConfigs && Array.isArray(configData.modelConfigs))
commonStore.setModelConfigs(configData.modelConfigs, false);
else throw new Error('Invalid config.json');

View File

@@ -1,6 +1,9 @@
import {
AddToDownloadList,
CopyFile,
DeleteFile,
DepCheck,
InstallPyDep,
ListDirFiles,
ReadFileInfo,
ReadJson,
@@ -8,7 +11,7 @@ import {
UpdateApp
} from '../../wailsjs/go/backend_golang/App';
import manifest from '../../../manifest.json';
import commonStore from '../stores/commonStore';
import commonStore, { ModelStatus } from '../stores/commonStore';
import { toast } from 'react-toastify';
import { t } from 'i18next';
import { ToastOptions } from 'react-toastify/dist/types';
@@ -18,6 +21,8 @@ import { ModelSourceItem } from '../pages/Models';
import { ModelConfig, ModelParameters } from '../pages/Configs';
import { DownloadStatus } from '../pages/Downloads';
import { DataProcessParameters, LoraFinetuneParameters } from '../pages/Train';
import { BrowserOpenURL, WindowShow } from '../../wailsjs/runtime';
import { NavigateFunction } from 'react-router';
export type Cache = {
version: string
@@ -347,6 +352,56 @@ export async function checkUpdate(notifyEvenLatest: boolean = false) {
});
}
export const checkDependencies = async (navigate: NavigateFunction) => {
if (!commonStore.depComplete) {
let depErrorMsg = '';
await DepCheck(commonStore.settings.customPythonPath).catch((e) => {
depErrorMsg = e.message || e;
WindowShow();
if (depErrorMsg === 'python zip not found') {
toastWithButton(t('Python target not found, would you like to download it?'), t('Download'), () => {
toastWithButton(`${t('Downloading')} Python`, t('Check'), () => {
navigate({ pathname: '/downloads' });
}, { autoClose: 3000 });
AddToDownloadList('python-3.10.11-embed-amd64.zip', 'https://www.python.org/ftp/python/3.10.11/python-3.10.11-embed-amd64.zip');
});
} else if (depErrorMsg.includes('DepCheck Error')) {
if (depErrorMsg.includes('vc_redist')) {
toastWithButton(t('Microsoft Visual C++ Redistributable is not installed, would you like to download it?'), t('Download'), () => {
BrowserOpenURL('https://aka.ms/vs/16/release/vc_redist.x64.exe');
});
} else {
toast(depErrorMsg, { type: 'info', position: 'bottom-left' });
if (commonStore.platform != 'linux')
toastWithButton(t('Python dependencies are incomplete, would you like to install them?'), t('Install'), () => {
InstallPyDep(commonStore.settings.customPythonPath, commonStore.settings.cnMirror).catch((e) => {
const errMsg = e.message || e;
toast(t('Error') + ' - ' + errMsg, { type: 'error' });
});
setTimeout(WindowShow, 1000);
}, {
autoClose: 8000
});
else
toastWithButton(t('On Linux system, you must manually install python dependencies.'), t('Check'), () => {
BrowserOpenURL('https://github.com/josStorer/RWKV-Runner/blob/master/build/linux/Readme_Install.txt');
});
}
} else {
toast(depErrorMsg, { type: 'error' });
}
});
if (depErrorMsg) {
commonStore.setStatus({ status: ModelStatus.Offline });
return false;
}
commonStore.setDepComplete(true);
if (commonStore.platform === 'windows')
CopyFile('./backend-python/wkv_cuda_utils/wkv_cuda_model.py', './py310/Lib/site-packages/rwkv/model.py');
}
return true;
};
export function toastWithButton(text: string, buttonText: string, onClickButton: () => void, options?: ToastOptions) {
let triggered = false;
const id = toast(

View File

@@ -37,6 +37,7 @@ func main() {
backend.CopyEmbed(finetune)
os.Mkdir("models", os.ModePerm)
os.Mkdir("lora-models", os.ModePerm)
os.Mkdir("finetune/json2binidx_tool/data", os.ModePerm)
}
f, err := os.Create("lora-models/train_log.txt")

View File

@@ -1,5 +1,5 @@
{
"version": "1.3.1",
"version": "1.3.3",
"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).",
"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的优点结合起来 - 高性能、快速推理、节省显存、快速训练、“无限”上下文长度以及免费的语句嵌入(使用最终隐藏状态)。"