Compare commits

..

37 Commits

Author SHA1 Message Date
josc146
e318331909 release v1.1.3 2023-05-31 15:46:49 +08:00
josc146
796e5f22c0 custom python path 2023-05-31 15:45:26 +08:00
josc146
b49968c145 custom models path 2023-05-31 15:21:47 +08:00
josc146
cf16e54463 fix_tokens 2023-05-31 14:55:13 +08:00
josc146
7bc8da2e29 add button to reset all configs 2023-05-31 14:19:19 +08:00
josc146
26174d4c10 chore 2023-05-31 14:14:25 +08:00
josc146
3c18ce34c7 cn 7b v12 2023-05-31 12:53:05 +08:00
josc146
c8b2bb53ef improve system for rwkv-4-world 2023-05-31 12:46:06 +08:00
josc146
9f5d15a7d5 custom strategy mode 2023-05-31 12:26:10 +08:00
josc146
8291c50058 safe ModelConfigBody 2023-05-30 23:13:27 +08:00
josc146
1f3f6cf9a8 chore 2023-05-30 22:58:52 +08:00
josc146
83905c65c7 tesla P104 P106 kernel 2023-05-30 22:46:53 +08:00
josc146
9af2b1d208 update readme 2023-05-30 14:40:33 +08:00
josc146
67c9381b82 upload .gitattributes 2023-05-30 13:17:45 +08:00
josc146
4bdfa2d54c update readme 2023-05-30 11:52:38 +08:00
josc146
9945338458 chore 2023-05-30 11:52:33 +08:00
josc146
d93157bde4 don't release embedded files in development mode 2023-05-30 11:04:11 +08:00
josc146
4db9b13803 upload vendor.yml 2023-05-30 10:35:24 +08:00
josc146
69ab273706 release v1.1.2 2023-05-29 23:27:56 +08:00
josc146
d4ce828e99 fix downloads page 2023-05-29 23:27:44 +08:00
josc146
8838b60e97 release v1.1.1 2023-05-29 22:56:55 +08:00
josc146
cbb249725d update models source and hide old models 2023-05-29 22:50:46 +08:00
josc146
53b6a5ffe0 allow system to be placed anywhere 2023-05-29 22:26:22 +08:00
josc146
11b743aa53 RWKV-4-Raven-3B-v12-Eng49%-Chn49%-Jpn1%-Other1%-20230527-ctx4096.pth 2023-05-29 22:15:45 +08:00
josc146
a8c936a885 force display the window after started or updated 2023-05-29 21:51:33 +08:00
josc146
7fb27b927c remove introduction and about in cache 2023-05-29 21:41:44 +08:00
josc146
50bee24e8c external access to the API Switch 2023-05-29 21:34:24 +08:00
josc146
a196ce6da8 setPlatform 2023-05-29 21:20:19 +08:00
josc146
154827f367 improve checkUpdate 2023-05-29 21:15:40 +08:00
josc146
deb9e030cb GetPlatform 2023-05-29 21:15:11 +08:00
josc146
da033ab096 chore 2023-05-29 20:51:20 +08:00
josc146
0fc429f5a3 chore 2023-05-29 20:37:00 +08:00
josc146
142e30622e send response even token is END_OF_TEXT 2023-05-29 20:17:29 +08:00
josc146
81d050d596 download dependencies when file size is zero 2023-05-29 20:16:14 +08:00
josc146
5e698a8312 support for tesla P40 custom cuda kernel 2023-05-29 20:15:37 +08:00
josc146
55bb33bcbb embed all core dependencies 2023-05-29 20:14:42 +08:00
josc146
b4efce15f4 reduce size 2023-05-29 20:13:06 +08:00
28 changed files with 32868 additions and 253 deletions

6
.gitattributes vendored Normal file
View File

@@ -0,0 +1,6 @@
backend-python/rwkv_pip/** linguist-vendored
backend-python/wkv_cuda_utils/** linguist-vendored
backend-python/get-pip.py linguist-vendored
backend-python/convert_model.py linguist-vendored
build/** linguist-vendored
frontend/wailsjs/** linguist-generated

2
.gitignore vendored
View File

@@ -10,8 +10,6 @@ __pycache__
/cache.json
/frontend/stats.html
/frontend/package.json.md5
/backend-python/get-pip.py
/backend-python/.get-pip.py
/py310
*.zip
/cmd-helper.bat

View File

@@ -39,7 +39,8 @@ English | [简体中文](README_ZH.md)
- Fully compatible with the OpenAI API, making every ChatGPT client an RWKV client. After starting the model,
open http://127.0.0.1:8000/docs to view more details.
- Automatic dependency installation, requiring only a lightweight executable program
- User-friendly chat interaction interface included
- Configs with 2G to 32G VRAM are included, works well on almost all computers
- User-friendly chat and completion interaction interface included
- Easy-to-understand and operate parameter configuration
- Built-in model conversion tool
- Built-in download management and remote model inspection

View File

@@ -39,7 +39,8 @@ API兼容的接口这意味着一切ChatGPT客户端都是RWKV客户端。
- RWKV模型管理一键启动
- 与OpenAI API完全兼容一切ChatGPT客户端都是RWKV客户端。启动模型后打开 http://127.0.0.1:8000/docs 查看详细内容
- 全自动依赖安装,你只需要一个轻巧的可执行程序
- 自带用户友好的聊天交互页面
- 预设了2G至32G显存的配置几乎在各种电脑上工作良好
- 自带用户友好的聊天和补全交互页面
- 易于理解和操作的参数配置
- 内置模型转换工具
- 内置下载管理和远程模型检视

View File

@@ -7,24 +7,33 @@ import (
"strconv"
)
func (a *App) StartServer(port int, host string) (string, error) {
python, err := GetPython()
func (a *App) StartServer(python string, port int, host string) (string, error) {
var err error
if python == "" {
python, err = GetPython()
}
if err != nil {
return "", err
}
return Cmd(python, "./backend-python/main.py", strconv.Itoa(port), host)
}
func (a *App) ConvertModel(modelPath string, strategy string, outPath string) (string, error) {
python, err := GetPython()
func (a *App) ConvertModel(python string, modelPath string, strategy string, outPath string) (string, error) {
var err error
if python == "" {
python, err = GetPython()
}
if err != nil {
return "", err
}
return Cmd(python, "./backend-python/convert_model.py", "--in", modelPath, "--out", outPath, "--strategy", strategy)
}
func (a *App) DepCheck() error {
python, err := GetPython()
func (a *App) DepCheck(python string) error {
var err error
if python == "" {
python, err = GetPython()
}
if err != nil {
return err
}
@@ -35,8 +44,11 @@ func (a *App) DepCheck() error {
return nil
}
func (a *App) InstallPyDep(cnMirror bool) (string, error) {
python, err := GetPython()
func (a *App) InstallPyDep(python string, cnMirror bool) (string, error) {
var err error
if python == "" {
python, err = GetPython()
}
if err != nil {
return "", err
}

32321
backend-python/get-pip.py vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -37,6 +37,12 @@ async def chat_completions(body: ChatCompletionBody, request: Request):
question = body.messages[-1]
if question.role == "user":
question = question.content
elif question.role == "system":
question = body.messages[-2]
if question.role == "user":
question = question.content
else:
raise HTTPException(status.HTTP_400_BAD_REQUEST, "no question found")
else:
raise HTTPException(status.HTTP_400_BAD_REQUEST, "no question found")
@@ -53,31 +59,33 @@ The following is a coherent verbose detailed conversation between a girl named {
{bot} usually gives {user} kind, helpful and informative advices.\n
"""
if user == "Bob"
else ""
else f"{user}{interface} hi\n\n{bot}{interface} Hi. I am your assistant and I will provide expert full response in full details. Please feel free to ask any question and I will always answer it.\n\n"
)
for message in body.messages:
if message.role == "system":
completion_text = (
f"The following is a coherent verbose detailed conversation between a girl named {bot} and her friend {user}. "
if user == "Bob"
else ""
else f"{user}{interface} hi\n\n{bot}{interface} Hi. "
+ message.content.replace("\\n", "\n")
.replace("\r\n", "\n")
.replace("\n\n", "\n")
.replace("\n", " ")
.strip()
.replace("You are", f"{bot} is")
.replace("you are", f"{bot} is")
.replace("You're", f"{bot} is")
.replace("you're", f"{bot} is")
.replace("You", f"{bot}")
.replace("you", f"{bot}")
.replace("Your", f"{bot}'s")
.replace("your", f"{bot}'s")
.replace("", f"{bot}")
.replace("You are", f"{bot} is" if user == "Bob" else "I am")
.replace("you are", f"{bot} is" if user == "Bob" else "I am")
.replace("You're", f"{bot} is" if user == "Bob" else "I'm")
.replace("you're", f"{bot} is" if user == "Bob" else "I'm")
.replace("You", f"{bot}" if user == "Bob" else "I")
.replace("you", f"{bot}" if user == "Bob" else "I")
.replace("Your", f"{bot}'s" if user == "Bob" else "My")
.replace("your", f"{bot}'s" if user == "Bob" else "my")
.replace("", f"{bot}" if user == "Bob" else "")
+ "\n\n"
)
elif message.role == "user":
break
for message in body.messages:
if message.role == "user":
completion_text += (
f"{user}{interface} "
+ message.content.replace("\\n", "\n")

View File

@@ -1,6 +1,6 @@
import pathlib
from fastapi import APIRouter, HTTPException, Response, status
from fastapi import APIRouter, HTTPException, Response, status as Status
from pydantic import BaseModel
from langchain.llms import RWKV
from utils.rwkv import *
@@ -33,7 +33,7 @@ class SwitchModelBody(BaseModel):
@router.post("/switch-model")
def switch_model(body: SwitchModelBody, response: Response):
if global_var.get(global_var.Model_Status) is global_var.ModelStatus.Loading:
response.status_code = status.HTTP_304_NOT_MODIFIED
response.status_code = Status.HTTP_304_NOT_MODIFIED
return
global_var.set(global_var.Model_Status, global_var.ModelStatus.Offline)
@@ -55,7 +55,7 @@ def switch_model(body: SwitchModelBody, response: Response):
except Exception as e:
print(e)
global_var.set(global_var.Model_Status, global_var.ModelStatus.Offline)
raise HTTPException(status.HTTP_500_INTERNAL_SERVER_ERROR, "failed to load")
raise HTTPException(Status.HTTP_500_INTERNAL_SERVER_ERROR, "failed to load")
if global_var.get(global_var.Model_Config) is None:
global_var.set(

View File

@@ -3,13 +3,14 @@ import pathlib
import copy
from typing import Dict, List
from fastapi import HTTPException
from pydantic import BaseModel
from pydantic import BaseModel, Field
from rwkv_pip.utils import PIPELINE
from routes import state_cache
END_OF_TEXT = 0
END_OF_LINE = 187
END_OF_LINE_DOUBLE = 535
os.environ["TORCH_EXTENSIONS_DIR"] = f"{pathlib.Path(__file__).parent.parent.resolve()}"
@@ -34,8 +35,8 @@ class RWKV:
self.interface = ":"
if "rwkv_vocab" in tokens_path:
self.user = "Human"
self.bot = "Bot"
self.user = "Question"
self.bot = "Answer"
else:
self.user = "Bob"
self.bot = "Alice"
@@ -50,28 +51,38 @@ class RWKV:
self.preload()
def preload(self):
if self.user == "Bob":
bot = self.bot
user = self.user
preset_system = f"""
interface = self.interface
user = self.user
bot = self.bot
preset_system = (
f"""
The following is a coherent verbose detailed conversation between a girl named {bot} and her friend {user}. \
{bot} is very intelligent, creative and friendly. \
{bot} is unlikely to disagree with {user}, and {bot} doesn't like to ask {user} questions. \
{bot} likes to tell {user} a lot about herself and her opinions. \
{bot} usually gives {user} kind, helpful and informative advices.\n
"""
logits = self.run_rnn(self.pipeline.encode(preset_system))
try:
state_cache.add_state(
state_cache.AddStateBody(
prompt=preset_system,
tokens=self.model_tokens,
state=self.model_state,
logits=logits,
)
if self.user == "Bob"
else f"{user}{interface} hi\n\n{bot}{interface} Hi. I am your assistant and I will provide expert full response in full details. Please feel free to ask any question and I will always answer it.\n\n"
)
logits = self.run_rnn(self.pipeline.encode(preset_system))
try:
state_cache.add_state(
state_cache.AddStateBody(
prompt=preset_system,
tokens=self.model_tokens,
state=self.model_state,
logits=logits,
)
except HTTPException:
pass
)
except HTTPException:
pass
# Model only saw '\n\n' as [187, 187] before, but the tokenizer outputs [535] for it at the end
def fix_tokens(tokens):
if len(tokens) > 0 and tokens[-1] == END_OF_LINE_DOUBLE:
tokens = tokens[:-1] + [END_OF_LINE, END_OF_LINE]
return tokens
def run_rnn(self, _tokens: List[str], newline_adj: int = 0):
tokens = [int(x) for x in _tokens]
@@ -108,7 +119,7 @@ The following is a coherent verbose detailed conversation between a girl named {
logits = copy.deepcopy(cache["logits"])
if delta_prompt != "":
logits = self.run_rnn(self.pipeline.encode(delta_prompt))
logits = self.run_rnn(self.fix_tokens(self.pipeline.encode(delta_prompt)))
try:
state_cache.add_state(
state_cache.AddStateBody(
@@ -138,6 +149,7 @@ The following is a coherent verbose detailed conversation between a girl named {
)
if token == END_OF_TEXT:
yield response, ""
break
if token not in occurrence:
occurrence[token] = 1
@@ -181,23 +193,23 @@ The following is a coherent verbose detailed conversation between a girl named {
class ModelConfigBody(BaseModel):
max_tokens: int = None
temperature: float = None
top_p: float = None
presence_penalty: float = None
frequency_penalty: float = None
max_tokens: int = Field(default=None, gt=0, le=102400)
temperature: float = Field(default=None, ge=0, le=2)
top_p: float = Field(default=None, ge=0, le=1)
presence_penalty: float = Field(default=None, ge=-2, le=2)
frequency_penalty: float = Field(default=None, ge=-2, le=2)
def set_rwkv_config(model: RWKV, body: ModelConfigBody):
if body.max_tokens:
if body.max_tokens is not None:
model.max_tokens_per_generation = body.max_tokens
if body.temperature:
if body.temperature is not None:
model.temperature = body.temperature
if body.top_p:
if body.top_p is not None:
model.top_p = body.top_p
if body.presence_penalty:
if body.presence_penalty is not None:
model.penalty_alpha_presence = body.presence_penalty
if body.frequency_penalty:
if body.frequency_penalty is not None:
model.penalty_alpha_frequency = body.frequency_penalty

BIN
build/appicon.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@@ -116,7 +116,6 @@
"Werewolf": "狼人杀",
"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",
"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": "起始注入文本",
@@ -124,5 +123,14 @@
"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": "情境冒险"
"Chinese Kongfu": "情境冒险",
"Allow external access to the API (service must be restarted)": "允许外部访问API (必须重启服务)",
"Custom": "自定义",
"Reset All Configs": "重置所有配置",
"Cancel": "取消",
"Confirm": "确认",
"Are you sure you want to reset all configs? This will obtain the latest preset configs, but will override your custom configs and cannot be undone.": "你确定要重置所有配置吗?这会获取最新的预设配置,但会覆盖你的自定义配置,并且无法撤销",
"Advanced": "高级",
"Custom Python Path": "自定义Python路径",
"Custom Models Path": "自定义模型路径"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 238 KiB

View File

@@ -12,7 +12,6 @@ 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 manifest from '../../../manifest.json';
import { getStrategy, getSupportedCustomCudaFile, saveCache, toastWithButton } from '../utils';
import { useTranslation } from 'react-i18next';
import { ToolTipButton } from './ToolTipButton';
@@ -51,7 +50,7 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean
let modelPath = '';
if (modelConfig && modelConfig.modelParameters) {
modelName = modelConfig.modelParameters.modelName;
modelPath = `./${manifest.localModelDir}/${modelName}`;
modelPath = `${commonStore.settings.customModelsPath}/${modelName}`;
} else {
toast(t('Model Config Exception'), { type: 'error' });
commonStore.setStatus({ status: ModelStatus.Offline });
@@ -60,7 +59,7 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean
if (!commonStore.depComplete) {
let depErrorMsg = '';
await DepCheck().catch((e) => {
await DepCheck(commonStore.settings.customPythonPath).catch((e) => {
depErrorMsg = e.message || e;
WindowShow();
if (depErrorMsg === 'python zip not found') {
@@ -72,7 +71,7 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean
});
} else if (depErrorMsg.includes('DepCheck Error')) {
toastWithButton(t('Python dependencies are incomplete, would you like to install them?'), t('Install'), () => {
InstallPyDep(commonStore.settings.cnMirror);
InstallPyDep(commonStore.settings.customPythonPath, commonStore.settings.cnMirror);
setTimeout(WindowShow, 1000);
});
} else {
@@ -84,7 +83,8 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean
return;
}
commonStore.setDepComplete(true);
CopyFile('./backend-python/wkv_cuda_utils/wkv_cuda_model.py', './py310/Lib/site-packages/rwkv/model.py');
if (commonStore.platform === 'windows')
CopyFile('./backend-python/wkv_cuda_utils/wkv_cuda_model.py', './py310/Lib/site-packages/rwkv/model.py');
saveCache();
}
@@ -110,7 +110,7 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean
await exit(1000).catch(() => {
});
StartServer(port, commonStore.settings.host);
StartServer(commonStore.settings.customPythonPath, port, commonStore.settings.host !== '127.0.0.1' ? '0.0.0.0' : '127.0.0.1');
setTimeout(WindowShow, 1000);
let timeoutCount = 6;
@@ -136,9 +136,9 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean
});
let customCudaFile = '';
if (modelConfig.modelParameters.useCustomCuda) {
if (modelConfig.modelParameters.device != 'CPU' && modelConfig.modelParameters.useCustomCuda) {
customCudaFile = getSupportedCustomCudaFile();
if (customCudaFile) {
if (customCudaFile && commonStore.platform === 'windows') {
FileExists('./py310/Lib/site-packages/rwkv/model.py').then((exist) => {
// defensive measure. As Python has already been launched, will only take effect the next time it runs.
if (!exist) CopyFile('./backend-python/wkv_cuda_utils/wkv_cuda_model.py', './py310/Lib/site-packages/rwkv/model.py');
@@ -156,7 +156,7 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean
}
switchModel({
model: `${manifest.localModelDir}/${modelConfig.modelParameters.modelName}`,
model: modelPath,
strategy: getStrategy(modelConfig),
customCuda: customCudaFile !== ''
}).then((r) => {

View File

@@ -6,6 +6,7 @@ import App from './App';
import { HashRouter } from 'react-router-dom';
import { startup } from './startup';
import './_locales/i18n-react';
import { WindowSetAlwaysOnTop } from '../wailsjs/runtime';
startup().then(() => {
const container = document.getElementById('root');
@@ -17,4 +18,8 @@ startup().then(() => {
<App />
</HashRouter>
);
// force display the window
WindowSetAlwaysOnTop(true);
WindowSetAlwaysOnTop(false);
});

View File

@@ -7,7 +7,7 @@ import { v4 as uuid } from 'uuid';
import classnames from 'classnames';
import { fetchEventSource } from '@microsoft/fetch-event-source';
import { ConversationPair, getConversationPairs, Record } from '../utils/get-conversation-pairs';
import logo from '../../../build/appicon.png';
import logo from '../../../build/appicon.jpg';
import MarkdownRender from '../components/MarkdownRender';
import { ToolTipButton } from '../components/ToolTipButton';
import { ArrowCircleUp28Regular, Delete28Regular, RecordStop28Regular } from '@fluentui/react-icons';

View File

@@ -1,5 +1,26 @@
import { Dropdown, Input, Label, Option, Select, Switch } from '@fluentui/react-components';
import { AddCircle20Regular, DataUsageSettings20Regular, Delete20Regular, Save20Regular } from '@fluentui/react-icons';
import {
Button,
Dialog,
DialogActions,
DialogBody,
DialogContent,
DialogSurface,
DialogTitle,
DialogTrigger,
Dropdown,
Input,
Label,
Option,
Select,
Switch
} from '@fluentui/react-components';
import {
AddCircle20Regular,
ArrowReset20Regular,
DataUsageSettings20Regular,
Delete20Regular,
Save20Regular
} from '@fluentui/react-icons';
import React, { FC } from 'react';
import { Section } from '../components/Section';
import { Labeled } from '../components/Labeled';
@@ -14,7 +35,6 @@ import { useNavigate } from 'react-router';
import { RunButton } from '../components/RunButton';
import { updateConfig } from '../apis';
import { ConvertModel, FileExists } from '../../wailsjs/go/backend_golang/App';
import manifest from '../../../manifest.json';
import { getStrategy, refreshLocalModels } from '../utils';
import { useTranslation } from 'react-i18next';
import { WindowShow } from '../../wailsjs/runtime/runtime';
@@ -28,7 +48,7 @@ export type ApiParameters = {
frequencyPenalty: number;
}
export type Device = 'CPU' | 'CUDA';
export type Device = 'CPU' | 'CUDA' | 'Custom';
export type Precision = 'fp16' | 'int8' | 'fp32';
export type ModelParameters = {
@@ -40,6 +60,7 @@ export type ModelParameters = {
maxStoredLayers: number;
enableHighPrecisionForLastLayer: boolean;
useCustomCuda?: boolean;
customStrategy?: string;
}
export type ModelConfig = {
@@ -121,7 +142,7 @@ export const defaultModelConfigs: ModelConfig[] = [
frequencyPenalty: 0.4
},
modelParameters: {
modelName: 'RWKV-4-Raven-3B-v11-Eng49%-Chn49%-Jpn1%-Other1%-20230429-ctx4096.pth',
modelName: 'RWKV-4-Raven-3B-v12-Eng49%-Chn49%-Jpn1%-Other1%-20230527-ctx4096.pth',
device: 'CUDA',
precision: 'int8',
storedLayers: 24,
@@ -161,7 +182,7 @@ export const defaultModelConfigs: ModelConfig[] = [
frequencyPenalty: 0.4
},
modelParameters: {
modelName: 'RWKV-4-Raven-7B-v11-Eng49%-Chn49%-Jpn1%-Other1%-20230430-ctx8192.pth',
modelName: 'RWKV-4-Raven-7B-v12-Eng49%-Chn49%-Jpn1%-Other1%-20230530-ctx8192.pth',
device: 'CUDA',
precision: 'int8',
storedLayers: 8,
@@ -221,7 +242,7 @@ export const defaultModelConfigs: ModelConfig[] = [
frequencyPenalty: 0.4
},
modelParameters: {
modelName: 'RWKV-4-Raven-3B-v11-Eng49%-Chn49%-Jpn1%-Other1%-20230429-ctx4096.pth',
modelName: 'RWKV-4-Raven-3B-v12-Eng49%-Chn49%-Jpn1%-Other1%-20230527-ctx4096.pth',
device: 'CUDA',
precision: 'int8',
storedLayers: 41,
@@ -261,7 +282,7 @@ export const defaultModelConfigs: ModelConfig[] = [
frequencyPenalty: 0.4
},
modelParameters: {
modelName: 'RWKV-4-Raven-7B-v11-Eng49%-Chn49%-Jpn1%-Other1%-20230430-ctx8192.pth',
modelName: 'RWKV-4-Raven-7B-v12-Eng49%-Chn49%-Jpn1%-Other1%-20230530-ctx8192.pth',
device: 'CUDA',
precision: 'int8',
storedLayers: 18,
@@ -301,7 +322,7 @@ export const defaultModelConfigs: ModelConfig[] = [
frequencyPenalty: 0.4
},
modelParameters: {
modelName: 'RWKV-4-Raven-3B-v11-Eng49%-Chn49%-Jpn1%-Other1%-20230429-ctx4096.pth',
modelName: 'RWKV-4-Raven-3B-v12-Eng49%-Chn49%-Jpn1%-Other1%-20230527-ctx4096.pth',
device: 'CUDA',
precision: 'fp16',
storedLayers: 41,
@@ -341,7 +362,7 @@ export const defaultModelConfigs: ModelConfig[] = [
frequencyPenalty: 0.4
},
modelParameters: {
modelName: 'RWKV-4-Raven-7B-v11-Eng49%-Chn49%-Jpn1%-Other1%-20230430-ctx8192.pth',
modelName: 'RWKV-4-Raven-7B-v12-Eng49%-Chn49%-Jpn1%-Other1%-20230530-ctx8192.pth',
device: 'CUDA',
precision: 'int8',
storedLayers: 27,
@@ -381,7 +402,7 @@ export const defaultModelConfigs: ModelConfig[] = [
frequencyPenalty: 0.4
},
modelParameters: {
modelName: 'RWKV-4-Raven-7B-v11-Eng49%-Chn49%-Jpn1%-Other1%-20230430-ctx8192.pth',
modelName: 'RWKV-4-Raven-7B-v12-Eng49%-Chn49%-Jpn1%-Other1%-20230530-ctx8192.pth',
device: 'CUDA',
precision: 'int8',
storedLayers: 41,
@@ -441,7 +462,7 @@ export const defaultModelConfigs: ModelConfig[] = [
frequencyPenalty: 0.4
},
modelParameters: {
modelName: 'RWKV-4-Raven-7B-v11-Eng49%-Chn49%-Jpn1%-Other1%-20230430-ctx8192.pth',
modelName: 'RWKV-4-Raven-7B-v12-Eng49%-Chn49%-Jpn1%-Other1%-20230530-ctx8192.pth',
device: 'CUDA',
precision: 'fp16',
storedLayers: 41,
@@ -559,7 +580,7 @@ export const defaultModelConfigs: ModelConfig[] = [
frequencyPenalty: 0.4
},
modelParameters: {
modelName: 'RWKV-4-Raven-3B-v11-Eng49%-Chn49%-Jpn1%-Other1%-20230429-ctx4096.pth',
modelName: 'RWKV-4-Raven-3B-v12-Eng49%-Chn49%-Jpn1%-Other1%-20230527-ctx4096.pth',
device: 'CPU',
precision: 'fp32',
storedLayers: 41,
@@ -597,7 +618,7 @@ export const defaultModelConfigs: ModelConfig[] = [
frequencyPenalty: 0.4
},
modelParameters: {
modelName: 'RWKV-4-Raven-7B-v11-Eng49%-Chn49%-Jpn1%-Other1%-20230430-ctx8192.pth',
modelName: 'RWKV-4-Raven-7B-v12-Eng49%-Chn49%-Jpn1%-Other1%-20230530-ctx8192.pth',
device: 'CPU',
precision: 'fp32',
storedLayers: 41,
@@ -679,6 +700,31 @@ export const Configs: FC = observer(() => {
commonStore.deleteModelConfig(selectedIndex);
updateSelectedIndex(Math.min(selectedIndex, commonStore.modelConfigs.length - 1));
}} />
<Dialog>
<DialogTrigger disableButtonEnhancement>
<ToolTipButton desc={t('Reset All Configs')} icon={<ArrowReset20Regular />} />
</DialogTrigger>
<DialogSurface>
<DialogBody>
<DialogTitle>{t('Reset All Configs')}</DialogTitle>
<DialogContent>
{t('Are you sure you want to reset all configs? This will obtain the latest preset configs, but will override your custom configs and cannot be undone.')}
</DialogContent>
<DialogActions>
<DialogTrigger disableButtonEnhancement>
<Button appearance="secondary">{t('Cancel')}</Button>
</DialogTrigger>
<DialogTrigger disableButtonEnhancement>
<Button appearance="primary" onClick={() => {
commonStore.setModelConfigs(defaultModelConfigs, false); // updateSelectedIndex() will save configs
updateSelectedIndex(0);
}}>{t('Confirm')}
</Button>
</DialogTrigger>
</DialogActions>
</DialogBody>
</DialogSurface>
</Dialog>
<ToolTipButton desc={t('Save Config')} icon={<Save20Regular />} onClick={onClickSave} />
</div>
<div className="flex items-center gap-4">
@@ -789,12 +835,12 @@ export const Configs: FC = observer(() => {
</div>
} />
<ToolTipButton text={t('Convert')} desc={t('Convert model with these configs')} onClick={async () => {
const modelPath = `${manifest.localModelDir}/${selectedConfig.modelParameters.modelName}`;
const modelPath = `${commonStore.settings.customModelsPath}/${selectedConfig.modelParameters.modelName}`;
if (await FileExists(modelPath)) {
const strategy = getStrategy(selectedConfig);
const newModelPath = modelPath + '-' + strategy.replace(/[> *+]/g, '-');
const newModelPath = modelPath + '-' + strategy.replace(/[:> *+]/g, '-');
toast(t('Start Converting'), { autoClose: 1000, type: 'info' });
ConvertModel(modelPath, strategy, newModelPath).then(() => {
ConvertModel(commonStore.settings.customPythonPath, modelPath, strategy, newModelPath).then(() => {
toast(`${t('Convert Success')} - ${newModelPath}`, { type: 'success' });
refreshLocalModels({ models: commonStore.modelSourceList }, false);
}).catch(e => {
@@ -806,69 +852,94 @@ export const Configs: FC = observer(() => {
}
}} />
<Labeled label={t('Device')} content={
<Dropdown style={{ minWidth: 0 }} className="grow" value={selectedConfig.modelParameters.device}
<Dropdown style={{ minWidth: 0 }} className="grow" value={t(selectedConfig.modelParameters.device)!}
selectedOptions={[selectedConfig.modelParameters.device]}
onOptionSelect={(_, data) => {
if (data.optionText) {
if (data.optionValue) {
setSelectedConfigModelParams({
device: data.optionText as Device
device: data.optionValue as Device
});
}
}}>
<Option>CPU</Option>
<Option>CUDA</Option>
<Option value="CPU">CPU</Option>
<Option value="CUDA">CUDA</Option>
<Option value="Custom">{t('Custom')!}</Option>
</Dropdown>
} />
<Labeled label={t('Precision')}
desc={t('int8 uses less VRAM, but has slightly lower quality. fp16 has higher quality, and fp32 has the best quality.')}
content={
<Dropdown style={{ minWidth: 0 }} className="grow"
value={selectedConfig.modelParameters.precision}
selectedOptions={[selectedConfig.modelParameters.precision]}
onOptionSelect={(_, data) => {
if (data.optionText) {
{
selectedConfig.modelParameters.device != 'Custom' && <Labeled label={t('Precision')}
desc={t('int8 uses less VRAM, but has slightly lower quality. fp16 has higher quality, and fp32 has the best quality.')}
content={
<Dropdown style={{ minWidth: 0 }} className="grow"
value={selectedConfig.modelParameters.precision}
selectedOptions={[selectedConfig.modelParameters.precision]}
onOptionSelect={(_, data) => {
if (data.optionText) {
setSelectedConfigModelParams({
precision: data.optionText as Precision
});
}
}}>
<Option>fp16</Option>
<Option>int8</Option>
<Option>fp32</Option>
</Dropdown>
} />
}
{selectedConfig.modelParameters.device == 'CUDA' && <div />}
{
selectedConfig.modelParameters.device == 'CUDA' && <Labeled label={t('Stored Layers')}
desc={t('Number of the neural network layers loaded into VRAM, the more you load, the faster the speed, but it consumes more VRAM.')}
content={
<ValuedSlider value={selectedConfig.modelParameters.storedLayers} min={0}
max={selectedConfig.modelParameters.maxStoredLayers} step={1} input
onChange={(e, data) => {
setSelectedConfigModelParams({
precision: data.optionText as Precision
storedLayers: data.value
});
}
}}>
<Option>fp16</Option>
<Option>int8</Option>
<Option>fp32</Option>
</Dropdown>
} />
<div />
<Labeled label={t('Stored Layers')}
desc={t('Number of the neural network layers loaded into VRAM, the more you load, the faster the speed, but it consumes more VRAM.')}
content={
<ValuedSlider value={selectedConfig.modelParameters.storedLayers} min={0}
max={selectedConfig.modelParameters.maxStoredLayers} step={1} input
onChange={(e, data) => {
setSelectedConfigModelParams({
storedLayers: data.value
});
}} />
} />
<Labeled label={t('Enable High Precision For Last Layer')}
desc={t('Whether to use CPU to calculate the last output layer of the neural network with FP32 precision to obtain better quality.')}
content={
<Switch checked={selectedConfig.modelParameters.enableHighPrecisionForLastLayer}
onChange={(e, data) => {
setSelectedConfigModelParams({
enableHighPrecisionForLastLayer: data.checked
});
}} />
} />
<Labeled label={t('Use Custom CUDA kernel to Accelerate')}
desc={t('Enabling this option can greatly improve inference speed, but there may be compatibility issues. If it fails to start, please turn off this option.')}
content={
<Switch checked={selectedConfig.modelParameters.useCustomCuda}
onChange={(e, data) => {
setSelectedConfigModelParams({
useCustomCuda: data.checked
});
}} />
} />
}} />
} />
}
{
selectedConfig.modelParameters.device == 'CUDA' &&
<Labeled label={t('Enable High Precision For Last Layer')}
desc={t('Whether to use CPU to calculate the last output layer of the neural network with FP32 precision to obtain better quality.')}
content={
<Switch checked={selectedConfig.modelParameters.enableHighPrecisionForLastLayer}
onChange={(e, data) => {
setSelectedConfigModelParams({
enableHighPrecisionForLastLayer: data.checked
});
}} />
} />
}
{
selectedConfig.modelParameters.device == 'Custom' &&
<Labeled label="Strategy" desc="https://github.com/BlinkDL/ChatRWKV/blob/main/ChatRWKV-strategy.png"
content={
<Input className="grow" placeholder="cuda:0 fp16 *20 -> cuda:1 fp16"
value={selectedConfig.modelParameters.customStrategy}
onChange={(e, data) => {
setSelectedConfigModelParams({
customStrategy: data.value
});
}} />
} />
}
{selectedConfig.modelParameters.device == 'Custom' && <div />}
{
selectedConfig.modelParameters.device != 'CPU' &&
<Labeled label={t('Use Custom CUDA kernel to Accelerate')}
desc={t('Enabling this option can greatly improve inference speed, but there may be compatibility issues. If it fails to start, please turn off this option.')}
content={
<Switch checked={selectedConfig.modelParameters.useCustomCuda}
onChange={(e, data) => {
setSelectedConfigModelParams({
useCustomCuda: data.checked
});
}} />
} />
}
</div>
}
/>

View File

@@ -18,7 +18,6 @@ import { observer } from 'mobx-react-lite';
import commonStore from '../stores/commonStore';
import { BrowserOpenURL } from '../../wailsjs/runtime';
import { AddToDownloadList, OpenFileFolder } from '../../wailsjs/go/backend_golang/App';
import manifest from '../../../manifest.json';
import { Page } from '../components/Page';
import { bytesToGb, refreshModels, saveConfigs, toastWithButton } from '../utils';
import { useTranslation } from 'react-i18next';
@@ -34,6 +33,7 @@ export type ModelSourceItem = {
downloadUrl?: string;
isLocal?: boolean;
lastUpdatedMs?: number;
hide?: boolean;
};
const columns: TableColumnDefinition<ModelSourceItem>[] = [
@@ -142,7 +142,7 @@ const columns: TableColumnDefinition<ModelSourceItem>[] = [
{
item.isLocal &&
<ToolTipButton desc={t('Open Folder')} icon={<Folder20Regular />} onClick={() => {
OpenFileFolder(`./${manifest.localModelDir}/${item.name}`);
OpenFileFolder(`${commonStore.settings.customModelsPath}/${item.name}`);
}} />
}
{item.downloadUrl && !item.isLocal &&
@@ -151,7 +151,7 @@ const columns: TableColumnDefinition<ModelSourceItem>[] = [
navigate({ pathname: '/downloads' });
},
{ autoClose: 3000 });
AddToDownloadList(`./${manifest.localModelDir}/${item.name}`, item.downloadUrl!);
AddToDownloadList(`${commonStore.settings.customModelsPath}/${item.name}`, item.downloadUrl!);
}} />}
{item.url && <ToolTipButton desc={t('Open Url')} icon={<Open20Regular />} onClick={() => {
BrowserOpenURL(item.url!);
@@ -203,6 +203,7 @@ export const Models: FC = observer(() => {
<div className="overflow-y-auto overflow-x-hidden">
<DataGridBody<ModelSourceItem>>
{({ item, rowId }) => (
(!item.hide || item.isLocal) &&
<DataGridRow<ModelSourceItem> key={rowId}>
{({ renderCell }) => (
<DataGridCell>{renderCell(item)}</DataGridCell>

View File

@@ -1,6 +1,15 @@
import React, { FC } from 'react';
import React, { FC, useEffect, useRef } from 'react';
import { Page } from '../components/Page';
import { Dropdown, Input, Option, Switch } from '@fluentui/react-components';
import {
Accordion,
AccordionHeader,
AccordionItem,
AccordionPanel,
Dropdown,
Input,
Option,
Switch
} from '@fluentui/react-components';
import { Labeled } from '../components/Labeled';
import commonStore from '../stores/commonStore';
import { observer } from 'mobx-react-lite';
@@ -15,16 +24,24 @@ export const Languages = {
export type Language = keyof typeof Languages;
export type SettingsType = {
language: Language,
language: Language
darkMode: boolean
autoUpdatesCheck: boolean
giteeUpdatesSource: boolean
cnMirror: boolean
host: string
customModelsPath: string
customPythonPath: string
}
export const Settings: FC = observer(() => {
const { t, i18n } = useTranslation();
const advancedHeaderRef = useRef<HTMLDivElement>(null);
useEffect(() => {
if (advancedHeaderRef.current)
(advancedHeaderRef.current.firstElementChild as HTMLElement).style.padding = '0';
}, []);
return (
<Page title={t('Settings')} content={
@@ -88,14 +105,41 @@ export const Settings: FC = observer(() => {
}} />
} />
}
<Labeled label={t('API Host')} flex spaceBetween content={
<Input value={commonStore.settings.host}
<Labeled label={t('Allow external access to the API (service must be restarted)')} flex spaceBetween content={
<Switch checked={commonStore.settings.host !== '127.0.0.1'}
onChange={(e, data) => {
commonStore.setSettings({
host: data.value
host: data.checked ? '0.0.0.0' : '127.0.0.1'
});
}} />
} />
<Accordion collapsible>
<AccordionItem value="1">
<AccordionHeader ref={advancedHeaderRef} size="large">{t('Advanced')}</AccordionHeader>
<AccordionPanel>
<div className="flex flex-col gap-2 overflow-hidden">
<Labeled label={t('Custom Models Path')}
content={
<Input className="grow" placeholder="./models" value={commonStore.settings.customModelsPath}
onChange={(e, data) => {
commonStore.setSettings({
customModelsPath: data.value
});
}} />
} />
<Labeled label={t('Custom Python Path')}
content={
<Input className="grow" placeholder="./py310/python" value={commonStore.settings.customPythonPath}
onChange={(e, data) => {
commonStore.setSettings({
customPythonPath: data.value
});
}} />
} />
</div>
</AccordionPanel>
</AccordionItem>
</Accordion>
</div>
} />
);

View File

@@ -1,9 +1,10 @@
import commonStore from './stores/commonStore';
import { ReadJson } from '../wailsjs/go/backend_golang/App';
import { Cache, checkUpdate, downloadProgramFiles, LocalConfig, refreshModels, saveCache } from './utils';
import commonStore, { Platform } from './stores/commonStore';
import { GetPlatform, ReadJson } from '../wailsjs/go/backend_golang/App';
import { Cache, checkUpdate, downloadProgramFiles, LocalConfig, refreshModels } from './utils';
import { getStatus } from './apis';
import { EventsOn } from '../wailsjs/runtime';
import { defaultModelConfigs } from './pages/Configs';
import manifest from '../../manifest.json';
export async function startup() {
downloadProgramFiles();
@@ -12,10 +13,11 @@ export async function startup() {
commonStore.setDownloadList(data);
});
initCache().then(initRemoteText);
await GetPlatform().then(p => commonStore.setPlatform(p as Platform));
await initConfig();
initCache().then(initRemoteText); // depends on config customModelsPath
if (commonStore.settings.autoUpdatesCheck) // depends on config settings
checkUpdate();
@@ -28,11 +30,13 @@ export async function startup() {
async function initRemoteText() {
await fetch('https://cdn.jsdelivr.net/gh/josstorer/RWKV-Runner@master/manifest.json', { cache: 'no-cache' })
.then(r => r.json()).then((data) => {
if (data.introduction)
commonStore.setIntroduction(data.introduction);
if (data.about)
commonStore.setAbout(data.about);
}).then(saveCache);
if (data.version > manifest.version) {
if (data.introduction)
commonStore.setIntroduction(data.introduction);
if (data.about)
commonStore.setAbout(data.about);
}
});
}
async function initConfig() {
@@ -56,10 +60,6 @@ async function initConfig() {
async function initCache() {
await ReadJson('cache.json').then((cacheData: Cache) => {
if (cacheData.introduction)
commonStore.setIntroduction(cacheData.introduction);
if (cacheData.about)
commonStore.setAbout(cacheData.about);
if (cacheData.depComplete)
commonStore.setDepComplete(cacheData.depComplete);
}).catch(() => {

View File

@@ -25,6 +25,8 @@ export type Status = {
device_name: string;
}
export type Platform = 'windows' | 'darwin' | 'linux';
class CommonStore {
// global
status: Status = {
@@ -33,6 +35,7 @@ class CommonStore {
device_name: 'CPU'
};
depComplete: boolean = false;
platform: Platform = 'windows';
// home
introduction: IntroductionContent = manifest.introduction;
// chat
@@ -56,7 +59,9 @@ class CommonStore {
autoUpdatesCheck: true,
giteeUpdatesSource: getUserLanguage() === 'zh',
cnMirror: getUserLanguage() === 'zh',
host: '127.0.0.1'
host: '127.0.0.1',
customModelsPath: './models',
customPythonPath: ''
};
// about
about: AboutContent = manifest.about;
@@ -86,14 +91,16 @@ class CommonStore {
};
setModelConfigs = (configs: ModelConfig[], saveConfig: boolean = true) => {
this.modelConfigs = configs;
this.modelConfigs = JSON.parse(JSON.stringify(configs)); // deep copy
if (saveConfig)
saveConfigs();
};
createModelConfig = (config: ModelConfig = defaultModelConfigs[0], saveConfig: boolean = true) => {
if (config.name === defaultModelConfigs[0].name)
if (config.name === defaultModelConfigs[0].name) {
config = JSON.parse(JSON.stringify(config)); // deep copy
config.name = new Date().toLocaleString();
}
this.modelConfigs.push(config);
if (saveConfig)
saveConfigs();
@@ -168,6 +175,10 @@ class CommonStore {
setCompletionGenerating(value: boolean) {
this.completionGenerating = value;
}
setPlatform(value: Platform) {
this.platform = value;
}
}
export default new CommonStore();

View File

@@ -1,8 +1,8 @@
import {
AddToDownloadList,
DeleteFile,
FileExists,
ListDirFiles,
ReadFileInfo,
ReadJson,
SaveJson,
UpdateApp
@@ -16,13 +16,9 @@ import { Button } from '@fluentui/react-components';
import { Language, Languages, SettingsType } from '../pages/Settings';
import { ModelSourceItem } from '../pages/Models';
import { ModelConfig, ModelParameters } from '../pages/Configs';
import { IntroductionContent } from '../pages/Home';
import { AboutContent } from '../pages/About';
export type Cache = {
models: ModelSourceItem[]
introduction: IntroductionContent,
about: AboutContent
depComplete: boolean
}
@@ -55,7 +51,7 @@ export async function refreshLocalModels(cache: { models: ModelSourceItem[] }, f
if (filter)
cache.models = cache.models.filter(m => !m.isLocal); //TODO BUG cause local but in manifest files to be removed, so currently cache is disabled
await ListDirFiles(manifest.localModelDir).then((data) => {
await ListDirFiles(commonStore.settings.customModelsPath).then((data) => {
cache.models.push(...data.flatMap(d => {
if (!d.isDir && d.name.endsWith('.pth'))
return [{
@@ -131,12 +127,23 @@ export const getStrategy = (modelConfig: ModelConfig | undefined = undefined) =>
if (modelConfig) params = modelConfig.modelParameters;
else params = commonStore.getCurrentModelConfig().modelParameters;
let strategy = '';
strategy += (params.device === 'CPU' ? 'cpu' : 'cuda') + ' ';
strategy += params.device === 'CPU' ? 'fp32' : (params.precision === 'fp16' ? 'fp16' : params.precision === 'int8' ? 'fp16i8' : 'fp32');
if (params.storedLayers < params.maxStoredLayers)
strategy += ` *${params.storedLayers}+`;
if (params.enableHighPrecisionForLastLayer)
strategy += ' -> cpu fp32 *1';
switch (params.device) {
case 'CPU':
strategy += 'cpu ';
strategy += params.precision === 'int8' ? 'fp32i8' : 'fp32';
break;
case 'CUDA':
strategy += 'cuda ';
strategy += params.precision === 'fp16' ? 'fp16' : params.precision === 'int8' ? 'fp16i8' : 'fp32';
if (params.storedLayers < params.maxStoredLayers)
strategy += ` *${params.storedLayers}+`;
if (params.enableHighPrecisionForLastLayer)
strategy += ' -> cpu fp32 *1';
break;
case 'Custom':
strategy = params.customStrategy || '';
break;
}
return strategy;
};
@@ -153,8 +160,6 @@ export const saveConfigs = async () => {
export const saveCache = async () => {
const data: Cache = {
models: commonStore.modelSourceList,
introduction: commonStore.introduction,
about: commonStore.about,
depComplete: commonStore.depComplete
};
return SaveJson('cache.json', data);
@@ -175,16 +180,20 @@ export function isSystemLightMode() {
export function downloadProgramFiles() {
manifest.programFiles.forEach(({ url, path }) => {
FileExists(path).then(exists => {
if (!exists && url)
AddToDownloadList(path, url.replace('@master', '@v' + manifest.version));
});
if (path)
ReadFileInfo(path).then(info => {
if (info.size == 0 && url)
AddToDownloadList(path, url.replace('@master', '@v' + manifest.version));
}).catch(() => {
if (url)
AddToDownloadList(path, url.replace('@master', '@v' + manifest.version));
});
});
}
export function forceDownloadProgramFiles() {
manifest.programFiles.forEach(({ url, path }) => {
if (url)
if (path && url)
AddToDownloadList(path, url.replace('@master', '@v' + manifest.version));
});
}
@@ -212,8 +221,7 @@ export function bytesToKb(size: number) {
}
export async function checkUpdate(notifyEvenLatest: boolean = false) {
let updateUrl = '';
await fetch(!commonStore.settings.giteeUpdatesSource ?
fetch(!commonStore.settings.giteeUpdatesSource ?
'https://api.github.com/repos/josstorer/RWKV-Runner/releases/latest' :
'https://gitee.com/api/v5/repos/josc146/RWKV-Runner/releases/latest'
).then((r) => {
@@ -222,28 +230,45 @@ export async function checkUpdate(notifyEvenLatest: boolean = false) {
if (data.tag_name) {
const versionTag = data.tag_name;
if (versionTag.replace('v', '') > manifest.version) {
updateUrl = !commonStore.settings.giteeUpdatesSource ?
`https://github.com/josStorer/RWKV-Runner/releases/download/${versionTag}/RWKV-Runner_windows_x64.exe` :
`https://gitee.com/josc146/RWKV-Runner/releases/download/${versionTag}/RWKV-Runner_windows_x64.exe`;
toastWithButton(t('New Version Available') + ': ' + versionTag, t('Update'), () => {
DeleteFile('cache.json');
toast(t('Downloading update, please wait. If it is not completed, please manually download the program from GitHub and replace the original program.'), {
type: 'info',
position: 'bottom-left',
autoClose: 10000
});
setTimeout(() => {
UpdateApp(updateUrl).catch((e) => {
toast(t('Update Error') + ' - ' + e.message || e, {
type: 'error',
position: 'bottom-left',
autoClose: false
});
const verifyUrl = !commonStore.settings.giteeUpdatesSource ?
`https://api.github.com/repos/josstorer/RWKV-Runner/releases/tags/${versionTag}` :
`https://gitee.com/api/v5/repos/josc146/RWKV-Runner/releases/tags/${versionTag}`;
fetch(verifyUrl).then((r) => {
if (r.ok) {
r.json().then((data) => {
if (data.assets && data.assets.length > 0) {
const asset = data.assets.find((a: any) => a.name.toLowerCase().includes(commonStore.platform.toLowerCase()));
if (asset) {
const updateUrl = !commonStore.settings.giteeUpdatesSource ?
`https://github.com/josStorer/RWKV-Runner/releases/download/${versionTag}/${asset.name}` :
`https://gitee.com/josc146/RWKV-Runner/releases/download/${versionTag}/${asset.name}`;
toastWithButton(t('New Version Available') + ': ' + versionTag, t('Update'), () => {
DeleteFile('cache.json');
toast(t('Downloading update, please wait. If it is not completed, please manually download the program from GitHub and replace the original program.'), {
type: 'info',
position: 'bottom-left',
autoClose: 10000
});
setTimeout(() => {
UpdateApp(updateUrl).catch((e) => {
toast(t('Update Error') + ' - ' + e.message || e, {
type: 'error',
position: 'bottom-left',
autoClose: false
});
});
}, 500);
}, {
autoClose: false,
position: 'bottom-left'
});
}
}
});
}, 500);
}, {
autoClose: false,
position: 'bottom-left'
} else {
throw new Error('Verify response was not ok.');
}
});
} else {
if (notifyEvenLatest) {
@@ -261,7 +286,6 @@ export async function checkUpdate(notifyEvenLatest: boolean = false) {
).catch((e) => {
toast(t('Updates Check Error') + ' - ' + e.message || e, { type: 'error', position: 'bottom-left' });
});
return updateUrl;
}
export function toastWithButton(text: string, buttonText: string, onClickButton: () => void, options?: ToastOptions) {
@@ -285,7 +309,7 @@ export function toastWithButton(text: string, buttonText: string, onClickButton:
}
export function getSupportedCustomCudaFile() {
if ([' 10', ' 16', ' 20', ' 30'].some(v => commonStore.status.device_name.includes(v)))
if ([' 10', ' 16', ' 20', ' 30', 'P40', 'P104', 'P106'].some(v => commonStore.status.device_name.includes(v)))
return './backend-python/wkv_cuda_utils/wkv_cuda10_30.pyd';
else if ([' 40'].some(v => commonStore.status.device_name.includes(v)))
return './backend-python/wkv_cuda_utils/wkv_cuda40.pyd';

View File

@@ -6,13 +6,13 @@ export function AddToDownloadList(arg1:string,arg2:string):Promise<void>;
export function ContinueDownload(arg1:string):Promise<void>;
export function ConvertModel(arg1:string,arg2:string,arg3:string):Promise<string>;
export function ConvertModel(arg1:string,arg2:string,arg3:string,arg4:string):Promise<string>;
export function CopyFile(arg1:string,arg2:string):Promise<void>;
export function DeleteFile(arg1:string):Promise<void>;
export function DepCheck():Promise<void>;
export function DepCheck(arg1:string):Promise<void>;
export function DownloadFile(arg1:string,arg2:string):Promise<void>;
@@ -20,7 +20,7 @@ export function FileExists(arg1:string):Promise<boolean>;
export function GetPlatform():Promise<string>;
export function InstallPyDep(arg1:boolean):Promise<string>;
export function InstallPyDep(arg1:string,arg2:boolean):Promise<string>;
export function ListDirFiles(arg1:string):Promise<Array<backend_golang.FileInfo>>;
@@ -34,6 +34,6 @@ export function ReadJson(arg1:string):Promise<any>;
export function SaveJson(arg1:string,arg2:any):Promise<void>;
export function StartServer(arg1:number,arg2:string):Promise<string>;
export function StartServer(arg1:string,arg2:number,arg3:string):Promise<string>;
export function UpdateApp(arg1:string):Promise<boolean>;

View File

@@ -10,8 +10,8 @@ export function ContinueDownload(arg1) {
return window['go']['backend_golang']['App']['ContinueDownload'](arg1);
}
export function ConvertModel(arg1, arg2, arg3) {
return window['go']['backend_golang']['App']['ConvertModel'](arg1, arg2, arg3);
export function ConvertModel(arg1, arg2, arg3, arg4) {
return window['go']['backend_golang']['App']['ConvertModel'](arg1, arg2, arg3, arg4);
}
export function CopyFile(arg1, arg2) {
@@ -22,8 +22,8 @@ export function DeleteFile(arg1) {
return window['go']['backend_golang']['App']['DeleteFile'](arg1);
}
export function DepCheck() {
return window['go']['backend_golang']['App']['DepCheck']();
export function DepCheck(arg1) {
return window['go']['backend_golang']['App']['DepCheck'](arg1);
}
export function DownloadFile(arg1, arg2) {
@@ -38,8 +38,8 @@ export function GetPlatform() {
return window['go']['backend_golang']['App']['GetPlatform']();
}
export function InstallPyDep(arg1) {
return window['go']['backend_golang']['App']['InstallPyDep'](arg1);
export function InstallPyDep(arg1, arg2) {
return window['go']['backend_golang']['App']['InstallPyDep'](arg1, arg2);
}
export function ListDirFiles(arg1) {
@@ -66,8 +66,8 @@ export function SaveJson(arg1, arg2) {
return window['go']['backend_golang']['App']['SaveJson'](arg1, arg2);
}
export function StartServer(arg1, arg2) {
return window['go']['backend_golang']['App']['StartServer'](arg1, arg2);
export function StartServer(arg1, arg2, arg3) {
return window['go']['backend_golang']['App']['StartServer'](arg1, arg2, arg3);
}
export function UpdateApp(arg1) {

12
main.go
View File

@@ -2,6 +2,8 @@ package main
import (
"embed"
"runtime/debug"
"strings"
backend "rwkv-runner/backend-golang"
@@ -23,9 +25,11 @@ var cyacInfo embed.FS
var py embed.FS
func main() {
go backend.CopyEmbed(cyac)
go backend.CopyEmbed(cyacInfo)
go backend.CopyEmbed(py)
if buildInfo, ok := debug.ReadBuildInfo(); !ok || strings.Contains(buildInfo.String(), "-ldflags") {
backend.CopyEmbed(cyac)
backend.CopyEmbed(cyacInfo)
backend.CopyEmbed(py)
}
// Create an instance of the app structure
app := backend.NewApp()
@@ -34,7 +38,7 @@ func main() {
err := wails.Run(&options.App{
Title: "RWKV-Runner",
Width: 1024,
Height: 640,
Height: 680,
MinWidth: 375,
MinHeight: 640,
AssetServer: &assetserver.Options{

View File

@@ -1,5 +1,5 @@
{
"version": "1.1.0",
"version": "1.1.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的优点结合起来 - 高性能、快速推理、节省显存、快速训练、“无限”上下文长度以及免费的语句嵌入(使用最终隐藏状态)。"
@@ -8,22 +8,25 @@
"en": "<div align=\"center\">\n\nProject Source Code:\nhttps://github.com/josStorer/RWKV-Runner\nAuthor: [@josStorer](https://github.com/josStorer)\nFAQs: https://github.com/josStorer/RWKV-Runner/wiki/FAQs\n\nRelated Repositories:\nRWKV-4-Raven: https://huggingface.co/BlinkDL/rwkv-4-raven/tree/main\nChatRWKV: https://github.com/BlinkDL/ChatRWKV\nRWKV-LM: https://github.com/BlinkDL/RWKV-LM\n\n</div>",
"zh": "<div align=\"center\">\n\n本项目源码:\nhttps://github.com/josStorer/RWKV-Runner\n作者: [@josStorer](https://github.com/josStorer)\n演示与常见问题说明视频: https://www.bilibili.com/video/BV1hM4y1v76R\n疑难解答: https://www.bilibili.com/read/cv23921171\n\n相关仓库:\nRWKV-4-Raven: https://huggingface.co/BlinkDL/rwkv-4-raven/tree/main\nChatRWKV: https://github.com/BlinkDL/ChatRWKV\nRWKV-LM: https://github.com/BlinkDL/RWKV-LM\n\n</div>"
},
"localModelDir": "models",
"programFiles": [
{
"url": "https://cdn.jsdelivr.net/gh/josstorer/RWKV-Runner@master/backend-python/rwkv_pip/.rwkv_vocab_v20230424.txt",
"path": "backend-python/rwkv_pip/rwkv_vocab_v20230424.txt"
},
{
"url": "https://cdn.jsdelivr.net/gh/josstorer/RWKV-Runner@master/backend-python/rwkv_pip/.20B_tokenizer.json",
"path": "backend-python/rwkv_pip/20B_tokenizer.json"
},
{
"url": "https://cdn.jsdelivr.net/gh/pypa/get-pip/public/get-pip.py",
"path": "backend-python/get-pip.py"
"url": "",
"path": ""
}
],
"models": [
{
"name": "RWKV-4-Raven-3B-v12-Eng49%-Chn49%-Jpn1%-Other1%-20230527-ctx4096.pth",
"desc": {
"en": "Chinese 3B v12",
"zh": "中文 3B v12"
},
"size": 5969345330,
"SHA256": "c0abb4b745ba3523b9d8b3e1293110867ee55b1ef3dc8c122212f78396755721",
"lastUpdated": "2023-05-28T11:51:12",
"url": "https://huggingface.co/BlinkDL/rwkv-4-raven/blob/main/RWKV-4-Raven-3B-v12-Eng49%25-Chn49%25-Jpn1%25-Other1%25-20230527-ctx4096.pth",
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-raven/resolve/main/RWKV-4-Raven-3B-v12-Eng49%25-Chn49%25-Jpn1%25-Other1%25-20230527-ctx4096.pth"
},
{
"name": "RWKV-4-Raven-3B-v11-Eng99%-Other1%-20230425-ctx4096.pth",
"desc": {
@@ -34,7 +37,8 @@
"SHA256": "982ad3d794efe58992db23c6d694c57a9e62d54718264ec6d6acfae5eb0eea12",
"lastUpdated": "2023-04-26T14:27:55",
"url": "https://huggingface.co/BlinkDL/rwkv-4-raven/blob/main/RWKV-4-Raven-3B-v11-Eng99%25-Other1%25-20230425-ctx4096.pth",
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-raven/resolve/main/RWKV-4-Raven-3B-v11-Eng99%25-Other1%25-20230425-ctx4096.pth"
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-raven/resolve/main/RWKV-4-Raven-3B-v11-Eng99%25-Other1%25-20230425-ctx4096.pth",
"hide": true
},
{
"name": "RWKV-4-Raven-3B-v12-Eng98%-Other2%-20230520-ctx4096.pth",
@@ -58,7 +62,8 @@
"SHA256": "7aaf40bb3d440a949db3a146b0a5bbb3e925942b496775b51f5630a582fc236d",
"lastUpdated": "2023-04-24T07:48:55",
"url": "https://huggingface.co/BlinkDL/rwkv-4-raven/blob/main/RWKV-4-Raven-7B-v10x-Eng49%25-Chn50%25-Other1%25-20230423-ctx4096.pth",
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-raven/resolve/main/RWKV-4-Raven-7B-v10x-Eng49%25-Chn50%25-Other1%25-20230423-ctx4096.pth"
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-raven/resolve/main/RWKV-4-Raven-7B-v10x-Eng49%25-Chn50%25-Other1%25-20230423-ctx4096.pth",
"hide": true
},
{
"name": "RWKV-4-Raven-7B-v11-Eng49%-Chn49%-Jpn1%-Other1%-20230430-ctx8192.pth",
@@ -70,7 +75,20 @@
"SHA256": "9e67a74964abcb4463711e447ddf47735561d7b40592d2d02b29d2e796a4fd14",
"lastUpdated": "2023-04-30T14:35:59",
"url": "https://huggingface.co/BlinkDL/rwkv-4-raven/blob/main/RWKV-4-Raven-7B-v11-Eng49%25-Chn49%25-Jpn1%25-Other1%25-20230430-ctx8192.pth",
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-raven/resolve/main/RWKV-4-Raven-7B-v11-Eng49%25-Chn49%25-Jpn1%25-Other1%25-20230430-ctx8192.pth"
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-raven/resolve/main/RWKV-4-Raven-7B-v11-Eng49%25-Chn49%25-Jpn1%25-Other1%25-20230430-ctx8192.pth",
"hide": true
},
{
"name": "RWKV-4-Raven-7B-v12-Eng49%-Chn49%-Jpn1%-Other1%-20230530-ctx8192.pth",
"desc": {
"en": "Chinese 7B v12",
"zh": "中文 7B v12"
},
"size": 14785389874,
"SHA256": "6d4a089ff36d5d9d96b669d425fc5e4e3959cab426535b52e2364df08f58b407",
"lastUpdated": "2023-05-30T23:16:12",
"url": "https://huggingface.co/BlinkDL/rwkv-4-raven/blob/main/RWKV-4-Raven-7B-v12-Eng49%25-Chn49%25-Jpn1%25-Other1%25-20230530-ctx8192.pth",
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-raven/resolve/main/RWKV-4-Raven-7B-v12-Eng49%25-Chn49%25-Jpn1%25-Other1%25-20230530-ctx8192.pth"
},
{
"name": "RWKV-4-Raven-7B-v12-Eng98%-Other2%-20230521-ctx8192.pth",
@@ -94,7 +112,8 @@
"SHA256": "f00d5c75b453f2b20ad875fb5a324564c34024eea25a015f5eb441e4f364c3fe",
"lastUpdated": "2023-04-29T11:44:32",
"url": "https://huggingface.co/BlinkDL/rwkv-4-raven/blob/main/RWKV-4-Raven-7B-v11x-Eng99%25-Other1%25-20230429-ctx8192.pth",
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-raven/resolve/main/RWKV-4-Raven-7B-v11x-Eng99%25-Other1%25-20230429-ctx8192.pth"
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-raven/resolve/main/RWKV-4-Raven-7B-v11x-Eng99%25-Other1%25-20230429-ctx8192.pth",
"hide": true
},
{
"name": "RWKV-4-Raven-1B5-v11-Eng99%-Other1%-20230425-ctx4096.pth",
@@ -106,7 +125,8 @@
"SHA256": "4ac715aecc5b1c90e8e37eebb8163392699066ec23b18144416e91cb4e78675a",
"lastUpdated": "2023-04-26T14:27:55",
"url": "https://huggingface.co/BlinkDL/rwkv-4-raven/blob/main/RWKV-4-Raven-1B5-v11-Eng99%25-Other1%25-20230425-ctx4096.pth",
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-raven/resolve/main/RWKV-4-Raven-1B5-v11-Eng99%25-Other1%25-20230425-ctx4096.pth"
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-raven/resolve/main/RWKV-4-Raven-1B5-v11-Eng99%25-Other1%25-20230425-ctx4096.pth",
"hide": true
},
{
"name": "RWKV-4-Raven-1B5-v12-Eng98%-Other2%-20230520-ctx4096.pth",
@@ -130,7 +150,8 @@
"SHA256": "af12300d9875e0e166c23d6e9b20928db435073060bf1d36f874060de92ada98",
"lastUpdated": "2023-04-29T11:51:51",
"url": "https://huggingface.co/BlinkDL/rwkv-4-raven/blob/main/RWKV-4-Raven-3B-v11-Eng49%25-Chn49%25-Jpn1%25-Other1%25-20230429-ctx4096.pth",
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-raven/resolve/main/RWKV-4-Raven-3B-v11-Eng49%25-Chn49%25-Jpn1%25-Other1%25-20230429-ctx4096.pth"
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-raven/resolve/main/RWKV-4-Raven-3B-v11-Eng49%25-Chn49%25-Jpn1%25-Other1%25-20230429-ctx4096.pth",
"hide": true
},
{
"name": "RWKV-4-Raven-14B-v12-Eng98%-Other2%-20230523-ctx8192.pth",
@@ -154,13 +175,26 @@
"SHA256": "c4bc72406c3c62613e8e2592e8d07ac045f8a88381c728f8eb60af890e299f4d",
"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",
"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",
"hide": true
},
{
"name": "RWKV-4-Novel-7B-v1-ChnEng-ChnPro-20230410-ctx4096.pth",
"desc": {
"en": "Professional Writer 7B v1",
"zh": "专业写作 7B v1"
},
"size": 14785389618,
"SHA256": "cd40b661930dea46c0f930c51d99cef6b484fe3d641388981dee5a0c68e2b1c7",
"lastUpdated": "2023-04-10T13:55:52",
"url": "https://huggingface.co/BlinkDL/rwkv-4-novel/blob/main/RWKV-4-Novel-7B-v1-ChnEng-ChnPro-20230410-ctx4096.pth",
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-novel/resolve/main/RWKV-4-Novel-7B-v1-ChnEng-ChnPro-20230410-ctx4096.pth"
},
{
"name": "RWKV-4-Novel-7B-v1-Chn-20230426-ctx8192.pth",
"desc": {
"en": "Chinese Novel 7B v1",
"zh": "中文小说 7B v1"
"en": "Popular Writer 7B v1",
"zh": "通俗写作 7B v1"
},
"size": 14785389864,
"SHA256": "5fced44febdf80d303250eef9c020f087abded43aaecc8caaea8a9e7f1fb771e",
@@ -171,8 +205,8 @@
{
"name": "RWKV-4-Novel-3B-v1-Chn-20230412-ctx4096.pth",
"desc": {
"en": "Chinese Novel 3B v1",
"zh": "中文小说 3B v1"
"en": "Popular Writer 3B v1",
"zh": "通俗写作 3B v1"
},
"size": 5969345064,
"SHA256": "c41e0af2cbc66e94121377680e8224a1504fac6c9ea620c395f0a79281db26e7",
@@ -183,8 +217,8 @@
{
"name": "RWKV-4-Novel-3B-v1-ChnEng-20230412-ctx4096.pth",
"desc": {
"en": "English Novel 3B v1",
"zh": "英文小说 3B v1"
"en": "Balanced Writer 3B v1",
"zh": "均衡写作 3B v1"
},
"size": 5969345064,
"SHA256": "283c6e6fa10c52a93e9a01d9630f288473267ea152a49c6579b5c0427bdc9c61",
@@ -195,8 +229,8 @@
{
"name": "RWKV-4-Novel-7B-v1-ChnEng-20230426-ctx8192.pth",
"desc": {
"en": "English Novel 7B v1",
"zh": "英文小说 7B v1"
"en": "Balanced Writer 7B v1",
"zh": "均衡写作 7B v1"
},
"size": 14785389864,
"SHA256": "bd08c75a296bd193dcfadb993fe06d7f9dd91ca3385231f24c592c89d25cd596",
@@ -204,17 +238,65 @@
"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"
},
{
"name": "RWKV-4-World-7B-v1-OnlyForTest_30%_trained-20230529-ctx4096.pth",
"desc": {
"en": "100+ Languages 7B v1 Test",
"zh": "100+ 语言 7B v1 测试"
},
"size": 15035393581,
"SHA256": "05f91562b2ae8b025226e40b3fb536d6f8eb3c142ac899c0808ee1c9dc189ec4",
"lastUpdated": "2023-05-29T13:25:53",
"url": "https://huggingface.co/BlinkDL/rwkv-4-world/blob/main/RWKV-4-World-7B-v1-OnlyForTest_30%25_trained-20230529-ctx4096.pth",
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-7B-v1-OnlyForTest_30%25_trained-20230529-ctx4096.pth"
},
{
"name": "RWKV-4-World-0.1B-v1-20230520-ctx4096.pth",
"desc": {
"en": "+100 Languages 0.1B v1",
"zh": "+100语言 0.1B v1"
"en": "100+ Languages 0.1B v1",
"zh": "100+ 语言 0.1B v1"
},
"size": 385594610,
"SHA256": "a10ef99df2a8f8a6801edf4fc92a9c49bedd63dcb900d3e5667a2136b3d671e7",
"lastUpdated": "2023-05-25T09:21:27",
"url": "https://huggingface.co/BlinkDL/rwkv-4-world/blob/main/RWKV-4-World-0.1B-v1-20230520-ctx4096.pth",
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-0.1B-v1-20230520-ctx4096.pth"
},
{
"name": "RWKV-4-World-1.5B-v1-OnlyForTest_57%_trained-20230529-ctx4096.pth",
"desc": {
"en": "100+ Languages 1.5B v1 Test",
"zh": "100+ 语言 1.5B v1 测试"
},
"size": 3155281581,
"SHA256": "ac36770931776c5aa179690918c9a3b0b5f4ebe3301ea3574a7e182209778788",
"lastUpdated": "2023-05-29T13:25:53",
"url": "https://huggingface.co/BlinkDL/rwkv-4-world/blob/main/RWKV-4-World-1.5B-v1-OnlyForTest_57%25_trained-20230529-ctx4096.pth",
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-1.5B-v1-OnlyForTest_57%25_trained-20230529-ctx4096.pth"
},
{
"name": "RWKV-4-World-3B-v1-OnlyForTest_35%_trained-20230529-ctx4096.pth",
"desc": {
"en": "100+ Languages 3B v1 Test",
"zh": "100+ 语言 3B v1 测试"
},
"size": 6125597613,
"SHA256": "e4ee6e91a80d56de43bc79841f3a8be3b7b215d7d9788f79c467b9b1f7f03cb8",
"lastUpdated": "2023-05-29T13:25:53",
"url": "https://huggingface.co/BlinkDL/rwkv-4-world/blob/main/RWKV-4-World-3B-v1-OnlyForTest_35%25_trained-20230529-ctx4096.pth",
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-3B-v1-OnlyForTest_35%25_trained-20230529-ctx4096.pth"
},
{
"name": "RWKV-4-World-0.4B-v1-20230529-ctx4096.pth",
"desc": {
"en": "100+ Languages 0.4B v1",
"zh": "100+ 语言 0.4B v1"
},
"size": 923362866,
"SHA256": "4b4a2733cf5e5dc97dd62106f391d99895d16b11c5ccd10c89f28c52067a4919",
"lastUpdated": "2023-05-29T13:25:53",
"url": "https://huggingface.co/BlinkDL/rwkv-4-world/blob/main/RWKV-4-World-0.4B-v1-20230529-ctx4096.pth",
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-0.4B-v1-20230529-ctx4096.pth"
}
]
}

6
vendor.yml Normal file
View File

@@ -0,0 +1,6 @@
- ^backend-python/rwkv_pip/
- ^backend-python/wkv_cuda_utils/
- ^backend-python/get-pip\.py
- ^backend-python/convert_model\.py
- ^build/
- ^frontend/wailsjs/