Compare commits
61 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
87e1daa733 | ||
|
|
f5900179e0 | ||
|
|
51e162970e | ||
|
|
0b339ad0f6 | ||
|
|
60693d6a29 | ||
|
|
eea53a6e9e | ||
|
|
8a19181a38 | ||
|
|
94d835c7ae | ||
|
|
d9e25ad69f | ||
|
|
75244fbd8b | ||
|
|
5ce84edc3d | ||
|
|
1c683087f4 | ||
|
|
85a3b39cbc | ||
|
|
cc6c24f0c3 | ||
|
|
c733b6419c | ||
|
|
c853c5b60b | ||
|
|
053a08f5b7 | ||
|
|
f7227cd1c1 | ||
|
|
861e245062 | ||
|
|
8f0fc7db56 | ||
|
|
3dd06fa70e | ||
|
|
86a855e7bc | ||
|
|
b3110d4ad8 | ||
|
|
602004ad34 | ||
|
|
a8b4f0bb7e | ||
|
|
24cc8be085 | ||
|
|
a96d7aef8d | ||
|
|
cbe299583b | ||
|
|
68c70a362b | ||
|
|
a78c346371 | ||
|
|
102763b94d | ||
|
|
ad65765ba8 | ||
|
|
d04fd7cb87 | ||
|
|
b398cbb591 | ||
|
|
19b97e985c | ||
|
|
93bf74a320 | ||
|
|
7daae23bbb | ||
|
|
0d0a3f15cc | ||
|
|
04fbb38861 | ||
|
|
d666c6032b | ||
|
|
93e8660d69 | ||
|
|
e687cf02bb | ||
|
|
e858f1477a | ||
|
|
a2062ae9cc | ||
|
|
34112c79c7 | ||
|
|
b625b8a6d1 | ||
|
|
14a13d5768 | ||
|
|
7ce464ecda | ||
|
|
2c1f89383f | ||
|
|
e666c50f77 | ||
|
|
1b441752b0 | ||
|
|
e01897b24d | ||
|
|
6146d910b4 | ||
|
|
0063c171f3 | ||
|
|
bea3c29c1c | ||
|
|
5f543c2545 | ||
|
|
177b2c54d9 | ||
|
|
645e8e2f44 | ||
|
|
f2d0dda2ff | ||
|
|
3a449e7b46 | ||
|
|
18d2ecb7a7 |
46
.github/workflows/release.yml
vendored
46
.github/workflows/release.yml
vendored
@@ -48,16 +48,13 @@ jobs:
|
||||
id: cp310
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
target: wasm32-unknown-unknown
|
||||
- uses: crazy-max/ghaction-chocolatey@v2
|
||||
with:
|
||||
args: install upx
|
||||
- run: |
|
||||
Start-BitsTransfer https://github.com/josStorer/LibreHardwareMonitor.Console/releases/download/v0.1.0/LibreHardwareMonitor.Console.zip ./LibreHardwareMonitor.Console.zip
|
||||
Start-BitsTransfer https://github.com/josStorer/ai00_rwkv_server/releases/latest/download/webgpu_server_windows_x86_64.exe ./backend-rust/webgpu_server.exe
|
||||
Start-BitsTransfer https://github.com/josStorer/web-rwkv-converter/releases/latest/download/web-rwkv-converter_windows_x86_64.exe ./backend-rust/web-rwkv-converter.exe
|
||||
Start-BitsTransfer https://github.com/josStorer/LibreHardwareMonitor.Console/releases/latest/download/LibreHardwareMonitor.Console.zip ./LibreHardwareMonitor.Console.zip
|
||||
Expand-Archive ./LibreHardwareMonitor.Console.zip -DestinationPath ./components/LibreHardwareMonitor.Console
|
||||
Start-BitsTransfer https://www.python.org/ftp/python/3.10.11/python-3.10.11-embed-amd64.zip ./python-3.10.11-embed-amd64.zip
|
||||
Expand-Archive ./python-3.10.11-embed-amd64.zip -DestinationPath ./py310
|
||||
@@ -67,11 +64,6 @@ jobs:
|
||||
Copy-Item -Path "${{ steps.cp310.outputs.python-path }}/../include" -Destination "py310/include" -Recurse
|
||||
Copy-Item -Path "${{ steps.cp310.outputs.python-path }}/../libs" -Destination "py310/libs" -Recurse
|
||||
./py310/python -m pip install cyac==1.9
|
||||
git clone https://github.com/josStorer/ai00_rwkv_server --depth=1
|
||||
cd ai00_rwkv_server
|
||||
cargo build --release
|
||||
mv ./target/release/ai00_server.exe ../backend-rust/webgpu_server.exe
|
||||
cd ..
|
||||
go install github.com/wailsapp/wails/v2/cmd/wails@latest
|
||||
(Get-Content -Path ./backend-golang/app.go) -replace "//go:custom_build windows ", "" | Set-Content -Path ./backend-golang/app.go
|
||||
make
|
||||
@@ -89,26 +81,16 @@ jobs:
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.20.5'
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
target: wasm32-unknown-unknown
|
||||
- run: |
|
||||
wget https://github.com/josStorer/ai00_rwkv_server/releases/latest/download/webgpu_server_linux_x86_64 -O ./backend-rust/webgpu_server
|
||||
wget https://github.com/josStorer/web-rwkv-converter/releases/latest/download/web-rwkv-converter_linux_x86_64 -O ./backend-rust/web-rwkv-converter
|
||||
sudo apt-get update
|
||||
sudo apt-get install upx
|
||||
sudo apt-get install build-essential libgtk-3-dev libwebkit2gtk-4.0-dev
|
||||
git clone https://github.com/josStorer/ai00_rwkv_server --depth=1
|
||||
cd ai00_rwkv_server
|
||||
sudo apt-get install libudev-dev
|
||||
sudo apt-get install libasound2-dev
|
||||
rustup target add x86_64-unknown-linux-gnu
|
||||
cargo build --release --target x86_64-unknown-linux-gnu
|
||||
mv ./target/x86_64-unknown-linux-gnu/release/ai00_server ../backend-rust/webgpu_server
|
||||
cd ..
|
||||
sudo apt-get install build-essential libgtk-3-dev libwebkit2gtk-4.0-dev libasound2-dev
|
||||
go install github.com/wailsapp/wails/v2/cmd/wails@latest
|
||||
rm ./backend-python/rwkv_pip/wkv_cuda.pyd
|
||||
rm ./backend-python/rwkv_pip/rwkv5.pyd
|
||||
rm ./backend-python/rwkv_pip/rwkv6.pyd
|
||||
rm ./backend-python/rwkv_pip/beta/wkv_cuda.pyd
|
||||
rm ./backend-python/get-pip.py
|
||||
make
|
||||
@@ -126,21 +108,13 @@ jobs:
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.20.5'
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
target: wasm32-unknown-unknown
|
||||
- run: |
|
||||
git clone https://github.com/josStorer/ai00_rwkv_server --depth=1
|
||||
cd ai00_rwkv_server
|
||||
rustup target add aarch64-apple-darwin
|
||||
cargo build --release --target aarch64-apple-darwin
|
||||
mv ./target/aarch64-apple-darwin/release/ai00_server ../backend-rust/webgpu_server
|
||||
cd ..
|
||||
wget https://github.com/josStorer/ai00_rwkv_server/releases/latest/download/webgpu_server_darwin_aarch64 -O ./backend-rust/webgpu_server
|
||||
wget https://github.com/josStorer/web-rwkv-converter/releases/latest/download/web-rwkv-converter_darwin_aarch64 -O ./backend-rust/web-rwkv-converter
|
||||
go install github.com/wailsapp/wails/v2/cmd/wails@latest
|
||||
rm ./backend-python/rwkv_pip/wkv_cuda.pyd
|
||||
rm ./backend-python/rwkv_pip/rwkv5.pyd
|
||||
rm ./backend-python/rwkv_pip/rwkv6.pyd
|
||||
rm ./backend-python/rwkv_pip/beta/wkv_cuda.pyd
|
||||
rm ./backend-python/get-pip.py
|
||||
make
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -18,7 +18,7 @@ __pycache__
|
||||
/cmd-helper.bat
|
||||
/install-py-dep.bat
|
||||
/backend-python/wkv_cuda
|
||||
/backend-python/rwkv5
|
||||
/backend-python/rwkv*
|
||||
*.exe
|
||||
*.old
|
||||
.DS_Store
|
||||
|
||||
@@ -1,23 +1,22 @@
|
||||
## Changes
|
||||
|
||||
### Changes
|
||||
|
||||
- add webgpu nf4
|
||||
- add sidePanel for Chat page
|
||||
- add hf-mirror for cn users
|
||||
- use local API when it's working, even if a custom API URL is provided
|
||||
- add rwkv API URL Option
|
||||
- macos: change default webgpu backend to aarch64-apple-darwin and fix the permission issue
|
||||
- strict default_stop
|
||||
- fix state_cache of deploy mode
|
||||
- fix a finetune bug
|
||||
- improve lazy loading ui
|
||||
- display lastModelName at the top (WorkHeader)
|
||||
- chores
|
||||
- add web-rwkv-converter (Safetensors Convert no longer depends on Python) (WebGPU Server 0.3.3)
|
||||
- model tags classifier
|
||||
- improve presets interaction
|
||||
- better state cache
|
||||
- better customCuda condition
|
||||
- add python-3.10.11-embed-amd64.zip cnMirror
|
||||
- always reset to activePreset
|
||||
- for devices that gpu is not supported, use cpu to merge lora
|
||||
- RWKV_RESCALE_LAYER 999 for music model
|
||||
- disable hashed assets
|
||||
- fix webWails undefined functions
|
||||
- fix damaged logo
|
||||
- chore
|
||||
|
||||
## Install
|
||||
|
||||
- Windows: https://github.com/josStorer/RWKV-Runner/blob/master/build/windows/Readme_Install.txt
|
||||
- MacOS: https://github.com/josStorer/RWKV-Runner/blob/master/build/darwin/Readme_Install.txt
|
||||
- Linux: https://github.com/josStorer/RWKV-Runner/blob/master/build/linux/Readme_Install.txt
|
||||
- Server-Deploy-Examples: https://github.com/josStorer/RWKV-Runner/tree/master/deploy-examples
|
||||
- Server-Deploy-Examples: https://github.com/josStorer/RWKV-Runner/tree/master/deploy-examples
|
||||
|
||||
6
Makefile
6
Makefile
@@ -8,15 +8,15 @@ endif
|
||||
|
||||
build-windows:
|
||||
@echo ---- build for windows
|
||||
wails build -upx -ldflags "-s -w" -platform windows/amd64
|
||||
wails build -upx -ldflags '-s -w -extldflags "-static"' -platform windows/amd64
|
||||
|
||||
build-macos:
|
||||
@echo ---- build for macos
|
||||
wails build -ldflags "-s -w" -platform darwin/universal
|
||||
wails build -ldflags '-s -w' -platform darwin/universal
|
||||
|
||||
build-linux:
|
||||
@echo ---- build for linux
|
||||
wails build -upx -ldflags "-s -w" -platform linux/amd64
|
||||
wails build -upx -ldflags '-s -w' -platform linux/amd64
|
||||
|
||||
build-web:
|
||||
@echo ---- build for web
|
||||
|
||||
85
README_ZH.md
85
README_ZH.md
@@ -20,7 +20,7 @@ API兼容的接口,这意味着一切ChatGPT客户端都是RWKV客户端。
|
||||
[![MacOS][MacOS-image]][MacOS-url]
|
||||
[![Linux][Linux-image]][Linux-url]
|
||||
|
||||
[视频演示](https://www.bilibili.com/video/BV1hM4y1v76R) | [疑难解答](https://www.bilibili.com/read/cv23921171) | [预览](#Preview) | [下载][download-url] | [懒人包](https://pan.baidu.com/s/1zdzZ_a0uM3gDqi6pXIZVAA?pwd=1111) | [服务器部署示例](https://github.com/josStorer/RWKV-Runner/tree/master/deploy-examples)
|
||||
[视频演示](https://www.bilibili.com/video/BV1hM4y1v76R) | [疑难解答](https://www.bilibili.com/read/cv23921171) | [预览](#Preview) | [下载][download-url] | [懒人包](https://pan.baidu.com/s/1zdzZ_a0uM3gDqi6pXIZVAA?pwd=1111) | [简明服务部署示例](#Simple-Deploy-Example) | [服务器部署示例](https://github.com/josStorer/RWKV-Runner/tree/master/deploy-examples) | [MIDI硬件输入](#MIDI-Input)
|
||||
|
||||
[license-image]: http://img.shields.io/badge/license-MIT-blue.svg
|
||||
|
||||
@@ -57,19 +57,45 @@ API兼容的接口,这意味着一切ChatGPT客户端都是RWKV客户端。
|
||||
## 功能
|
||||
|
||||
- RWKV模型管理,一键启动
|
||||
- 与OpenAI API完全兼容,一切ChatGPT客户端,都是RWKV客户端。启动模型后,打开 http://127.0.0.1:8000/docs 查看详细内容
|
||||
- 前后端分离,如果你不想使用客户端,也允许单独部署前端服务,或后端推理服务,或具有WebUI的后端推理服务。
|
||||
[简明服务部署示例](#Simple-Deploy-Example) | [服务器部署示例](https://github.com/josStorer/RWKV-Runner/tree/master/deploy-examples)
|
||||
- 与OpenAI API兼容,一切ChatGPT客户端,都是RWKV客户端。启动模型后,打开 http://127.0.0.1:8000/docs 查看API文档
|
||||
- 全自动依赖安装,你只需要一个轻巧的可执行程序
|
||||
- 预设了2G至32G显存的配置,几乎在各种电脑上工作良好
|
||||
- 自带用户友好的聊天和续写交互页面
|
||||
- 易于理解和操作的参数配置
|
||||
- 预设多级显存配置,几乎在各种电脑上工作良好。通过配置页面切换到WebGPU策略,还可以在AMD,Intel等显卡上运行
|
||||
- 自带用户友好的聊天,续写,作曲交互页面。支持聊天预设,附件上传,MIDI硬件输入及音轨编辑。
|
||||
[预览](#Preview) | [MIDI硬件输入](#MIDI-Input)
|
||||
- 内置WebUI选项,一键启动Web服务,共享硬件资源
|
||||
- 易于理解和操作的参数配置,及各类操作引导提示
|
||||
- 内置模型转换工具
|
||||
- 内置下载管理和远程模型检视
|
||||
- 内置一键LoRA微调
|
||||
- 也可用作 OpenAI ChatGPT 和 GPT Playground 客户端
|
||||
- 也可用作 OpenAI ChatGPT 和 GPT Playground 客户端 (在设置内填写API URL和API Key)
|
||||
- 多语言本地化
|
||||
- 主题切换
|
||||
- 自动更新
|
||||
|
||||
## Simple Deploy Example
|
||||
|
||||
```bash
|
||||
git clone https://github.com/josStorer/RWKV-Runner
|
||||
|
||||
# 然后
|
||||
cd RWKV-Runner
|
||||
python ./backend-python/main.py #后端推理服务已启动, 调用/switch-model载入模型, 参考API文档: http://127.0.0.1:8000/docs
|
||||
|
||||
# 或者
|
||||
cd RWKV-Runner/frontend
|
||||
npm ci
|
||||
npm run build #编译前端
|
||||
cd ..
|
||||
python ./backend-python/webui_server.py #单独启动前端服务
|
||||
# 或者
|
||||
python ./backend-python/main.py --webui #同时启动前后端服务
|
||||
|
||||
# 帮助参数
|
||||
python ./backend-python/main.py -h
|
||||
```
|
||||
|
||||
## API并发压力测试
|
||||
|
||||
```bash
|
||||
@@ -130,6 +156,40 @@ for i in np.argsort(embeddings_cos_sim)[::-1]:
|
||||
print(f"{embeddings_cos_sim[i]:.10f} - {values[i]}")
|
||||
```
|
||||
|
||||
## MIDI Input
|
||||
|
||||
小贴士: 你可以下载 https://github.com/josStorer/sgm_plus, 并解压到程序的`assets/sound-font`目录, 以使用离线音源. 注意,
|
||||
如果你正在从源码编译程序, 请不要将其放置在源码目录中
|
||||
|
||||
### USB MIDI 连接
|
||||
|
||||
- USB MIDI设备是即插即用的, 你能够在作曲页面选择你的输入设备
|
||||
- 
|
||||
|
||||
### Mac MIDI 蓝牙连接
|
||||
|
||||
- 对于想要使用蓝牙输入的Mac用户,
|
||||
请安装[Bluetooth MIDI Connect](https://apps.apple.com/us/app/bluetooth-midi-connect/id1108321791), 启动后点击托盘连接,
|
||||
之后你可以在作曲页面选择你的输入设备
|
||||
- 
|
||||
|
||||
### Windows MIDI 蓝牙连接
|
||||
|
||||
- Windows似乎只为UWP实现了蓝牙MIDI支持, 因此需要多个步骤进行连接, 我们需要创建一个本地的虚拟MIDI设备, 然后启动一个UWP应用,
|
||||
通过此UWP应用将蓝牙MIDI输入重定向到虚拟MIDI设备, 然后本软件监听虚拟MIDI设备的输入
|
||||
- 因此, 首先你需要下载[loopMIDI](https://www.tobias-erichsen.de/wp-content/uploads/2020/01/loopMIDISetup_1_0_16_27.zip),
|
||||
用于创建虚拟MIDI设备, 点击左下角的加号创建设备
|
||||
- 
|
||||
- 然后, 你需要下载[Bluetooth LE Explorer](https://apps.microsoft.com/detail/9N0ZTKF1QD98), 以发现并连接蓝牙MIDI设备,
|
||||
点击Start搜索设备, 然后点击Pair绑定MIDI设备
|
||||
- 
|
||||
- 最后, 你需要安装[MIDIberry](https://apps.microsoft.com/detail/9N39720H2M05), 这个UWP应用能将MIDI蓝牙输入重定向到虚拟MIDI设备,
|
||||
启动后, 在输入栏, 双击你实际的蓝牙MIDI设备名称, 在输出栏, 双击我们先前创建的虚拟MIDI设备名称
|
||||
- 
|
||||
- 现在, 你可以在作曲页面选择虚拟MIDI设备作为输入. Bluetooth LE Explorer不再需要运行, loopMIDI窗口也可以退出, 它会自动在后台运行,
|
||||
仅保持MIDIberry打开即可
|
||||
- 
|
||||
|
||||
## 相关仓库:
|
||||
|
||||
- RWKV-4-World: https://huggingface.co/BlinkDL/rwkv-4-world/tree/main
|
||||
@@ -143,27 +203,34 @@ for i in np.argsort(embeddings_cos_sim)[::-1]:
|
||||
|
||||
### 主页
|
||||
|
||||

|
||||

|
||||
|
||||
### 聊天
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
### 续写
|
||||
|
||||

|
||||
|
||||
### 作曲
|
||||
|
||||
小贴士: 你可以下载 https://github.com/josStorer/sgm_plus, 并解压到程序的`assets/sound-font`目录, 以使用离线音源. 注意,
|
||||
如果你正在从源码编译程序, 请不要将其放置在源码目录中
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
### 配置
|
||||
|
||||

|
||||

|
||||
|
||||
### 模型管理
|
||||
|
||||

|
||||

|
||||
|
||||
### 下载管理
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@ func (a *App) OnStartup(ctx context.Context) {
|
||||
}
|
||||
|
||||
os.Chmod(a.exDir+"backend-rust/webgpu_server", 0777)
|
||||
os.Chmod(a.exDir+"backend-rust/web-rwkv-converter", 0777)
|
||||
os.Mkdir(a.exDir+"models", os.ModePerm)
|
||||
os.Mkdir(a.exDir+"lora-models", os.ModePerm)
|
||||
os.Mkdir(a.exDir+"finetune/json2binidx_tool/data", os.ModePerm)
|
||||
@@ -55,6 +56,7 @@ func (a *App) OnStartup(ctx context.Context) {
|
||||
}
|
||||
|
||||
a.downloadLoop()
|
||||
a.midiLoop()
|
||||
a.watchFs()
|
||||
a.monitorHardware()
|
||||
}
|
||||
@@ -69,8 +71,8 @@ func (a *App) OnBeforeClose(ctx context.Context) bool {
|
||||
func (a *App) watchFs() {
|
||||
watcher, err := fsnotify.NewWatcher()
|
||||
if err == nil {
|
||||
watcher.Add("./lora-models")
|
||||
watcher.Add("./models")
|
||||
watcher.Add(a.exDir + "./lora-models")
|
||||
watcher.Add(a.exDir + "./models")
|
||||
go func() {
|
||||
for {
|
||||
select {
|
||||
|
||||
@@ -33,9 +33,9 @@ type DownloadStatus struct {
|
||||
|
||||
var downloadList []*DownloadStatus
|
||||
|
||||
func existsInDownloadList(url string) bool {
|
||||
func existsInDownloadList(path string, url string) bool {
|
||||
for _, ds := range downloadList {
|
||||
if ds.Url == url {
|
||||
if ds.Path == path || ds.Url == url {
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -88,7 +88,7 @@ func (a *App) ContinueDownload(url string) {
|
||||
}
|
||||
|
||||
func (a *App) AddToDownloadList(path string, url string) {
|
||||
if !existsInDownloadList(url) {
|
||||
if !existsInDownloadList(a.exDir+path, url) {
|
||||
downloadList = append(downloadList, &DownloadStatus{
|
||||
resp: nil,
|
||||
Name: filepath.Base(path),
|
||||
|
||||
170
backend-golang/midi.go
Normal file
170
backend-golang/midi.go
Normal file
@@ -0,0 +1,170 @@
|
||||
package backend_golang
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/mattrtaylor/go-rtmidi"
|
||||
"github.com/wailsapp/wails/v2/pkg/runtime"
|
||||
)
|
||||
|
||||
type Port struct {
|
||||
Name string `json:"name"`
|
||||
}
|
||||
type MIDIMessage struct {
|
||||
MessageType string `json:"messageType"`
|
||||
Channel int `json:"channel"`
|
||||
Note int `json:"note"`
|
||||
Velocity int `json:"velocity"`
|
||||
Control int `json:"control"`
|
||||
Value int `json:"value"`
|
||||
}
|
||||
|
||||
var ports []Port
|
||||
var input rtmidi.MIDIIn
|
||||
var out rtmidi.MIDIOut
|
||||
var activeIndex int = -1
|
||||
var lastNoteTime time.Time
|
||||
|
||||
func (a *App) midiLoop() {
|
||||
var err error
|
||||
input, err = rtmidi.NewMIDIInDefault()
|
||||
if err != nil {
|
||||
runtime.EventsEmit(a.ctx, "midiError", err.Error())
|
||||
return
|
||||
}
|
||||
out, err = rtmidi.NewMIDIOutDefault()
|
||||
if err != nil {
|
||||
runtime.EventsEmit(a.ctx, "midiError", err.Error())
|
||||
}
|
||||
err = out.OpenPort(0, "")
|
||||
if err != nil {
|
||||
runtime.EventsEmit(a.ctx, "midiError", err.Error())
|
||||
}
|
||||
ticker := time.NewTicker(500 * time.Millisecond)
|
||||
go func() {
|
||||
for {
|
||||
<-ticker.C
|
||||
count, err := input.PortCount()
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
ports = make([]Port, count)
|
||||
for i := 0; i < count; i++ {
|
||||
name, err := input.PortName(i)
|
||||
if err == nil {
|
||||
ports[i].Name = name
|
||||
}
|
||||
}
|
||||
runtime.EventsEmit(a.ctx, "midiPorts", &ports)
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
func (a *App) OpenMidiPort(index int) error {
|
||||
if input == nil {
|
||||
return errors.New("failed to initialize MIDI input")
|
||||
}
|
||||
if activeIndex == index {
|
||||
return nil
|
||||
}
|
||||
input.Destroy()
|
||||
var err error
|
||||
input, err = rtmidi.NewMIDIInDefault()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = input.SetCallback(func(msg rtmidi.MIDIIn, bytes []byte, t float64) {
|
||||
// https://www.midi.org/specifications-old/item/table-1-summary-of-midi-message
|
||||
// https://www.rfc-editor.org/rfc/rfc6295.html
|
||||
//
|
||||
// msgType channel
|
||||
// 1001 0000
|
||||
//
|
||||
msgType := bytes[0] >> 4
|
||||
channel := bytes[0] & 0x0f
|
||||
switch msgType {
|
||||
case 0x8:
|
||||
elapsed := time.Since(lastNoteTime)
|
||||
lastNoteTime = time.Now()
|
||||
runtime.EventsEmit(a.ctx, "midiMessage", &MIDIMessage{
|
||||
MessageType: "ElapsedTime",
|
||||
Value: int(elapsed.Milliseconds()),
|
||||
})
|
||||
note := bytes[1]
|
||||
runtime.EventsEmit(a.ctx, "midiMessage", &MIDIMessage{
|
||||
MessageType: "NoteOff",
|
||||
Channel: int(channel),
|
||||
Note: int(note),
|
||||
})
|
||||
case 0x9:
|
||||
elapsed := time.Since(lastNoteTime)
|
||||
lastNoteTime = time.Now()
|
||||
runtime.EventsEmit(a.ctx, "midiMessage", &MIDIMessage{
|
||||
MessageType: "ElapsedTime",
|
||||
Value: int(elapsed.Milliseconds()),
|
||||
})
|
||||
note := bytes[1]
|
||||
velocity := bytes[2]
|
||||
runtime.EventsEmit(a.ctx, "midiMessage", &MIDIMessage{
|
||||
MessageType: "NoteOn",
|
||||
Channel: int(channel),
|
||||
Note: int(note),
|
||||
Velocity: int(velocity),
|
||||
})
|
||||
case 0xb:
|
||||
// control 12 => K1 knob, control 13 => K2 knob
|
||||
control := bytes[1]
|
||||
value := bytes[2]
|
||||
runtime.EventsEmit(a.ctx, "midiMessage", &MIDIMessage{
|
||||
MessageType: "ControlChange",
|
||||
Channel: int(channel),
|
||||
Control: int(control),
|
||||
Value: int(value),
|
||||
})
|
||||
default:
|
||||
fmt.Printf("Unknown midi message: %v\n", bytes)
|
||||
}
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = input.OpenPort(index, "")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
activeIndex = index
|
||||
lastNoteTime = time.Now()
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *App) CloseMidiPort() error {
|
||||
if input == nil {
|
||||
return errors.New("failed to initialize MIDI input")
|
||||
}
|
||||
if activeIndex == -1 {
|
||||
return nil
|
||||
}
|
||||
activeIndex = -1
|
||||
input.Destroy()
|
||||
var err error
|
||||
input, err = rtmidi.NewMIDIInDefault()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *App) PlayNote(msg MIDIMessage) error {
|
||||
if out == nil {
|
||||
return errors.New("failed to initialize MIDI output")
|
||||
}
|
||||
channelByte := byte(msg.Channel)
|
||||
if msg.MessageType == "NoteOn" {
|
||||
out.SendMessage([]byte{0x90 | channelByte, byte(msg.Note), byte(msg.Velocity)})
|
||||
} else if msg.MessageType == "NoteOff" {
|
||||
out.SendMessage([]byte{0x80 | channelByte, byte(msg.Note), byte(msg.Velocity)})
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -46,15 +46,10 @@ func (a *App) ConvertModel(python string, modelPath string, strategy string, out
|
||||
return Cmd(python, "./backend-python/convert_model.py", "--in", modelPath, "--out", outPath, "--strategy", strategy)
|
||||
}
|
||||
|
||||
func (a *App) ConvertSafetensors(python string, modelPath string, outPath string) (string, error) {
|
||||
var err error
|
||||
if python == "" {
|
||||
python, err = GetPython()
|
||||
}
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return Cmd(python, "./backend-python/convert_safetensors.py", "--input", modelPath, "--output", outPath)
|
||||
func (a *App) ConvertSafetensors(modelPath string, outPath string) (string, error) {
|
||||
args := []string{"./backend-rust/web-rwkv-converter"}
|
||||
args = append(args, "--input", modelPath, "--output", outPath)
|
||||
return Cmd(args...)
|
||||
}
|
||||
|
||||
func (a *App) ConvertData(python string, input string, outputPrefix string, vocab string) (string, error) {
|
||||
|
||||
20
backend-python/convert_safetensors.py
vendored
20
backend-python/convert_safetensors.py
vendored
@@ -25,7 +25,7 @@ def rename_key(rename, name):
|
||||
return name
|
||||
|
||||
|
||||
def convert_file(pt_filename: str, sf_filename: str, transpose_names=[], rename={}):
|
||||
def convert_file(pt_filename: str, sf_filename: str, rename={}, transpose_names=[]):
|
||||
loaded = torch.load(pt_filename, map_location="cpu")
|
||||
if "state_dict" in loaded:
|
||||
loaded = loaded["state_dict"]
|
||||
@@ -34,12 +34,14 @@ def convert_file(pt_filename: str, sf_filename: str, transpose_names=[], rename=
|
||||
# for k, v in loaded.items():
|
||||
# print(f'{k}\t{v.shape}\t{v.dtype}')
|
||||
|
||||
loaded = {rename_key(rename, k).lower(): v.contiguous() for k, v in loaded.items()}
|
||||
# For tensors to be contiguous
|
||||
for k, v in loaded.items():
|
||||
for transpose_name in transpose_names:
|
||||
if transpose_name in k:
|
||||
loaded[k] = v.transpose(0, 1)
|
||||
loaded = {rename_key(rename, k).lower(): v.contiguous() for k, v in loaded.items()}
|
||||
|
||||
loaded = {k: v.clone().half().contiguous() for k, v in loaded.items()}
|
||||
|
||||
for k, v in loaded.items():
|
||||
print(f"{k}\t{v.shape}\t{v.dtype}")
|
||||
@@ -60,8 +62,18 @@ if __name__ == "__main__":
|
||||
convert_file(
|
||||
args.input,
|
||||
args.output,
|
||||
["lora_A"],
|
||||
{"time_faaaa": "time_first", "lora_A": "lora.0", "lora_B": "lora.1"},
|
||||
rename={
|
||||
"time_faaaa": "time_first",
|
||||
"time_maa": "time_mix",
|
||||
"lora_A": "lora.0",
|
||||
"lora_B": "lora.1",
|
||||
},
|
||||
transpose_names=[
|
||||
"time_mix_w1",
|
||||
"time_mix_w2",
|
||||
"time_decay_w1",
|
||||
"time_decay_w2",
|
||||
],
|
||||
)
|
||||
print(f"Saved to {args.output}")
|
||||
except Exception as e:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
torch
|
||||
torchvision
|
||||
torchaudio
|
||||
rwkv==0.8.16
|
||||
rwkv==0.8.22
|
||||
langchain==0.0.322
|
||||
fastapi==0.104.0
|
||||
uvicorn==0.23.2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
torch
|
||||
torchvision
|
||||
torchaudio
|
||||
rwkv==0.8.16
|
||||
rwkv==0.8.22
|
||||
langchain==0.0.322
|
||||
fastapi==0.104.0
|
||||
uvicorn==0.23.2
|
||||
|
||||
@@ -49,13 +49,26 @@ def switch_model(body: SwitchModelBody, response: Response, request: Request):
|
||||
if body.model == "":
|
||||
return "success"
|
||||
|
||||
if "->" in body.strategy:
|
||||
state_cache.disable_state_cache()
|
||||
else:
|
||||
try:
|
||||
state_cache.enable_state_cache()
|
||||
except HTTPException:
|
||||
pass
|
||||
STRATEGY_REGEX = r"^(?:(?:^|->) *(?:cuda(?::[\d]+)?|cpu|mps|dml) (?:fp(?:16|32)|bf16)(?:i8|i4|i3)?(?: \*[\d]+\+?)? *)+$"
|
||||
if not re.match(STRATEGY_REGEX, body.strategy):
|
||||
raise HTTPException(
|
||||
Status.HTTP_400_BAD_REQUEST,
|
||||
"Invalid strategy. Please read https://pypi.org/project/rwkv/",
|
||||
)
|
||||
devices = set(
|
||||
[
|
||||
x.strip().split(" ")[0].replace("cuda:0", "cuda")
|
||||
for x in body.strategy.split("->")
|
||||
]
|
||||
)
|
||||
print(f"Devices: {devices}")
|
||||
# if len(devices) > 1:
|
||||
# state_cache.disable_state_cache()
|
||||
# else:
|
||||
try:
|
||||
state_cache.enable_state_cache()
|
||||
except HTTPException:
|
||||
pass
|
||||
|
||||
os.environ["RWKV_CUDA_ON"] = "1" if body.customCuda else "0"
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ def disable_state_cache():
|
||||
dtrie = {}
|
||||
gc.collect()
|
||||
|
||||
print("state cache disabled")
|
||||
return "success"
|
||||
|
||||
|
||||
@@ -61,8 +62,10 @@ def enable_state_cache():
|
||||
dtrie = {}
|
||||
gc.collect()
|
||||
|
||||
print("state cache enabled")
|
||||
return "success"
|
||||
except ModuleNotFoundError:
|
||||
print("state cache disabled")
|
||||
raise HTTPException(status.HTTP_400_BAD_REQUEST, "cyac not found")
|
||||
|
||||
|
||||
@@ -87,14 +90,12 @@ def add_state(body: AddStateBody):
|
||||
|
||||
try:
|
||||
id: int = trie.insert(body.prompt)
|
||||
device: torch.device = body.state[0].device
|
||||
devices: List[torch.device] = [tensor.device for tensor in body.state]
|
||||
dtrie[id] = {
|
||||
"tokens": copy.deepcopy(body.tokens),
|
||||
"state": [tensor.cpu() for tensor in body.state]
|
||||
if device != torch.device("cpu")
|
||||
else copy.deepcopy(body.state),
|
||||
"state": [tensor.cpu() for tensor in body.state],
|
||||
"logits": copy.deepcopy(body.logits),
|
||||
"device": device,
|
||||
"devices": devices,
|
||||
}
|
||||
|
||||
if len(trie) >= max_trie_len:
|
||||
@@ -177,27 +178,18 @@ def longest_prefix_state(body: LongestPrefixStateBody, request: Request):
|
||||
pass
|
||||
if id != -1:
|
||||
v = dtrie[id]
|
||||
device: torch.device = v["device"]
|
||||
devices: List[torch.device] = v["devices"]
|
||||
prompt: str = trie[id]
|
||||
|
||||
quick_log(request, body, "Hit:\n" + prompt)
|
||||
return {
|
||||
"prompt": prompt,
|
||||
"tokens": v["tokens"],
|
||||
"state": [tensor.to(device) for tensor in v["state"]]
|
||||
if device != torch.device("cpu")
|
||||
else v["state"],
|
||||
"state": [tensor.to(devices[i]) for i, tensor in enumerate(v["state"])],
|
||||
"logits": v["logits"],
|
||||
"device": device.type,
|
||||
}
|
||||
else:
|
||||
return {
|
||||
"prompt": "",
|
||||
"tokens": [],
|
||||
"state": None,
|
||||
"logits": None,
|
||||
"device": None,
|
||||
}
|
||||
return {"prompt": "", "tokens": [], "state": None, "logits": None}
|
||||
|
||||
|
||||
# @router.post("/save-state", tags=["State Cache"])
|
||||
|
||||
87
backend-python/rwkv_pip/cuda/rwkv6.cu
vendored
Normal file
87
backend-python/rwkv_pip/cuda/rwkv6.cu
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include "ATen/ATen.h"
|
||||
typedef at::BFloat16 bf16;
|
||||
typedef at::Half fp16;
|
||||
typedef float fp32;
|
||||
|
||||
template <typename F>
|
||||
__global__ void kernel_forward(const int B, const int T, const int C, const int H, float *__restrict__ _state,
|
||||
const F *__restrict__ const _r, const F *__restrict__ const _k, const F *__restrict__ const _v, const float *__restrict__ _w, const F *__restrict__ _u,
|
||||
F *__restrict__ const _y)
|
||||
{
|
||||
const int b = blockIdx.x / H;
|
||||
const int h = blockIdx.x % H;
|
||||
const int i = threadIdx.x;
|
||||
_u += h*_N_;
|
||||
_state += h*_N_*_N_ + i*_N_; // wrong if B > 1 !!!
|
||||
|
||||
__shared__ float r[_N_], k[_N_], u[_N_], w[_N_];
|
||||
|
||||
float state[_N_];
|
||||
#pragma unroll
|
||||
for (int j = 0; j < _N_; j++)
|
||||
state[j] = _state[j];
|
||||
|
||||
__syncthreads();
|
||||
u[i] = float(_u[i]);
|
||||
__syncthreads();
|
||||
|
||||
for (int t = b*T*C + h*_N_ + i; t < (b+1)*T*C + h*_N_ + i; t += C)
|
||||
{
|
||||
__syncthreads();
|
||||
w[i] = _w[t];
|
||||
r[i] = float(_r[t]);
|
||||
k[i] = float(_k[t]);
|
||||
__syncthreads();
|
||||
|
||||
const float v = float(_v[t]);
|
||||
float y = 0;
|
||||
|
||||
#pragma unroll
|
||||
for (int j = 0; j < _N_; j+=4)
|
||||
{
|
||||
const float4& r_ = (float4&)(r[j]);
|
||||
const float4& k_ = (float4&)(k[j]);
|
||||
const float4& w_ = (float4&)(w[j]);
|
||||
const float4& u_ = (float4&)(u[j]);
|
||||
float4& s = (float4&)(state[j]);
|
||||
float4 x;
|
||||
|
||||
x.x = k_.x * v;
|
||||
x.y = k_.y * v;
|
||||
x.z = k_.z * v;
|
||||
x.w = k_.w * v;
|
||||
|
||||
y += r_.x * (u_.x * x.x + s.x);
|
||||
y += r_.y * (u_.y * x.y + s.y);
|
||||
y += r_.z * (u_.z * x.z + s.z);
|
||||
y += r_.w * (u_.w * x.w + s.w);
|
||||
|
||||
s.x = s.x * w_.x + x.x;
|
||||
s.y = s.y * w_.y + x.y;
|
||||
s.z = s.z * w_.z + x.z;
|
||||
s.w = s.w * w_.w + x.w;
|
||||
}
|
||||
_y[t] = F(y);
|
||||
}
|
||||
#pragma unroll
|
||||
for (int j = 0; j < _N_; j++)
|
||||
_state[j] = state[j];
|
||||
}
|
||||
|
||||
void cuda_forward_bf16(int B, int T, int C, int H, float *state, bf16 *r, bf16 *k, bf16 *v, float *w, bf16 *u, bf16 *y)
|
||||
{
|
||||
assert(H*_N_ == C);
|
||||
kernel_forward<<<dim3(B * H), dim3(_N_)>>>(B, T, C, H, state, r, k, v, w, u, y);
|
||||
}
|
||||
void cuda_forward_fp16(int B, int T, int C, int H, float *state, fp16 *r, fp16 *k, fp16 *v, float *w, fp16 *u, fp16 *y)
|
||||
{
|
||||
assert(H*_N_ == C);
|
||||
kernel_forward<<<dim3(B * H), dim3(_N_)>>>(B, T, C, H, state, r, k, v, w, u, y);
|
||||
}
|
||||
void cuda_forward_fp32(int B, int T, int C, int H, float *state, fp32 *r, fp32 *k, fp32 *v, float *w, fp32 *u, fp32 *y)
|
||||
{
|
||||
assert(H*_N_ == C);
|
||||
kernel_forward<<<dim3(B * H), dim3(_N_)>>>(B, T, C, H, state, r, k, v, w, u, y);
|
||||
}
|
||||
34
backend-python/rwkv_pip/cuda/rwkv6_op.cpp
vendored
Normal file
34
backend-python/rwkv_pip/cuda/rwkv6_op.cpp
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
#include <torch/extension.h>
|
||||
#include "ATen/ATen.h"
|
||||
#include <c10/cuda/CUDAGuard.h>
|
||||
typedef at::BFloat16 bf16;
|
||||
typedef at::Half fp16;
|
||||
typedef float fp32;
|
||||
|
||||
void cuda_forward_bf16(int B, int T, int C, int H, float *state, bf16 *r, bf16 *k, bf16 *v, float *w, bf16 *u, bf16 *y);
|
||||
void cuda_forward_fp16(int B, int T, int C, int H, float *state, fp16 *r, fp16 *k, fp16 *v, float *w, fp16 *u, fp16 *y);
|
||||
void cuda_forward_fp32(int B, int T, int C, int H, float *state, fp32 *r, fp32 *k, fp32 *v, float *w, fp32 *u, fp32 *y);
|
||||
|
||||
void forward_bf16(int64_t B, int64_t T, int64_t C, int64_t H, torch::Tensor &state, torch::Tensor &r, torch::Tensor &k, torch::Tensor &v, torch::Tensor &w, torch::Tensor &u, torch::Tensor &y) {
|
||||
const at::cuda::OptionalCUDAGuard device_guard(device_of(state));
|
||||
cuda_forward_bf16(B, T, C, H, state.data_ptr<float>(), r.data_ptr<bf16>(), k.data_ptr<bf16>(), v.data_ptr<bf16>(), w.data_ptr<float>(), u.data_ptr<bf16>(), y.data_ptr<bf16>());
|
||||
}
|
||||
void forward_fp16(int64_t B, int64_t T, int64_t C, int64_t H, torch::Tensor &state, torch::Tensor &r, torch::Tensor &k, torch::Tensor &v, torch::Tensor &w, torch::Tensor &u, torch::Tensor &y) {
|
||||
const at::cuda::OptionalCUDAGuard device_guard(device_of(state));
|
||||
cuda_forward_fp16(B, T, C, H, state.data_ptr<float>(), r.data_ptr<fp16>(), k.data_ptr<fp16>(), v.data_ptr<fp16>(), w.data_ptr<float>(), u.data_ptr<fp16>(), y.data_ptr<fp16>());
|
||||
}
|
||||
void forward_fp32(int64_t B, int64_t T, int64_t C, int64_t H, torch::Tensor &state, torch::Tensor &r, torch::Tensor &k, torch::Tensor &v, torch::Tensor &w, torch::Tensor &u, torch::Tensor &y) {
|
||||
const at::cuda::OptionalCUDAGuard device_guard(device_of(state));
|
||||
cuda_forward_fp32(B, T, C, H, state.data_ptr<float>(), r.data_ptr<fp32>(), k.data_ptr<fp32>(), v.data_ptr<fp32>(), w.data_ptr<float>(), u.data_ptr<fp32>(), y.data_ptr<fp32>());
|
||||
}
|
||||
|
||||
PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
|
||||
m.def("forward_bf16", &forward_bf16, "rwkv6 forward_bf16");
|
||||
m.def("forward_fp16", &forward_fp16, "rwkv6 forward_fp16");
|
||||
m.def("forward_fp32", &forward_fp32, "rwkv6 forward_fp32");
|
||||
}
|
||||
TORCH_LIBRARY(rwkv6, m) {
|
||||
m.def("forward_bf16", forward_bf16);
|
||||
m.def("forward_fp16", forward_fp16);
|
||||
m.def("forward_fp32", forward_fp32);
|
||||
}
|
||||
890
backend-python/rwkv_pip/model.py
vendored
890
backend-python/rwkv_pip/model.py
vendored
File diff suppressed because it is too large
Load Diff
BIN
backend-python/rwkv_pip/rwkv5.pyd
vendored
BIN
backend-python/rwkv_pip/rwkv5.pyd
vendored
Binary file not shown.
BIN
backend-python/rwkv_pip/rwkv6.pyd
vendored
Normal file
BIN
backend-python/rwkv_pip/rwkv6.pyd
vendored
Normal file
Binary file not shown.
BIN
backend-python/rwkv_pip/wkv_cuda.pyd
vendored
BIN
backend-python/rwkv_pip/wkv_cuda.pyd
vendored
Binary file not shown.
@@ -511,6 +511,9 @@ def get_tokenizer(tokenizer_len: int):
|
||||
def RWKV(model: str, strategy: str, tokenizer: Union[str, None]) -> AbstractRWKV:
|
||||
rwkv_beta = global_var.get(global_var.Args).rwkv_beta
|
||||
|
||||
if "midi" in model.lower() or "abc" in model.lower():
|
||||
os.environ["RWKV_RESCALE_LAYER"] = "999"
|
||||
|
||||
# dynamic import to make RWKV_CUDA_ON work
|
||||
if rwkv_beta:
|
||||
from rwkv_pip.beta.model import (
|
||||
|
||||
@@ -23,6 +23,7 @@ def file_cleaner(file):
|
||||
return cleaner
|
||||
|
||||
|
||||
expected_max_version = float(sys.argv[2]) if len(sys.argv) > 2 else 100
|
||||
model_file = open(sys.argv[1], "rb")
|
||||
cleaner = file_cleaner(model_file)
|
||||
cleaner_thread = threading.Thread(target=cleaner, daemon=True)
|
||||
@@ -34,8 +35,23 @@ gc.collect()
|
||||
n_embd = w["emb.weight"].shape[1]
|
||||
n_layer = 0
|
||||
keys = list(w.keys())
|
||||
version = 4
|
||||
for x in keys:
|
||||
layer_id = int(x.split(".")[1]) if ("blocks." in x) else 0
|
||||
n_layer = max(n_layer, layer_id + 1)
|
||||
|
||||
print(f"--n_layer {n_layer} --n_embd {n_embd}", end="")
|
||||
if "ln_x" in x:
|
||||
version = max(5, version)
|
||||
if "gate.weight" in x:
|
||||
version = max(5.1, version)
|
||||
if int(version) == 5 and "att.time_decay" in x:
|
||||
if len(w[x].shape) > 1:
|
||||
if w[x].shape[1] > 1:
|
||||
version = max(5.2, version)
|
||||
if "time_maa" in x:
|
||||
version = max(6, version)
|
||||
|
||||
if version <= expected_max_version:
|
||||
print(f"--n_layer {n_layer} --n_embd {n_embd}", end="")
|
||||
else:
|
||||
raise Exception(f"RWKV{version} is not supported")
|
||||
|
||||
@@ -47,7 +47,7 @@ else
|
||||
fi
|
||||
|
||||
echo "loading $loadModel"
|
||||
modelInfo=$(python3 ./finetune/get_layer_and_embd.py $loadModel)
|
||||
modelInfo=$(python3 ./finetune/get_layer_and_embd.py $loadModel 4)
|
||||
echo $modelInfo
|
||||
if [[ $modelInfo =~ "--n_layer" ]]; then
|
||||
python3 ./finetune/lora/train.py $modelInfo $@ --proj_dir lora-models --data_type binidx --lora \
|
||||
|
||||
766
frontend/package-lock.json
generated
766
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -21,10 +21,12 @@
|
||||
"i18next": "^22.4.15",
|
||||
"mobx": "^6.9.0",
|
||||
"mobx-react-lite": "^3.4.3",
|
||||
"pdfjs-dist": "^4.0.189",
|
||||
"react": "^18.2.0",
|
||||
"react-beautiful-dnd": "^13.1.1",
|
||||
"react-chartjs-2": "^5.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-draggable": "^4.4.6",
|
||||
"react-i18next": "^12.2.2",
|
||||
"react-markdown": "^8.0.7",
|
||||
"react-router": "^6.11.1",
|
||||
@@ -50,6 +52,7 @@
|
||||
"sass": "^1.62.1",
|
||||
"tailwindcss": "^3.3.2",
|
||||
"typescript": "^5.0.4",
|
||||
"vite": "^4.3.6"
|
||||
"vite": "^4.3.6",
|
||||
"vite-plugin-top-level-await": "^1.3.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@
|
||||
"VRAM": "VRAM",
|
||||
"GPU Usage": "GPU使用率",
|
||||
"Use Custom Tokenizer": "カスタムトークナイザーを使用する",
|
||||
"Tokenizer Path (e.g. backend-python/rwkv_pip/20B_tokenizer.json)": "トークナイザーパス (例: backend-python/rwkv_pip/20B_tokenizer.json)",
|
||||
"Tokenizer Path (e.g. backend-python/rwkv_pip/20B_tokenizer.json or rwkv_vocab_v20230424.txt)": "トークナイザーパス (例: backend-python/rwkv_pip/20B_tokenizer.json または rwkv_vocab_v20230424.txt)",
|
||||
"User Name": "ユーザー名",
|
||||
"Assistant Name": "アシスタント名",
|
||||
"Insert default system prompt at the beginning": "最初にデフォルトのシステムプロンプトを挿入",
|
||||
@@ -271,5 +271,45 @@
|
||||
"You can increase the number of stored layers in Configs page to improve performance": "パフォーマンスを向上させるために、保存されるレイヤーの数を設定ページで増やすことができます",
|
||||
"Failed to load model, try to increase the virtual memory (Swap of WSL) or use a smaller base model.": "モデルの読み込みに失敗しました、仮想メモリ (WSL Swap) を増やすか小さなベースモデルを使用してみてください。",
|
||||
"Save Conversation": "会話を保存",
|
||||
"Use Hugging Face Mirror": "Hugging Faceミラーを使用"
|
||||
"Use Hugging Face Mirror": "Hugging Faceミラーを使用",
|
||||
"File is empty": "ファイルが空です",
|
||||
"Open MIDI Input Audio Tracks": "MIDI入力オーディオトラックを開く",
|
||||
"Track": "トラック",
|
||||
"Play All": "すべて再生",
|
||||
"Clear All": "すべてクリア",
|
||||
"Scale View": "スケールビュー",
|
||||
"Record": "録音",
|
||||
"Play": "再生",
|
||||
"New Track": "新規トラック",
|
||||
"Select a track to preview the content": "トラックを選択して内容をプレビュー",
|
||||
"Save to generation area": "生成エリアに保存",
|
||||
"Piano": "ピアノ",
|
||||
"Percussion": "パーカッション",
|
||||
"Drum": "ドラム",
|
||||
"Tuba": "チューバ",
|
||||
"Marimba": "マリンバ",
|
||||
"Bass": "ベース",
|
||||
"Guitar": "ギター",
|
||||
"Violin": "バイオリン",
|
||||
"Trumpet": "トランペット",
|
||||
"Sax": "サックス",
|
||||
"Flute": "フルート",
|
||||
"Lead": "リード",
|
||||
"Pad": "パッド",
|
||||
"MIDI Input": "MIDI入力",
|
||||
"Select the MIDI input device to be used.": "使用するMIDI入力デバイスを選択します。",
|
||||
"Start Time": "開始時間",
|
||||
"Content Duration": "内容の長さ",
|
||||
"Please select a MIDI device first": "まずMIDIデバイスを選択してください",
|
||||
"Piano is the main instrument": "ピアノはメインの楽器です",
|
||||
"Loss is too high, please check the training data, and ensure your gpu driver is up to date.": "Lossが大きすぎます、トレーニングデータを確認し、GPUドライバが最新であることを確認してください。",
|
||||
"This version of RWKV is not supported yet.": "このバージョンのRWKVはまだサポートされていません。",
|
||||
"Main": "メイン",
|
||||
"Finetuned": "微調整",
|
||||
"Global": "グローバル",
|
||||
"Local": "ローカル",
|
||||
"CN": "中国語",
|
||||
"JP": "日本語",
|
||||
"Music": "音楽",
|
||||
"Other": "その他"
|
||||
}
|
||||
@@ -250,7 +250,7 @@
|
||||
"VRAM": "显存",
|
||||
"GPU Usage": "GPU占用",
|
||||
"Use Custom Tokenizer": "使用自定义Tokenizer",
|
||||
"Tokenizer Path (e.g. backend-python/rwkv_pip/20B_tokenizer.json)": "Tokenizer路径 (例如: backend-python/rwkv_pip/20B_tokenizer.json)",
|
||||
"Tokenizer Path (e.g. backend-python/rwkv_pip/20B_tokenizer.json or rwkv_vocab_v20230424.txt)": "Tokenizer路径 (例如: backend-python/rwkv_pip/20B_tokenizer.json 或 rwkv_vocab_v20230424.txt)",
|
||||
"User Name": "用户名称",
|
||||
"Assistant Name": "AI名称",
|
||||
"Insert default system prompt at the beginning": "在开头自动插入默认系统提示",
|
||||
@@ -271,5 +271,45 @@
|
||||
"You can increase the number of stored layers in Configs page to improve performance": "你可以在配置页面增加载入显存层数以提升性能",
|
||||
"Failed to load model, try to increase the virtual memory (Swap of WSL) or use a smaller base model.": "模型载入失败,尝试增加虚拟内存(WSL Swap),或使用一个更小规模的基底模型",
|
||||
"Save Conversation": "保存对话",
|
||||
"Use Hugging Face Mirror": "使用Hugging Face镜像源"
|
||||
"Use Hugging Face Mirror": "使用Hugging Face镜像源",
|
||||
"File is empty": "文件为空",
|
||||
"Open MIDI Input Audio Tracks": "打开MIDI输入音轨",
|
||||
"Track": "音轨",
|
||||
"Play All": "播放全部",
|
||||
"Clear All": "清空",
|
||||
"Scale View": "缩放视图",
|
||||
"Record": "录制",
|
||||
"Play": "播放",
|
||||
"New Track": "新建音轨",
|
||||
"Select a track to preview the content": "选择一个音轨以预览内容",
|
||||
"Save to generation area": "保存到生成区",
|
||||
"Piano": "钢琴",
|
||||
"Percussion": "打击乐",
|
||||
"Drum": "鼓",
|
||||
"Tuba": "大号",
|
||||
"Marimba": "马林巴",
|
||||
"Bass": "贝斯",
|
||||
"Guitar": "吉他",
|
||||
"Violin": "小提琴",
|
||||
"Trumpet": "小号",
|
||||
"Sax": "萨克斯",
|
||||
"Flute": "长笛",
|
||||
"Lead": "主音",
|
||||
"Pad": "和音",
|
||||
"MIDI Input": "MIDI输入",
|
||||
"Select the MIDI input device to be used.": "选择要使用的MIDI输入设备",
|
||||
"Start Time": "开始时间",
|
||||
"Content Duration": "内容时长",
|
||||
"Please select a MIDI device first": "请先选择一个MIDI设备",
|
||||
"Piano is the main instrument": "钢琴为主",
|
||||
"Loss is too high, please check the training data, and ensure your gpu driver is up to date.": "Loss过高,请检查训练数据,并确保你的显卡驱动是最新的",
|
||||
"This version of RWKV is not supported yet.": "暂不支持此版本的RWKV",
|
||||
"Main": "主干",
|
||||
"Finetuned": "微调",
|
||||
"Global": "全球",
|
||||
"Local": "本地",
|
||||
"CN": "中文",
|
||||
"JP": "日文",
|
||||
"Music": "音乐",
|
||||
"Other": "其他"
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { FC } from 'react';
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import { Dropdown, Option } from '@fluentui/react-components';
|
||||
import { Dropdown, Option, PresenceBadge } from '@fluentui/react-components';
|
||||
import commonStore from '../stores/commonStore';
|
||||
|
||||
export const ConfigSelector: FC<{ size?: 'small' | 'medium' | 'large' }> = observer(({ size }) => {
|
||||
@@ -12,7 +12,13 @@ export const ConfigSelector: FC<{ size?: 'small' | 'medium' | 'large' }> = obser
|
||||
commonStore.setCurrentConfigIndex(Number(data.optionValue));
|
||||
}}>
|
||||
{commonStore.modelConfigs.map((config, index) =>
|
||||
<Option key={index} value={index.toString()}>{config.name}</Option>
|
||||
<Option key={index} value={index.toString()} text={config.name}>
|
||||
<div className="flex justify-between grow">
|
||||
{config.name}
|
||||
{commonStore.modelSourceList.find(item => item.name === config.modelParameters.modelName)?.isComplete
|
||||
&& <PresenceBadge status="available" />}
|
||||
</div>
|
||||
</Option>
|
||||
)}
|
||||
</Dropdown>;
|
||||
});
|
||||
@@ -17,6 +17,7 @@ import { ToolTipButton } from './ToolTipButton';
|
||||
import { Play16Regular, Stop16Regular } from '@fluentui/react-icons';
|
||||
import { useNavigate } from 'react-router';
|
||||
import { WindowShow } from '../../wailsjs/runtime';
|
||||
import { convertToSt } from '../utils/convert-to-st';
|
||||
|
||||
const mainButtonText = {
|
||||
[ModelStatus.Offline]: 'Run',
|
||||
@@ -57,13 +58,40 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean
|
||||
return;
|
||||
}
|
||||
|
||||
const currentModelSource = commonStore.modelSourceList.find(item => item.name === modelName);
|
||||
|
||||
const showDownloadPrompt = (promptInfo: string, downloadName: string) => {
|
||||
toastWithButton(promptInfo, t('Download'), () => {
|
||||
const downloadUrl = currentModelSource?.downloadUrl;
|
||||
if (downloadUrl) {
|
||||
toastWithButton(`${t('Downloading')} ${downloadName}`, t('Check'), () => {
|
||||
navigate({ pathname: '/downloads' });
|
||||
},
|
||||
{ autoClose: 3000 });
|
||||
AddToDownloadList(modelPath, getHfDownloadUrl(downloadUrl));
|
||||
} else {
|
||||
toast(t('Can not find download url'), { type: 'error' });
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (webgpu) {
|
||||
if (!['.st', '.safetensors'].some(ext => modelPath.endsWith(ext))) {
|
||||
const stModelPath = modelPath.replace(/\.pth$/, '.st');
|
||||
if (await FileExists(stModelPath)) {
|
||||
modelPath = stModelPath;
|
||||
} else if (!await FileExists(modelPath)) {
|
||||
showDownloadPrompt(t('Model file not found'), modelName);
|
||||
commonStore.setStatus({ status: ModelStatus.Offline });
|
||||
return;
|
||||
} else if (!currentModelSource?.isComplete) {
|
||||
showDownloadPrompt(t('Model file download is not complete'), modelName);
|
||||
commonStore.setStatus({ status: ModelStatus.Offline });
|
||||
return;
|
||||
} else {
|
||||
toast(t('Please convert model to safe tensors format first'), { type: 'error' });
|
||||
toastWithButton(t('Please convert model to safe tensors format first'), t('Convert'), () => {
|
||||
convertToSt(modelConfig);
|
||||
});
|
||||
commonStore.setStatus({ status: ModelStatus.Offline });
|
||||
return;
|
||||
}
|
||||
@@ -84,28 +112,13 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean
|
||||
return;
|
||||
}
|
||||
|
||||
const currentModelSource = commonStore.modelSourceList.find(item => item.name === modelName);
|
||||
|
||||
const showDownloadPrompt = (promptInfo: string, downloadName: string) => {
|
||||
toastWithButton(promptInfo, t('Download'), () => {
|
||||
const downloadUrl = currentModelSource?.downloadUrl;
|
||||
if (downloadUrl) {
|
||||
toastWithButton(`${t('Downloading')} ${downloadName}`, t('Check'), () => {
|
||||
navigate({ pathname: '/downloads' });
|
||||
},
|
||||
{ autoClose: 3000 });
|
||||
AddToDownloadList(modelPath, getHfDownloadUrl(downloadUrl));
|
||||
} else {
|
||||
toast(t('Can not find download url'), { type: 'error' });
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (!await FileExists(modelPath)) {
|
||||
showDownloadPrompt(t('Model file not found'), modelName);
|
||||
commonStore.setStatus({ status: ModelStatus.Offline });
|
||||
return;
|
||||
} else if (!currentModelSource?.isComplete) {
|
||||
} else // If the user selects the .pth model with WebGPU mode, modelPath will be set to the .st model.
|
||||
// However, if the .pth model is deleted, modelPath will exist and isComplete will be false.
|
||||
if (!currentModelSource?.isComplete && modelPath.endsWith('.pth')) {
|
||||
showDownloadPrompt(t('Model file download is not complete'), modelName);
|
||||
commonStore.setStatus({ status: ModelStatus.Offline });
|
||||
return;
|
||||
@@ -138,6 +151,8 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean
|
||||
toast(t('Error') + ' - ' + errMsg, { type: 'error' });
|
||||
});
|
||||
setTimeout(WindowShow, 1000);
|
||||
setTimeout(WindowShow, 2000);
|
||||
setTimeout(WindowShow, 3000);
|
||||
|
||||
let timeoutCount = 6;
|
||||
let loading = false;
|
||||
@@ -154,7 +169,7 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean
|
||||
});
|
||||
}
|
||||
commonStore.setStatus({ status: ModelStatus.Loading });
|
||||
toast(t('Loading Model'), { type: 'info' });
|
||||
const loadingId = toast(t('Loading Model'), { type: 'info', autoClose: false });
|
||||
if (!webgpu) {
|
||||
updateConfig({
|
||||
max_tokens: modelConfig.apiParameters.maxResponseToken,
|
||||
@@ -168,7 +183,8 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean
|
||||
const strategy = getStrategy(modelConfig);
|
||||
let customCudaFile = '';
|
||||
if ((modelConfig.modelParameters.device.includes('CUDA') || modelConfig.modelParameters.device === 'Custom')
|
||||
&& modelConfig.modelParameters.useCustomCuda && !strategy.includes('fp32')) {
|
||||
&& modelConfig.modelParameters.useCustomCuda
|
||||
&& !strategy.split('->').some(s => ['cuda', 'fp32'].every(v => s.includes(v)))) {
|
||||
if (commonStore.platform === 'windows') {
|
||||
// this part is currently unused because there's no longer a need to use different kernels for different GPUs, but it might still be needed in the future
|
||||
//
|
||||
@@ -217,7 +233,7 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean
|
||||
if ((modelConfig.modelParameters.device === 'CUDA' || modelConfig.modelParameters.device === 'CUDA-Beta') &&
|
||||
modelConfig.modelParameters.storedLayers < modelConfig.modelParameters.maxStoredLayers &&
|
||||
commonStore.monitorData && commonStore.monitorData.totalVram !== 0 &&
|
||||
(commonStore.monitorData.usedVram / commonStore.monitorData.totalVram) < 0.85)
|
||||
(commonStore.monitorData.usedVram / commonStore.monitorData.totalVram) < 0.9)
|
||||
toast(t('You can increase the number of stored layers in Configs page to improve performance'), { type: 'info' });
|
||||
toastWithButton(t('Startup Completed'), t(buttonName), buttonFn, { type: 'success', autoClose: 3000 });
|
||||
} else if (r.status === 304) {
|
||||
@@ -240,6 +256,8 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean
|
||||
}).catch((e) => {
|
||||
commonStore.setStatus({ status: ModelStatus.Offline });
|
||||
toast(t('Failed to switch model') + ' - ' + (e.message || e), { type: 'error' });
|
||||
}).finally(() => {
|
||||
toast.dismiss(loadingId);
|
||||
});
|
||||
}
|
||||
}).catch(() => {
|
||||
|
||||
40
frontend/src/pages/AudiotrackManager/AudiotrackButton.tsx
Normal file
40
frontend/src/pages/AudiotrackManager/AudiotrackButton.tsx
Normal file
@@ -0,0 +1,40 @@
|
||||
import React, { FC, lazy } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Button, Dialog, DialogBody, DialogContent, DialogSurface, DialogTrigger } from '@fluentui/react-components';
|
||||
import { CustomToastContainer } from '../../components/CustomToastContainer';
|
||||
import { LazyImportComponent } from '../../components/LazyImportComponent';
|
||||
import { flushMidiRecordingContent } from '../../utils';
|
||||
import commonStore from '../../stores/commonStore';
|
||||
|
||||
const AudiotrackEditor = lazy(() => import('./AudiotrackEditor'));
|
||||
|
||||
export const AudiotrackButton: FC<{
|
||||
size?: 'small' | 'medium' | 'large',
|
||||
shape?: 'rounded' | 'circular' | 'square';
|
||||
appearance?: 'secondary' | 'primary' | 'outline' | 'subtle' | 'transparent';
|
||||
setPrompt: (prompt: string) => void;
|
||||
}> = ({ size, shape, appearance, setPrompt }) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return <Dialog onOpenChange={(e, data) => {
|
||||
if (!data.open) {
|
||||
flushMidiRecordingContent();
|
||||
commonStore.setRecordingTrackId('');
|
||||
commonStore.setPlayingTrackId('');
|
||||
}
|
||||
}}>
|
||||
<DialogTrigger disableButtonEnhancement>
|
||||
<Button size={size} shape={shape} appearance={appearance}>
|
||||
{t('Open MIDI Input Audio Tracks')}
|
||||
</Button>
|
||||
</DialogTrigger>
|
||||
<DialogSurface style={{ paddingTop: 0, maxWidth: '90vw', width: 'fit-content' }}>
|
||||
<DialogBody>
|
||||
<DialogContent className="overflow-hidden">
|
||||
<CustomToastContainer />
|
||||
<LazyImportComponent lazyChildren={AudiotrackEditor} lazyProps={{ setPrompt }} />
|
||||
</DialogContent>
|
||||
</DialogBody>
|
||||
</DialogSurface>
|
||||
</Dialog>;
|
||||
};
|
||||
508
frontend/src/pages/AudiotrackManager/AudiotrackEditor.tsx
Normal file
508
frontend/src/pages/AudiotrackManager/AudiotrackEditor.tsx
Normal file
@@ -0,0 +1,508 @@
|
||||
import React, { FC, useEffect, useRef, useState } from 'react';
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import Draggable from 'react-draggable';
|
||||
import { ToolTipButton } from '../../components/ToolTipButton';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import {
|
||||
Add16Regular,
|
||||
ArrowAutofitWidth20Regular,
|
||||
Delete16Regular,
|
||||
MusicNote220Regular,
|
||||
Pause16Regular,
|
||||
Play16Filled,
|
||||
Play16Regular,
|
||||
Record16Regular,
|
||||
Stop16Filled
|
||||
} from '@fluentui/react-icons';
|
||||
import { Button, Card, DialogTrigger, Slider, Text, Tooltip } from '@fluentui/react-components';
|
||||
import { useWindowSize } from 'usehooks-ts';
|
||||
import commonStore from '../../stores/commonStore';
|
||||
import classnames from 'classnames';
|
||||
import {
|
||||
InstrumentTypeNameMap,
|
||||
InstrumentTypeTokenMap,
|
||||
MidiMessage,
|
||||
tracksMinimalTotalTime
|
||||
} from '../../types/composition';
|
||||
import { toast } from 'react-toastify';
|
||||
import { ToastOptions } from 'react-toastify/dist/types';
|
||||
import { flushMidiRecordingContent, refreshTracksTotalTime } from '../../utils';
|
||||
import { PlayNote } from '../../../wailsjs/go/backend_golang/App';
|
||||
import { t } from 'i18next';
|
||||
|
||||
const snapValue = 25;
|
||||
const minimalMoveTime = 8; // 1000/125=8ms wait_events=125
|
||||
const scaleMin = 0.05;
|
||||
const scaleMax = 3;
|
||||
const baseMoveTime = Math.round(minimalMoveTime / scaleMin);
|
||||
|
||||
const velocityEvents = 128;
|
||||
const velocityBins = 12;
|
||||
const velocityExp = 0.5;
|
||||
|
||||
const minimalTrackWidth = 80;
|
||||
const trackInitOffsetPx = 10;
|
||||
const pixelFix = 0.5;
|
||||
const topToArrowIcon = 19;
|
||||
const arrowIconToTracks = 23;
|
||||
|
||||
type TrackProps = {
|
||||
id: string;
|
||||
right: number;
|
||||
scale: number;
|
||||
isSelected: boolean;
|
||||
onSelect: (id: string) => void;
|
||||
};
|
||||
|
||||
const displayCurrentInstrumentType = () => {
|
||||
const displayPanelId = 'instrument_panel_id';
|
||||
const content: React.ReactNode =
|
||||
<div className="flex gap-2 items-center">
|
||||
{InstrumentTypeNameMap.map((name, i) =>
|
||||
<Text key={name} style={{ whiteSpace: 'nowrap' }}
|
||||
className={commonStore.instrumentType === i ? 'text-blue-600' : ''}
|
||||
weight={commonStore.instrumentType === i ? 'bold' : 'regular'}
|
||||
size={commonStore.instrumentType === i ? 300 : 100}
|
||||
>{t(name)}</Text>)}
|
||||
</div>;
|
||||
const options: ToastOptions = {
|
||||
type: 'default',
|
||||
autoClose: 2000,
|
||||
toastId: displayPanelId,
|
||||
position: 'top-left',
|
||||
style: {
|
||||
width: 'fit-content'
|
||||
}
|
||||
};
|
||||
if (toast.isActive(displayPanelId))
|
||||
toast.update(displayPanelId, {
|
||||
render: content,
|
||||
...options
|
||||
});
|
||||
else
|
||||
toast(content, options);
|
||||
};
|
||||
|
||||
const velocityToBin = (velocity: number) => {
|
||||
velocity = Math.max(0, Math.min(velocity, velocityEvents - 1));
|
||||
const binsize = velocityEvents / (velocityBins - 1);
|
||||
return Math.ceil((velocityEvents * ((Math.pow(velocityExp, (velocity / velocityEvents)) - 1.0) / (velocityExp - 1.0))) / binsize);
|
||||
};
|
||||
|
||||
const midiMessageToToken = (msg: MidiMessage) => {
|
||||
if (msg.messageType === 'NoteOn' || msg.messageType === 'NoteOff') {
|
||||
const instrument = InstrumentTypeTokenMap[commonStore.instrumentType];
|
||||
const note = msg.note.toString(16);
|
||||
const velocity = velocityToBin(msg.velocity).toString(16);
|
||||
return `${instrument}:${note}:${velocity} `;
|
||||
} else if (msg.messageType === 'ElapsedTime') {
|
||||
let time = Math.round(msg.value / minimalMoveTime);
|
||||
const num = Math.floor(time / 125); // wait_events=125
|
||||
time -= num * 125;
|
||||
let ret = '';
|
||||
for (let i = 0; i < num; i++) {
|
||||
ret += 't125 ';
|
||||
}
|
||||
if (time > 0)
|
||||
ret += `t${time} `;
|
||||
return ret;
|
||||
} else
|
||||
return '';
|
||||
};
|
||||
|
||||
let dropRecordingTime = false;
|
||||
|
||||
export const midiMessageHandler = async (data: MidiMessage) => {
|
||||
if (data.messageType === 'ControlChange') {
|
||||
commonStore.setInstrumentType(Math.round(data.value / 127 * (InstrumentTypeNameMap.length - 1)));
|
||||
displayCurrentInstrumentType();
|
||||
return;
|
||||
}
|
||||
if (commonStore.recordingTrackId) {
|
||||
if (dropRecordingTime && data.messageType === 'ElapsedTime') {
|
||||
dropRecordingTime = false;
|
||||
return;
|
||||
}
|
||||
data = {
|
||||
...data,
|
||||
instrument: commonStore.instrumentType
|
||||
};
|
||||
commonStore.setRecordingRawContent([...commonStore.recordingRawContent, data]);
|
||||
commonStore.setRecordingContent(commonStore.recordingContent + midiMessageToToken(data));
|
||||
|
||||
//TODO data.channel = data.instrument;
|
||||
PlayNote(data);
|
||||
}
|
||||
};
|
||||
|
||||
const Track: React.FC<TrackProps> = observer(({
|
||||
id,
|
||||
right,
|
||||
scale,
|
||||
isSelected,
|
||||
onSelect
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const trackIndex = commonStore.tracks.findIndex(t => t.id === id)!;
|
||||
const track = commonStore.tracks[trackIndex];
|
||||
const trackClass = isSelected ? 'bg-blue-600' : (commonStore.settings.darkMode ? 'bg-blue-900' : 'bg-gray-700');
|
||||
const controlX = useRef(0);
|
||||
|
||||
let trackName = t('Track') + ' ' + id;
|
||||
if (track.mainInstrument)
|
||||
trackName = t('Track') + ' - ' + t('Piano is the main instrument')!.replace(t('Piano')!, t(track.mainInstrument)) + (track.content && (' - ' + track.content));
|
||||
else if (track.content)
|
||||
trackName = t('Track') + ' - ' + track.content;
|
||||
|
||||
return (
|
||||
<Draggable
|
||||
axis="x"
|
||||
bounds={{ left: 0, right }}
|
||||
grid={[snapValue, snapValue]}
|
||||
position={{
|
||||
x: (track.offsetTime - commonStore.trackCurrentTime) / (baseMoveTime * scale) * snapValue,
|
||||
y: 0
|
||||
}}
|
||||
onStart={(e, data) => {
|
||||
controlX.current = data.lastX;
|
||||
}}
|
||||
onStop={(e, data) => {
|
||||
const delta = data.lastX - controlX.current;
|
||||
let offsetTime = Math.round(Math.round(delta / snapValue * baseMoveTime * scale) / minimalMoveTime) * minimalMoveTime;
|
||||
offsetTime = Math.min(Math.max(
|
||||
offsetTime,
|
||||
-track.offsetTime), commonStore.trackTotalTime - track.offsetTime);
|
||||
|
||||
const tracks = commonStore.tracks.slice();
|
||||
tracks[trackIndex].offsetTime += offsetTime;
|
||||
commonStore.setTracks(tracks);
|
||||
refreshTracksTotalTime();
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className={`p-1 cursor-move rounded whitespace-nowrap overflow-hidden ${trackClass}`}
|
||||
style={{
|
||||
width: `${Math.max(minimalTrackWidth,
|
||||
track.contentTime / (baseMoveTime * scale) * snapValue
|
||||
)}px`
|
||||
}}
|
||||
onClick={() => onSelect(id)}
|
||||
>
|
||||
<span className="text-white">{trackName}</span>
|
||||
</div>
|
||||
</Draggable>
|
||||
);
|
||||
});
|
||||
|
||||
const AudiotrackEditor: FC<{ setPrompt: (prompt: string) => void }> = observer(({ setPrompt }) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const viewControlsContainerRef = useRef<HTMLDivElement>(null);
|
||||
const currentTimeControlRef = useRef<HTMLDivElement>(null);
|
||||
const playStartTimeControlRef = useRef<HTMLDivElement>(null);
|
||||
const tracksEndLineRef = useRef<HTMLDivElement>(null);
|
||||
const tracksRef = useRef<HTMLDivElement>(null);
|
||||
const toolbarRef = useRef<HTMLDivElement>(null);
|
||||
const toolbarButtonRef = useRef<HTMLDivElement>(null);
|
||||
const toolbarSliderRef = useRef<HTMLInputElement>(null);
|
||||
const contentPreviewRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
const [refreshRef, setRefreshRef] = useState(false);
|
||||
|
||||
const windowSize = useWindowSize();
|
||||
const scale = (scaleMin + scaleMax) - commonStore.trackScale;
|
||||
|
||||
const [selectedTrackId, setSelectedTrackId] = useState<string>('');
|
||||
const playStartTimeControlX = useRef(0);
|
||||
const selectedTrack = selectedTrackId ? commonStore.tracks.find(t => t.id === selectedTrackId) : undefined;
|
||||
|
||||
useEffect(() => {
|
||||
if (toolbarSliderRef.current && toolbarSliderRef.current.parentElement)
|
||||
toolbarSliderRef.current.parentElement.style.removeProperty('--fui-Slider--steps-percent');
|
||||
}, []);
|
||||
|
||||
const scrollContentToBottom = () => {
|
||||
if (contentPreviewRef.current)
|
||||
contentPreviewRef.current.scrollTop = contentPreviewRef.current.scrollHeight;
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
scrollContentToBottom();
|
||||
}, [commonStore.recordingContent]);
|
||||
|
||||
useEffect(() => {
|
||||
setRefreshRef(!refreshRef);
|
||||
}, [windowSize, commonStore.tracks]);
|
||||
|
||||
const viewControlsContainerWidth = (toolbarRef.current && toolbarButtonRef.current && toolbarSliderRef.current) ?
|
||||
toolbarRef.current.clientWidth - toolbarButtonRef.current.clientWidth - toolbarSliderRef.current.clientWidth - 16 // 16 = ml-2 mr-2
|
||||
: 0;
|
||||
const tracksWidth = viewControlsContainerWidth;
|
||||
const timeOfTracksWidth = Math.floor(tracksWidth / snapValue) // number of moves
|
||||
* baseMoveTime * scale;
|
||||
const currentTimeControlWidth = (timeOfTracksWidth < commonStore.trackTotalTime)
|
||||
? timeOfTracksWidth / commonStore.trackTotalTime * viewControlsContainerWidth
|
||||
: 0;
|
||||
const playStartTimeControlPosition = (commonStore.trackPlayStartTime - commonStore.trackCurrentTime) / (baseMoveTime * scale) * snapValue;
|
||||
const tracksEndPosition = (commonStore.trackTotalTime - commonStore.trackCurrentTime) / (baseMoveTime * scale) * snapValue;
|
||||
const moveableTracksWidth = (tracksEndLineRef.current && viewControlsContainerRef.current &&
|
||||
((tracksEndLineRef.current.getBoundingClientRect().left - (viewControlsContainerRef.current.getBoundingClientRect().left + trackInitOffsetPx)) > 0))
|
||||
? tracksEndLineRef.current.getBoundingClientRect().left - (viewControlsContainerRef.current.getBoundingClientRect().left + trackInitOffsetPx)
|
||||
: Infinity;
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-2 overflow-hidden" style={{ width: '80vw', height: '80vh' }}>
|
||||
<div className="mx-auto">
|
||||
<Text size={100}>{`${commonStore.trackPlayStartTime} ms / ${commonStore.trackTotalTime} ms`}</Text>
|
||||
</div>
|
||||
<div className="flex pb-2 border-b" ref={toolbarRef}>
|
||||
<div className="flex gap-2" ref={toolbarButtonRef}>
|
||||
<ToolTipButton disabled desc={t('Play All') + ' (Unavailable)'} icon={<Play16Regular />} />
|
||||
<ToolTipButton desc={t('Clear All')} icon={<Delete16Regular />} onClick={() => {
|
||||
commonStore.setTracks([]);
|
||||
commonStore.setTrackScale(1);
|
||||
commonStore.setTrackTotalTime(tracksMinimalTotalTime);
|
||||
commonStore.setTrackCurrentTime(0);
|
||||
commonStore.setTrackPlayStartTime(0);
|
||||
}} />
|
||||
</div>
|
||||
<div className="grow">
|
||||
<div className="flex flex-col ml-2 mr-2" ref={viewControlsContainerRef}>
|
||||
<div className="relative">
|
||||
<Tooltip content={`${commonStore.trackTotalTime} ms`} showDelay={0} hideDelay={0}
|
||||
relationship="description">
|
||||
<div className="border-l absolute"
|
||||
ref={tracksEndLineRef}
|
||||
style={{
|
||||
height: (tracksRef.current && commonStore.tracks.length > 0)
|
||||
? tracksRef.current.clientHeight - arrowIconToTracks
|
||||
: 0,
|
||||
top: `${topToArrowIcon + arrowIconToTracks}px`,
|
||||
left: `${tracksEndPosition + trackInitOffsetPx - pixelFix}px`
|
||||
}} />
|
||||
</Tooltip>
|
||||
</div>
|
||||
<Draggable axis="x" bounds={{
|
||||
left: 0,
|
||||
right: viewControlsContainerWidth - currentTimeControlWidth
|
||||
}}
|
||||
position={{
|
||||
x: commonStore.trackCurrentTime / commonStore.trackTotalTime * viewControlsContainerWidth,
|
||||
y: 0
|
||||
}}
|
||||
onDrag={(e, data) => {
|
||||
setTimeout(() => {
|
||||
let offset = 0;
|
||||
if (currentTimeControlRef.current) {
|
||||
const match = currentTimeControlRef.current.style.transform.match(/translate\((.+)px,/);
|
||||
if (match)
|
||||
offset = parseFloat(match[1]);
|
||||
}
|
||||
const offsetTime = commonStore.trackTotalTime / viewControlsContainerWidth * offset;
|
||||
commonStore.setTrackCurrentTime(offsetTime);
|
||||
}, 1);
|
||||
}}
|
||||
>
|
||||
<div ref={currentTimeControlRef}
|
||||
className={classnames('h-2 cursor-move rounded', commonStore.settings.darkMode ? 'bg-neutral-600' : 'bg-gray-700')}
|
||||
style={{ width: currentTimeControlWidth }} />
|
||||
</Draggable>
|
||||
<div className={classnames(
|
||||
'flex',
|
||||
(playStartTimeControlPosition < 0 || playStartTimeControlPosition > viewControlsContainerWidth)
|
||||
&& 'hidden'
|
||||
)}>
|
||||
<Draggable axis="x" bounds={{
|
||||
left: 0,
|
||||
right: (playStartTimeControlRef.current)
|
||||
? Math.min(viewControlsContainerWidth - playStartTimeControlRef.current.clientWidth, moveableTracksWidth)
|
||||
: 0
|
||||
}}
|
||||
grid={[snapValue, snapValue]}
|
||||
position={{ x: playStartTimeControlPosition, y: 0 }}
|
||||
onStart={(e, data) => {
|
||||
playStartTimeControlX.current = data.lastX;
|
||||
}}
|
||||
onStop={(e, data) => {
|
||||
const delta = data.lastX - playStartTimeControlX.current;
|
||||
let offsetTime = Math.round(Math.round(delta / snapValue * baseMoveTime * scale) / minimalMoveTime) * minimalMoveTime;
|
||||
offsetTime = Math.min(Math.max(
|
||||
offsetTime,
|
||||
-commonStore.trackPlayStartTime), commonStore.trackTotalTime - commonStore.trackPlayStartTime);
|
||||
commonStore.setTrackPlayStartTime(commonStore.trackPlayStartTime + offsetTime);
|
||||
}}
|
||||
>
|
||||
<div className="relative cursor-move"
|
||||
ref={playStartTimeControlRef}>
|
||||
<ArrowAutofitWidth20Regular />
|
||||
<div
|
||||
className={classnames('border-l absolute', commonStore.settings.darkMode ? 'border-white' : 'border-gray-700')}
|
||||
style={{
|
||||
height: (tracksRef.current && commonStore.tracks.length > 0)
|
||||
? tracksRef.current.clientHeight
|
||||
: 0,
|
||||
top: '50%',
|
||||
left: `calc(50% - ${pixelFix}px)`
|
||||
}} />
|
||||
</div>
|
||||
</Draggable>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<Tooltip content={t('Scale View')! + ': ' + commonStore.trackScale} showDelay={0} hideDelay={0}
|
||||
relationship="description">
|
||||
<Slider ref={toolbarSliderRef} value={commonStore.trackScale} step={scaleMin} max={scaleMax} min={scaleMin}
|
||||
onChange={(e, data) => {
|
||||
commonStore.setTrackScale(data.value);
|
||||
}}
|
||||
/>
|
||||
</Tooltip>
|
||||
</div>
|
||||
<div className="flex flex-col overflow-y-auto gap-1" ref={tracksRef}>
|
||||
{commonStore.tracks.map(track =>
|
||||
<div key={track.id} className="flex gap-2 pb-1 border-b">
|
||||
<div className="flex gap-1 border-r h-7">
|
||||
<ToolTipButton desc={commonStore.recordingTrackId === track.id ? t('Stop') : t('Record')}
|
||||
icon={commonStore.recordingTrackId === track.id ? <Stop16Filled /> : <Record16Regular />}
|
||||
size="small" shape="circular" appearance="subtle"
|
||||
onClick={() => {
|
||||
flushMidiRecordingContent();
|
||||
commonStore.setPlayingTrackId('');
|
||||
|
||||
if (commonStore.recordingTrackId === track.id) {
|
||||
commonStore.setRecordingTrackId('');
|
||||
} else {
|
||||
if (commonStore.activeMidiDeviceIndex === -1) {
|
||||
toast(t('Please select a MIDI device first'), { type: 'warning' });
|
||||
return;
|
||||
}
|
||||
|
||||
dropRecordingTime = true;
|
||||
setSelectedTrackId(track.id);
|
||||
|
||||
commonStore.setRecordingTrackId(track.id);
|
||||
commonStore.setRecordingContent(track.content);
|
||||
commonStore.setRecordingRawContent(track.rawContent.slice());
|
||||
}
|
||||
}} />
|
||||
<ToolTipButton disabled
|
||||
desc={commonStore.playingTrackId === track.id ? t('Stop') : t('Play') + ' (Unavailable)'}
|
||||
icon={commonStore.playingTrackId === track.id ? <Pause16Regular /> : <Play16Filled />}
|
||||
size="small" shape="circular" appearance="subtle"
|
||||
onClick={() => {
|
||||
flushMidiRecordingContent();
|
||||
commonStore.setRecordingTrackId('');
|
||||
|
||||
if (commonStore.playingTrackId === track.id) {
|
||||
commonStore.setPlayingTrackId('');
|
||||
} else {
|
||||
setSelectedTrackId(track.id);
|
||||
|
||||
commonStore.setPlayingTrackId(track.id);
|
||||
}
|
||||
}} />
|
||||
<ToolTipButton desc={t('Delete')} icon={<Delete16Regular />} size="small" shape="circular"
|
||||
appearance="subtle" onClick={() => {
|
||||
const tracks = commonStore.tracks.slice().filter(t => t.id !== track.id);
|
||||
commonStore.setTracks(tracks);
|
||||
refreshTracksTotalTime();
|
||||
}} />
|
||||
</div>
|
||||
<div className="relative grow overflow-hidden">
|
||||
<div className="absolute" style={{ left: -0 }}>
|
||||
<Track
|
||||
id={track.id}
|
||||
scale={scale}
|
||||
right={Math.min(tracksWidth, moveableTracksWidth)}
|
||||
isSelected={selectedTrackId === track.id}
|
||||
onSelect={setSelectedTrackId}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>)}
|
||||
<div className="flex justify-between items-center">
|
||||
<Button icon={<Add16Regular />} size="small" shape="circular"
|
||||
appearance="subtle"
|
||||
onClick={() => {
|
||||
commonStore.setTracks([...commonStore.tracks, {
|
||||
id: uuid(),
|
||||
mainInstrument: '',
|
||||
content: '',
|
||||
rawContent: [],
|
||||
offsetTime: 0,
|
||||
contentTime: 0
|
||||
}]);
|
||||
}}>
|
||||
{t('New Track')}
|
||||
</Button>
|
||||
<Text size={100}>
|
||||
{t('Select a track to preview the content')}
|
||||
</Text>
|
||||
</div>
|
||||
</div>
|
||||
<div className="grow"></div>
|
||||
{selectedTrack &&
|
||||
<Card size="small" appearance="outline" style={{ minHeight: '150px', maxHeight: '200px' }}>
|
||||
<div className="flex flex-col gap-1 overflow-hidden">
|
||||
<Text size={100}>{`${t('Start Time')}: ${selectedTrack.offsetTime} ms`}</Text>
|
||||
<Text size={100}>{`${t('Content Duration')}: ${selectedTrack.contentTime} ms`}</Text>
|
||||
<div className="overflow-y-auto overflow-x-hidden" ref={contentPreviewRef}>
|
||||
{selectedTrackId === commonStore.recordingTrackId
|
||||
? commonStore.recordingContent
|
||||
: selectedTrack.content}
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
}
|
||||
<DialogTrigger disableButtonEnhancement>
|
||||
<Button icon={<MusicNote220Regular />} style={{ minHeight: '32px' }} onClick={() => {
|
||||
flushMidiRecordingContent();
|
||||
commonStore.setRecordingTrackId('');
|
||||
commonStore.setPlayingTrackId('');
|
||||
|
||||
const timestamp = [];
|
||||
const sortedTracks = commonStore.tracks.slice().sort((a, b) => a.offsetTime - b.offsetTime);
|
||||
for (const track of sortedTracks) {
|
||||
timestamp.push(track.offsetTime);
|
||||
let accContentTime = 0;
|
||||
for (const msg of track.rawContent) {
|
||||
if (msg.messageType === 'ElapsedTime') {
|
||||
accContentTime += msg.value;
|
||||
timestamp.push(track.offsetTime + accContentTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
const sortedTimestamp = timestamp.slice().sort((a, b) => a - b);
|
||||
const globalMessages: MidiMessage[] = sortedTimestamp.reduce((messages, current, i) =>
|
||||
[...messages, {
|
||||
messageType: 'ElapsedTime',
|
||||
value: current - (i === 0 ? 0 : sortedTimestamp[i - 1])
|
||||
} as MidiMessage]
|
||||
, [] as MidiMessage[]);
|
||||
for (const track of sortedTracks) {
|
||||
let currentTime = track.offsetTime;
|
||||
let accContentTime = 0;
|
||||
for (const msg of track.rawContent) {
|
||||
if (msg.messageType === 'ElapsedTime') {
|
||||
accContentTime += msg.value;
|
||||
currentTime = track.offsetTime + accContentTime;
|
||||
} else if (msg.messageType === 'NoteOn' || msg.messageType === 'NoteOff') {
|
||||
const insertIndex = sortedTimestamp.findIndex(t => t >= currentTime);
|
||||
globalMessages.splice(insertIndex + 1, 0, msg);
|
||||
sortedTimestamp.splice(insertIndex + 1, 0, 0); // placeholder
|
||||
}
|
||||
}
|
||||
}
|
||||
const result = ('<pad> ' + globalMessages.map(m => midiMessageToToken(m)).join('')).trim();
|
||||
commonStore.setCompositionSubmittedPrompt(result);
|
||||
setPrompt(result);
|
||||
}}>
|
||||
{t('Save to generation area')}
|
||||
</Button>
|
||||
</DialogTrigger>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
||||
export default AudiotrackEditor;
|
||||
@@ -28,12 +28,13 @@ import { toast } from 'react-toastify';
|
||||
import { WorkHeader } from '../components/WorkHeader';
|
||||
import { DialogButton } from '../components/DialogButton';
|
||||
import { OpenFileFolder, OpenOpenFileDialog, OpenSaveFileDialog } from '../../wailsjs/go/backend_golang/App';
|
||||
import { absPathAsset, bytesToReadable, getServerRoot, toastWithButton } from '../utils';
|
||||
import { absPathAsset, bytesToReadable, getServerRoot, setActivePreset, toastWithButton } from '../utils';
|
||||
import { useMediaQuery } from 'usehooks-ts';
|
||||
import { botName, ConversationMessage, MessageType, userName, welcomeUuid } from '../types/chat';
|
||||
import { Labeled } from '../components/Labeled';
|
||||
import { ValuedSlider } from '../components/ValuedSlider';
|
||||
import { PresetsButton } from './PresetsManager/PresetsButton';
|
||||
import { webOpenOpenFileDialog } from '../utils/web-file-operations';
|
||||
|
||||
let chatSseControllers: {
|
||||
[id: string]: AbortController
|
||||
@@ -515,6 +516,7 @@ const ChatPanel: FC = observer(() => {
|
||||
<div className="flex h-full grow pt-4 overflow-hidden">
|
||||
<div className="relative flex flex-col w-full grow gap-4 overflow-hidden">
|
||||
<Button className="absolute top-1 right-1" size="medium" shape="circular" appearance="subtle"
|
||||
style={{ zIndex: 1 }}
|
||||
icon={commonStore.sidePanelCollapsed ? <TextAlignJustify24Regular /> : <TextAlignJustifyRotate9024Regular />}
|
||||
onClick={() => commonStore.setSidePanelCollapsed(!commonStore.sidePanelCollapsed)} />
|
||||
<div ref={bodyRef} className="grow overflow-y-scroll overflow-x-hidden pr-2">
|
||||
@@ -534,8 +536,7 @@ const ChatPanel: FC = observer(() => {
|
||||
}
|
||||
chatSseControllers = {};
|
||||
}
|
||||
commonStore.setConversation({});
|
||||
commonStore.setConversationOrder([]);
|
||||
setActivePreset(commonStore.activePreset);
|
||||
}} />
|
||||
<div className="relative flex grow">
|
||||
<Textarea
|
||||
@@ -559,43 +560,42 @@ const ChatPanel: FC = observer(() => {
|
||||
: <Attach16Regular />}
|
||||
size="small" shape="circular" appearance="secondary"
|
||||
onClick={() => {
|
||||
if (commonStore.status.status === ModelStatus.Offline && !commonStore.settings.apiUrl && commonStore.platform !== 'web') {
|
||||
toast(t('Please click the button in the top right corner to start the model'), { type: 'warning' });
|
||||
return;
|
||||
}
|
||||
|
||||
if (commonStore.attachmentUploading)
|
||||
return;
|
||||
|
||||
OpenOpenFileDialog('*.txt;*.pdf').then(async filePath => {
|
||||
if (!filePath)
|
||||
return;
|
||||
const filterPattern = '*.txt;*.pdf';
|
||||
const setUploading = () => commonStore.setAttachmentUploading(true);
|
||||
// actually, status of web platform is always Offline
|
||||
if (commonStore.platform === 'web' || commonStore.status.status === ModelStatus.Offline || currentConfig.modelParameters.device === 'WebGPU') {
|
||||
webOpenOpenFileDialog({ filterPattern, fnStartLoading: setUploading }).then(webReturn => {
|
||||
if (webReturn.content)
|
||||
commonStore.setCurrentTempAttachment(
|
||||
{
|
||||
name: webReturn.blob.name,
|
||||
size: webReturn.blob.size,
|
||||
content: webReturn.content
|
||||
});
|
||||
else
|
||||
toast(t('File is empty'), {
|
||||
type: 'info',
|
||||
autoClose: 1000
|
||||
});
|
||||
}).catch(e => {
|
||||
toast(t('Error') + ' - ' + (e.message || e), { type: 'error', autoClose: 2500 });
|
||||
}).finally(() => {
|
||||
commonStore.setAttachmentUploading(false);
|
||||
});
|
||||
} else {
|
||||
OpenOpenFileDialog(filterPattern).then(async filePath => {
|
||||
if (!filePath)
|
||||
return;
|
||||
|
||||
commonStore.setAttachmentUploading(true);
|
||||
setUploading();
|
||||
|
||||
let blob: Blob;
|
||||
let attachmentName: string | undefined;
|
||||
let attachmentContent: string | undefined;
|
||||
if (commonStore.platform === 'web') {
|
||||
const webReturn = filePath as any;
|
||||
blob = webReturn.blob;
|
||||
attachmentName = blob.name;
|
||||
attachmentContent = webReturn.content;
|
||||
} else {
|
||||
// Both are slow. Communication between frontend and backend is slow. Use AssetServer Handler to read the file.
|
||||
// const blob = new Blob([atob(info.content as unknown as string)]); // await fetch(`data:application/octet-stream;base64,${info.content}`).then(r => r.blob());
|
||||
blob = await fetch(absPathAsset(filePath)).then(r => r.blob());
|
||||
attachmentName = filePath.split(/[\\/]/).pop();
|
||||
}
|
||||
if (attachmentContent) {
|
||||
commonStore.setCurrentTempAttachment(
|
||||
{
|
||||
name: attachmentName!,
|
||||
size: blob.size,
|
||||
content: attachmentContent
|
||||
});
|
||||
commonStore.setAttachmentUploading(false);
|
||||
} else {
|
||||
const blob = await fetch(absPathAsset(filePath)).then(r => r.blob());
|
||||
const attachmentName = filePath.split(/[\\/]/).pop();
|
||||
const urlPath = `/file-to-text?file_name=${attachmentName}`;
|
||||
const bodyForm = new FormData();
|
||||
bodyForm.append('file_data', blob, attachmentName);
|
||||
@@ -605,31 +605,38 @@ const ChatPanel: FC = observer(() => {
|
||||
}).then(async r => {
|
||||
if (r.status === 200) {
|
||||
const pages = (await r.json()).pages as any[];
|
||||
let attachmentContent: string;
|
||||
if (pages.length === 1)
|
||||
attachmentContent = pages[0].page_content;
|
||||
else
|
||||
attachmentContent = pages.map((p, i) => `Page ${i + 1}:\n${p.page_content}`).join('\n\n');
|
||||
commonStore.setCurrentTempAttachment(
|
||||
{
|
||||
name: attachmentName!,
|
||||
size: blob.size,
|
||||
content: attachmentContent!
|
||||
if (attachmentContent)
|
||||
commonStore.setCurrentTempAttachment(
|
||||
{
|
||||
name: attachmentName!,
|
||||
size: blob.size,
|
||||
content: attachmentContent!
|
||||
});
|
||||
else
|
||||
toast(t('File is empty'), {
|
||||
type: 'info',
|
||||
autoClose: 1000
|
||||
});
|
||||
} else {
|
||||
toast(r.statusText + '\n' + (await r.text()), {
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
commonStore.setAttachmentUploading(false);
|
||||
}
|
||||
).catch(e => {
|
||||
commonStore.setAttachmentUploading(false);
|
||||
toast(t('Error') + ' - ' + (e.message || e), { type: 'error', autoClose: 2500 });
|
||||
}).finally(() => {
|
||||
commonStore.setAttachmentUploading(false);
|
||||
});
|
||||
}
|
||||
}).catch(e => {
|
||||
toast(t('Error') + ' - ' + (e.message || e), { type: 'error', autoClose: 2500 });
|
||||
});
|
||||
}).catch(e => {
|
||||
toast(t('Error') + ' - ' + (e.message || e), { type: 'error', autoClose: 2500 });
|
||||
});
|
||||
}
|
||||
}}
|
||||
/> :
|
||||
<div>
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'html-midi-player';
|
||||
import React, { FC, useEffect, useRef } from 'react';
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import { WorkHeader } from '../components/WorkHeader';
|
||||
import { Button, Checkbox, Textarea } from '@fluentui/react-components';
|
||||
import { Button, Checkbox, Dropdown, Option, Textarea } from '@fluentui/react-components';
|
||||
import { Labeled } from '../components/Labeled';
|
||||
import { ValuedSlider } from '../components/ValuedSlider';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
@@ -16,10 +16,17 @@ import { PlayerElement, VisualizerElement } from 'html-midi-player';
|
||||
import * as mm from '@magenta/music/esm/core.js';
|
||||
import { NoteSequence } from '@magenta/music/esm/protobuf.js';
|
||||
import { defaultCompositionPrompt } from './defaultConfigs';
|
||||
import { FileExists, OpenFileFolder, OpenSaveFileDialogBytes } from '../../wailsjs/go/backend_golang/App';
|
||||
import { getServerRoot, toastWithButton } from '../utils';
|
||||
import {
|
||||
CloseMidiPort,
|
||||
FileExists,
|
||||
OpenFileFolder,
|
||||
OpenMidiPort,
|
||||
OpenSaveFileDialogBytes
|
||||
} from '../../wailsjs/go/backend_golang/App';
|
||||
import { getServerRoot, getSoundFont, toastWithButton } from '../utils';
|
||||
import { CompositionParams } from '../types/composition';
|
||||
import { useMediaQuery } from 'usehooks-ts';
|
||||
import { AudiotrackButton } from './AudiotrackManager/AudiotrackButton';
|
||||
|
||||
let compositionSseController: AbortController | null = null;
|
||||
|
||||
@@ -64,20 +71,8 @@ const CompositionPanel: FC = observer(() => {
|
||||
};
|
||||
|
||||
const setSoundFont = async () => {
|
||||
let soundUrl: string;
|
||||
if (commonStore.compositionParams.useLocalSoundFont)
|
||||
soundUrl = 'assets/sound-font';
|
||||
else
|
||||
soundUrl = !commonStore.settings.giteeUpdatesSource ?
|
||||
`https://raw.githubusercontent.com/josStorer/sgm_plus/master` :
|
||||
`https://gitee.com/josc146/sgm_plus/raw/master`;
|
||||
const fallbackUrl = 'https://cdn.jsdelivr.net/gh/josstorer/sgm_plus';
|
||||
await fetch(soundUrl + '/soundfont.json').then(r => {
|
||||
if (!r.ok)
|
||||
soundUrl = fallbackUrl;
|
||||
}).catch(() => soundUrl = fallbackUrl);
|
||||
if (playerRef.current) {
|
||||
playerRef.current.soundFont = soundUrl;
|
||||
playerRef.current.soundFont = await getSoundFont();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -103,6 +98,13 @@ const CompositionPanel: FC = observer(() => {
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (!(commonStore.activeMidiDeviceIndex in commonStore.midiPorts)) {
|
||||
commonStore.setActiveMidiDeviceIndex(-1);
|
||||
CloseMidiPort();
|
||||
}
|
||||
}, [commonStore.midiPorts]);
|
||||
|
||||
const generateNs = (autoPlay: boolean) => {
|
||||
fetch(getServerRoot(port) + '/text-to-midi', {
|
||||
method: 'POST',
|
||||
@@ -121,7 +123,9 @@ const CompositionPanel: FC = observer(() => {
|
||||
});
|
||||
updateNs(ns);
|
||||
if (autoPlay) {
|
||||
playerRef.current?.start();
|
||||
setTimeout(() => {
|
||||
playerRef.current?.start();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -267,6 +271,38 @@ const CompositionPanel: FC = observer(() => {
|
||||
autoPlay: data.checked as boolean
|
||||
});
|
||||
}} />
|
||||
{commonStore.platform !== 'web' &&
|
||||
<Labeled flex breakline label={t('MIDI Input')}
|
||||
desc={t('Select the MIDI input device to be used.')}
|
||||
content={
|
||||
<div className="flex flex-col gap-1">
|
||||
<Dropdown style={{ minWidth: 0 }}
|
||||
value={(commonStore.activeMidiDeviceIndex === -1 || !(commonStore.activeMidiDeviceIndex in commonStore.midiPorts))
|
||||
? t('None')!
|
||||
: commonStore.midiPorts[commonStore.activeMidiDeviceIndex].name}
|
||||
selectedOptions={[commonStore.activeMidiDeviceIndex.toString()]}
|
||||
onOptionSelect={(_, data) => {
|
||||
if (data.optionValue) {
|
||||
const index = Number(data.optionValue);
|
||||
let action = (index === -1)
|
||||
? () => CloseMidiPort()
|
||||
: () => OpenMidiPort(index);
|
||||
action().then(() => {
|
||||
commonStore.setActiveMidiDeviceIndex(index);
|
||||
}).catch((e) => {
|
||||
toast(t('Error') + ' - ' + (e.message || e), { type: 'error', autoClose: 2500 });
|
||||
});
|
||||
}
|
||||
}}>
|
||||
<Option value={'-1'}>{t('None')!}</Option>
|
||||
{commonStore.midiPorts.map((p, i) =>
|
||||
<Option key={i} value={i.toString()}>{p.name}</Option>)
|
||||
}
|
||||
</Dropdown>
|
||||
<AudiotrackButton setPrompt={setPrompt} />
|
||||
</div>
|
||||
} />
|
||||
}
|
||||
</div>
|
||||
<div className="flex justify-between gap-2">
|
||||
<ToolTipButton desc={t('Regenerate')} icon={<ArrowSync20Regular />} onClick={() => {
|
||||
|
||||
@@ -8,12 +8,13 @@ import {
|
||||
Input,
|
||||
Label,
|
||||
Option,
|
||||
PresenceBadge,
|
||||
Select,
|
||||
Switch,
|
||||
Text
|
||||
} from '@fluentui/react-components';
|
||||
import { AddCircle20Regular, DataUsageSettings20Regular, Delete20Regular, Save20Regular } from '@fluentui/react-icons';
|
||||
import React, { FC, useEffect, useRef } from 'react';
|
||||
import React, { FC, useCallback, useEffect, useRef } from 'react';
|
||||
import { Section } from '../components/Section';
|
||||
import { Labeled } from '../components/Labeled';
|
||||
import { ToolTipButton } from '../components/ToolTipButton';
|
||||
@@ -26,7 +27,7 @@ import { Page } from '../components/Page';
|
||||
import { useNavigate } from 'react-router';
|
||||
import { RunButton } from '../components/RunButton';
|
||||
import { updateConfig } from '../apis';
|
||||
import { ConvertModel, ConvertSafetensors, FileExists, GetPyError } from '../../wailsjs/go/backend_golang/App';
|
||||
import { ConvertModel, FileExists, GetPyError } from '../../wailsjs/go/backend_golang/App';
|
||||
import { checkDependencies, getStrategy } from '../utils';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { WindowShow } from '../../wailsjs/runtime';
|
||||
@@ -35,6 +36,29 @@ import strategyZhImg from '../assets/images/strategy_zh.jpg';
|
||||
import { ResetConfigsButton } from '../components/ResetConfigsButton';
|
||||
import { useMediaQuery } from 'usehooks-ts';
|
||||
import { ApiParameters, Device, ModelParameters, Precision } from '../types/configs';
|
||||
import { convertToSt } from '../utils/convert-to-st';
|
||||
|
||||
const ConfigSelector: FC<{ selectedIndex: number, updateSelectedIndex: (i: number) => void }> = observer(({ selectedIndex, updateSelectedIndex }) => {
|
||||
return (
|
||||
<Dropdown style={{ minWidth: 0 }} className="grow" value={commonStore.modelConfigs[selectedIndex].name}
|
||||
selectedOptions={[selectedIndex.toString()]}
|
||||
onOptionSelect={(_, data) => {
|
||||
if (data.optionValue) {
|
||||
updateSelectedIndex(Number(data.optionValue));
|
||||
}
|
||||
}}>
|
||||
{commonStore.modelConfigs.map((config, index) => <Option key={index} value={index.toString()}
|
||||
text={config.name}>
|
||||
<div className="flex justify-between grow">
|
||||
{config.name}
|
||||
{commonStore.modelSourceList.find(item => item.name === config.modelParameters.modelName)?.isComplete
|
||||
&& <PresenceBadge status="available" />}
|
||||
</div>
|
||||
</Option>
|
||||
)}
|
||||
</Dropdown>
|
||||
);
|
||||
});
|
||||
|
||||
const Configs: FC = observer(() => {
|
||||
const { t } = useTranslation();
|
||||
@@ -51,13 +75,13 @@ const Configs: FC = observer(() => {
|
||||
(advancedHeaderRef.current.firstElementChild as HTMLElement).style.padding = '0';
|
||||
}, []);
|
||||
|
||||
const updateSelectedIndex = (newIndex: number) => {
|
||||
const updateSelectedIndex = useCallback((newIndex: number) => {
|
||||
setSelectedIndex(newIndex);
|
||||
setSelectedConfig(commonStore.modelConfigs[newIndex]);
|
||||
|
||||
// if you don't want to update the config used by the current startup in real time, comment out this line
|
||||
commonStore.setCurrentConfigIndex(newIndex);
|
||||
};
|
||||
}, []);
|
||||
|
||||
const setSelectedConfigName = (newName: string) => {
|
||||
setSelectedConfig({ ...selectedConfig, name: newName });
|
||||
@@ -97,17 +121,7 @@ const Configs: FC = observer(() => {
|
||||
<Page title={t('Configs')} content={
|
||||
<div className="flex flex-col gap-2 overflow-hidden">
|
||||
<div className="flex gap-2 items-center">
|
||||
<Dropdown style={{ minWidth: 0 }} className="grow" value={commonStore.modelConfigs[selectedIndex].name}
|
||||
selectedOptions={[selectedIndex.toString()]}
|
||||
onOptionSelect={(_, data) => {
|
||||
if (data.optionValue) {
|
||||
updateSelectedIndex(Number(data.optionValue));
|
||||
}
|
||||
}}>
|
||||
{commonStore.modelConfigs.map((config, index) =>
|
||||
<Option key={index} value={index.toString()}>{config.name}</Option>
|
||||
)}
|
||||
</Dropdown>
|
||||
<ConfigSelector selectedIndex={selectedIndex} updateSelectedIndex={updateSelectedIndex} />
|
||||
<ToolTipButton desc={t('New Config')} icon={<AddCircle20Regular />} onClick={() => {
|
||||
commonStore.createModelConfig();
|
||||
updateSelectedIndex(commonStore.modelConfigs.length - 1);
|
||||
@@ -272,41 +286,7 @@ const Configs: FC = observer(() => {
|
||||
}} /> :
|
||||
<ToolTipButton text={t('Convert To Safe Tensors Format')}
|
||||
desc=""
|
||||
onClick={async () => {
|
||||
if (commonStore.platform === 'darwin') {
|
||||
toast(t('MacOS is not yet supported for performing this operation, please do it manually.') + ' (backend-python/convert_safetensors.py)', { type: 'info' });
|
||||
return;
|
||||
} else if (commonStore.platform === 'linux') {
|
||||
toast(t('Linux is not yet supported for performing this operation, please do it manually.') + ' (backend-python/convert_safetensors.py)', { type: 'info' });
|
||||
return;
|
||||
}
|
||||
|
||||
const ok = await checkDependencies(navigate);
|
||||
if (!ok)
|
||||
return;
|
||||
|
||||
const modelPath = `${commonStore.settings.customModelsPath}/${selectedConfig.modelParameters.modelName}`;
|
||||
if (await FileExists(modelPath)) {
|
||||
toast(t('Start Converting'), { autoClose: 1000, type: 'info' });
|
||||
const newModelPath = modelPath.replace(/\.pth$/, '.st');
|
||||
ConvertSafetensors(commonStore.settings.customPythonPath, modelPath, newModelPath).then(async () => {
|
||||
if (!await FileExists(newModelPath)) {
|
||||
toast(t('Convert Failed') + ' - ' + await GetPyError(), { type: 'error' });
|
||||
} else {
|
||||
toast(`${t('Convert Success')} - ${newModelPath}`, { type: 'success' });
|
||||
}
|
||||
}).catch(e => {
|
||||
const errMsg = e.message || e;
|
||||
if (errMsg.includes('path contains space'))
|
||||
toast(`${t('Convert Failed')} - ${t('File Path Cannot Contain Space')}`, { type: 'error' });
|
||||
else
|
||||
toast(`${t('Convert Failed')} - ${e.message || e}`, { type: 'error' });
|
||||
});
|
||||
setTimeout(WindowShow, 1000);
|
||||
} else {
|
||||
toast(`${t('Model Not Found')} - ${modelPath}`, { type: 'error' });
|
||||
}
|
||||
}} />
|
||||
onClick={() => convertToSt(selectedConfig)} />
|
||||
}
|
||||
<Labeled label={t('Strategy')} content={
|
||||
<Dropdown style={{ minWidth: 0 }} className="grow" value={t(selectedConfig.modelParameters.device)!}
|
||||
@@ -425,7 +405,7 @@ const Configs: FC = observer(() => {
|
||||
});
|
||||
}} />
|
||||
<Input className="grow"
|
||||
placeholder={t('Tokenizer Path (e.g. backend-python/rwkv_pip/20B_tokenizer.json)')!}
|
||||
placeholder={t('Tokenizer Path (e.g. backend-python/rwkv_pip/20B_tokenizer.json or rwkv_vocab_v20230424.txt)')!}
|
||||
value={selectedConfig.modelParameters.customTokenizer}
|
||||
onChange={(e, data) => {
|
||||
setSelectedConfigModelParams({
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import React, { FC } from 'react';
|
||||
import React, { FC, useEffect, useState } from 'react';
|
||||
import {
|
||||
Button,
|
||||
Checkbox,
|
||||
createTableColumn,
|
||||
DataGrid,
|
||||
@@ -154,6 +155,22 @@ const columns: TableColumnDefinition<ModelSourceItem>[] = [
|
||||
|
||||
const Models: FC = observer(() => {
|
||||
const { t } = useTranslation();
|
||||
const [tags, setTags] = useState<Array<string>>([]);
|
||||
const [modelSourceList, setModelSourceList] = useState<ModelSourceItem[]>(commonStore.modelSourceList);
|
||||
|
||||
useEffect(() => {
|
||||
setTags(Array.from(new Set(
|
||||
[...commonStore.modelSourceList.map(item => item.tags || []).flat()
|
||||
.filter(i => !i.includes('Other') && !i.includes('Local'))
|
||||
, 'Other', 'Local'])));
|
||||
}, [commonStore.modelSourceList]);
|
||||
|
||||
useEffect(() => {
|
||||
if (commonStore.activeModelListTags.length === 0)
|
||||
setModelSourceList(commonStore.modelSourceList);
|
||||
else
|
||||
setModelSourceList(commonStore.modelSourceList.filter(item => commonStore.activeModelListTags.some(tag => item.tags?.includes(tag))));
|
||||
}, [commonStore.modelSourceList, commonStore.activeModelListTags]);
|
||||
|
||||
return (
|
||||
<Page title={t('Models')} content={
|
||||
@@ -184,9 +201,24 @@ const Models: FC = observer(() => {
|
||||
value={commonStore.modelSourceManifestList}
|
||||
onChange={(e, data) => commonStore.setModelSourceManifestList(data.value)} />
|
||||
</div>
|
||||
<div className="flex gap-2 flex-wrap overflow-y-auto" style={{ minHeight: '88px' }}>
|
||||
{tags.map(tag =>
|
||||
<div key={tag} className="mt-auto">
|
||||
<Button
|
||||
appearance={commonStore.activeModelListTags.includes(tag) ? 'primary' : 'secondary'} onClick={
|
||||
() => {
|
||||
if (commonStore.activeModelListTags.includes(tag))
|
||||
commonStore.setActiveModelListTags(commonStore.activeModelListTags.filter(t => t !== tag));
|
||||
else
|
||||
commonStore.setActiveModelListTags([...commonStore.activeModelListTags, tag]);
|
||||
}
|
||||
}>{t(tag)}</Button>
|
||||
</div>)
|
||||
}
|
||||
</div>
|
||||
<div className="flex grow overflow-hidden">
|
||||
<DataGrid
|
||||
items={commonStore.modelSourceList}
|
||||
items={modelSourceList}
|
||||
columns={columns}
|
||||
sortable={true}
|
||||
defaultSortState={{ sortColumn: 'actions', sortDirection: 'ascending' }}
|
||||
|
||||
@@ -33,10 +33,8 @@ import { observer } from 'mobx-react-lite';
|
||||
import { ClipboardGetText, ClipboardSetText } from '../../../wailsjs/runtime';
|
||||
import { toast } from 'react-toastify';
|
||||
import { CustomToastContainer } from '../../components/CustomToastContainer';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { absPathAsset } from '../../utils';
|
||||
import { absPathAsset, setActivePreset } from '../../utils';
|
||||
import { Preset, PresetsNavigationItem } from '../../types/presets';
|
||||
import { botName, Conversation, MessageType, userName } from '../../types/chat';
|
||||
import { LazyImportComponent } from '../../components/LazyImportComponent';
|
||||
|
||||
const defaultPreset: Preset = {
|
||||
@@ -52,35 +50,17 @@ const defaultPreset: Preset = {
|
||||
prompt: '',
|
||||
stop: '',
|
||||
injectStart: '',
|
||||
injectEnd: ''
|
||||
injectEnd: '',
|
||||
presystem: true,
|
||||
userName: '',
|
||||
assistantName: ''
|
||||
};
|
||||
|
||||
const MessagesEditor = lazy(() => import('./MessagesEditor'));
|
||||
|
||||
const setActivePreset = (preset: Preset) => {
|
||||
commonStore.setActivePreset(preset);
|
||||
//TODO if (preset.displayPresetMessages) {
|
||||
const conversation: Conversation = {};
|
||||
const conversationOrder: string[] = [];
|
||||
for (const message of preset.messages) {
|
||||
const newUuid = uuid();
|
||||
conversationOrder.push(newUuid);
|
||||
conversation[newUuid] = {
|
||||
sender: message.role === 'user' ? userName : botName,
|
||||
type: MessageType.Normal,
|
||||
color: message.role === 'user' ? 'brand' : 'colorful',
|
||||
time: new Date().toISOString(),
|
||||
content: message.content,
|
||||
side: message.role === 'user' ? 'right' : 'left',
|
||||
done: true
|
||||
};
|
||||
}
|
||||
commonStore.setConversation(conversation);
|
||||
commonStore.setConversationOrder(conversationOrder);
|
||||
//}
|
||||
};
|
||||
|
||||
const PresetCardFrame: FC<PropsWithChildren & { onClick?: () => void }> = (props) => {
|
||||
const PresetCardFrame: FC<PropsWithChildren & {
|
||||
onClick?: React.MouseEventHandler<HTMLButtonElement>
|
||||
}> = (props) => {
|
||||
return <Button
|
||||
className="flex flex-col gap-1 w-32 h-56 break-all"
|
||||
style={{ minWidth: 0, borderRadius: '0.75rem', justifyContent: 'unset' }}
|
||||
@@ -103,7 +83,10 @@ const PresetCard: FC<{
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return <PresetCardFrame onClick={onClick}>
|
||||
return <PresetCardFrame onClick={(e) => {
|
||||
if (onClick && e.currentTarget.contains(e.target as Node))
|
||||
onClick();
|
||||
}}>
|
||||
<img src={absPathAsset(avatarImg)} className="rounded-xl select-none ml-auto mr-auto h-28" />
|
||||
<Text size={400}>{name}</Text>
|
||||
<Text size={200} style={{
|
||||
@@ -116,7 +99,8 @@ const PresetCard: FC<{
|
||||
{editable ?
|
||||
<ChatPresetEditor presetIndex={presetIndex} triggerButton={
|
||||
<ToolTipButton size="small" appearance="transparent" desc={t('Edit')} icon={<Edit20Regular />}
|
||||
onClick={() => {
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
commonStore.setEditingPreset({ ...commonStore.presets[presetIndex] });
|
||||
}} />
|
||||
} />
|
||||
@@ -371,7 +355,9 @@ const ChatPresets: FC = observer(() => {
|
||||
</div>;
|
||||
});
|
||||
|
||||
const pages: { [label: string]: PresetsNavigationItem } = {
|
||||
const pages: {
|
||||
[label: string]: PresetsNavigationItem
|
||||
} = {
|
||||
Chat: {
|
||||
icon: <Chat20Regular />,
|
||||
element: <ChatPresets />
|
||||
@@ -386,7 +372,9 @@ const pages: { [label: string]: PresetsNavigationItem } = {
|
||||
}
|
||||
};
|
||||
|
||||
const PresetsManager: FC<{ initTab: string }> = ({ initTab }) => {
|
||||
const PresetsManager: FC<{
|
||||
initTab: string
|
||||
}> = ({ initTab }) => {
|
||||
const { t } = useTranslation();
|
||||
const [tab, setTab] = useState(initTab);
|
||||
|
||||
|
||||
@@ -66,6 +66,11 @@ const parseLossData = (data: string) => {
|
||||
const loss = parseFloat(lastMatch[8]);
|
||||
commonStore.setChartTitle(`Epoch ${epoch}: ${lastMatch[2]} - ${lastMatch[3]}/${lastMatch[4]} - ${lastMatch[5]}/${lastMatch[6]} - ${lastMatch[7]} Loss=${loss}`);
|
||||
addLossDataToChart(epoch, loss);
|
||||
if (loss > 5)
|
||||
toast(t('Loss is too high, please check the training data, and ensure your gpu driver is up to date.'), {
|
||||
type: 'warning',
|
||||
toastId: 'train_loss_high'
|
||||
});
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -134,6 +139,7 @@ const errorsMap = Object.entries({
|
||||
'cuda_home environment variable is not set': 'Matched CUDA is not installed',
|
||||
'unsupported gpu architecture': 'Matched CUDA is not installed',
|
||||
'error building extension \'fused_adam\'': 'Matched CUDA is not installed',
|
||||
'rwkv{version} is not supported': 'This version of RWKV is not supported yet.',
|
||||
'modelinfo is invalid': 'Failed to load model, try to increase the virtual memory (Swap of WSL) or use a smaller base model.'
|
||||
});
|
||||
|
||||
@@ -464,11 +470,12 @@ const LoraFinetune: FC = observer(() => {
|
||||
return;
|
||||
if (loraParams.loraLoad) {
|
||||
const outputPath = `models/${loraParams.baseModel}-LoRA-${loraParams.loraLoad}`;
|
||||
MergeLora(commonStore.settings.customPythonPath, true, loraParams.loraAlpha,
|
||||
MergeLora(commonStore.settings.customPythonPath, !!commonStore.monitorData && commonStore.monitorData.totalVram !== 0, loraParams.loraAlpha,
|
||||
'models/' + loraParams.baseModel, 'lora-models/' + loraParams.loraLoad,
|
||||
outputPath).then(async () => {
|
||||
if (!await FileExists(outputPath)) {
|
||||
toast(t('Failed to merge model') + ' - ' + await GetPyError(), { type: 'error' });
|
||||
if (commonStore.platform === 'windows' || commonStore.platform === 'linux')
|
||||
toast(t('Failed to merge model') + ' - ' + await GetPyError(), { type: 'error' });
|
||||
} else {
|
||||
toast(t('Merge model successfully'), { type: 'success' });
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ export const defaultPresets: CompletionPreset[] = [{
|
||||
|
||||
export const defaultModelConfigsMac: ModelConfig[] = [
|
||||
{
|
||||
name: 'MAC-0.1B-World',
|
||||
name: 'GPU-2G-1B5-World',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
@@ -121,16 +121,15 @@ export const defaultModelConfigsMac: ModelConfig[] = [
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-World-0.1B-v1-20230520-ctx4096.pth',
|
||||
device: 'MPS',
|
||||
precision: 'fp32',
|
||||
modelName: 'RWKV-5-World-1B5-v2-20231025-ctx4096.pth',
|
||||
device: 'WebGPU',
|
||||
precision: 'nf4',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41,
|
||||
customStrategy: 'mps fp32'
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'MAC-0.4B-World',
|
||||
name: 'GPU-4G-3B-World',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
@@ -140,12 +139,101 @@ export const defaultModelConfigsMac: ModelConfig[] = [
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-World-0.4B-v1-20230529-ctx4096.pth',
|
||||
device: 'MPS',
|
||||
modelName: 'RWKV-5-World-3B-v2-20231118-ctx16k.pth',
|
||||
device: 'WebGPU',
|
||||
precision: 'nf4',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-4G-3B-CN',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-World-CHNtuned-3B-v1-20230625-ctx4096.pth',
|
||||
device: 'WebGPU',
|
||||
precision: 'nf4',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-7G-7B-World',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-World-7B-v1-20230626-ctx4096.pth',
|
||||
device: 'WebGPU',
|
||||
precision: 'nf4',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-7G-7B-CN',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-World-CHNtuned-7B-v1-20230709-ctx4096.pth',
|
||||
device: 'WebGPU',
|
||||
precision: 'nf4',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'CPU-120M-Music',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.8,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-5-MIDI-120M-v1-20230728-ctx4096.pth',
|
||||
device: 'CPU',
|
||||
precision: 'fp32',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41,
|
||||
customStrategy: 'mps fp32'
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'CPU-560M-Music',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.8,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-5-MIDI-560M-v1-20230902-ctx4096.pth',
|
||||
device: 'CPU',
|
||||
precision: 'fp32',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -159,26 +247,7 @@ export const defaultModelConfigsMac: ModelConfig[] = [
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-World-1.5B-v1-fixed-20230612-ctx4096.pth',
|
||||
device: 'MPS',
|
||||
precision: 'fp32',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41,
|
||||
customStrategy: 'mps fp32'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'MAC-1B5-EN',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-Raven-1B5-v12-Eng98%-Other2%-20230520-ctx4096.pth',
|
||||
modelName: 'RWKV-5-World-1B5-v2-20231025-ctx4096.pth',
|
||||
device: 'MPS',
|
||||
precision: 'fp32',
|
||||
storedLayers: 41,
|
||||
@@ -197,26 +266,7 @@ export const defaultModelConfigsMac: ModelConfig[] = [
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-World-3B-v1-20230619-ctx4096.pth',
|
||||
device: 'MPS',
|
||||
precision: 'fp32',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41,
|
||||
customStrategy: 'mps fp32'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'MAC-3B-EN',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-Raven-3B-v12-Eng98%-Other2%-20230520-ctx4096.pth',
|
||||
modelName: 'RWKV-5-World-3B-v2-20231118-ctx16k.pth',
|
||||
device: 'MPS',
|
||||
precision: 'fp32',
|
||||
storedLayers: 41,
|
||||
@@ -261,190 +311,29 @@ export const defaultModelConfigsMac: ModelConfig[] = [
|
||||
maxStoredLayers: 41,
|
||||
customStrategy: 'mps fp32'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'CPU-120M-Music',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.8,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-MIDI-120M-v1-20230714-ctx4096.pth',
|
||||
device: 'CPU',
|
||||
precision: 'fp32',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'CPU-560M-Music',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.8,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-MIDI-560M-v1-20230717-ctx4096.pth',
|
||||
device: 'CPU',
|
||||
precision: 'fp32',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'CPU-6G-1B5-World',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-World-1.5B-v1-fixed-20230612-ctx4096.pth',
|
||||
device: 'CPU',
|
||||
precision: 'fp32',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'CPU-6G-1B5-EN',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-Raven-1B5-v12-Eng98%-Other2%-20230520-ctx4096.pth',
|
||||
device: 'CPU',
|
||||
precision: 'fp32',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'CPU-12G-3B-World',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-World-3B-v1-20230619-ctx4096.pth',
|
||||
device: 'CPU',
|
||||
precision: 'fp32',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'CPU-12G-3B-EN',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-Raven-3B-v12-Eng98%-Other2%-20230520-ctx4096.pth',
|
||||
device: 'CPU',
|
||||
precision: 'fp32',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'CPU-12G-3B-CN',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-World-CHNtuned-3B-v1-20230625-ctx4096.pth',
|
||||
device: 'CPU',
|
||||
precision: 'fp32',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'CPU-28G-7B-World',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-World-7B-v1-20230626-ctx4096.pth',
|
||||
device: 'CPU',
|
||||
precision: 'fp32',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'CPU-28G-7B-EN',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-Raven-7B-v12-Eng98%-Other2%-20230521-ctx8192.pth',
|
||||
device: 'CPU',
|
||||
precision: 'fp32',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'CPU-28G-7B-CN',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-World-CHNtuned-7B-v1-20230709-ctx4096.pth',
|
||||
device: 'CPU',
|
||||
precision: 'fp32',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
export const defaultModelConfigs: ModelConfig[] = [
|
||||
{
|
||||
name: 'GPU-2G-1B5-World',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-5-World-1B5-v2-20231025-ctx4096.pth',
|
||||
device: 'CUDA',
|
||||
precision: 'int8',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41,
|
||||
useCustomCuda: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-2G-3B-World',
|
||||
apiParameters: {
|
||||
@@ -456,7 +345,7 @@ export const defaultModelConfigs: ModelConfig[] = [
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-World-3B-v1-20230619-ctx4096.pth',
|
||||
modelName: 'RWKV-5-World-3B-v2-20231118-ctx16k.pth',
|
||||
device: 'CUDA',
|
||||
precision: 'int8',
|
||||
storedLayers: 6,
|
||||
@@ -464,61 +353,6 @@ export const defaultModelConfigs: ModelConfig[] = [
|
||||
useCustomCuda: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-2G-0.1B-World',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-World-0.1B-v1-20230520-ctx4096.pth',
|
||||
device: 'CUDA',
|
||||
precision: 'fp32', // using fp16 will disable state cache (->)
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-2G-1B5-EN',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-Raven-1B5-v12-Eng98%-Other2%-20230520-ctx4096.pth',
|
||||
device: 'CUDA',
|
||||
precision: 'int8',
|
||||
storedLayers: 4,
|
||||
maxStoredLayers: 41,
|
||||
useCustomCuda: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-4G-0.4B-World',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-World-0.4B-v1-20230529-ctx4096.pth',
|
||||
device: 'CUDA',
|
||||
precision: 'fp32',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-4G-1B5-World',
|
||||
apiParameters: {
|
||||
@@ -530,27 +364,9 @@ export const defaultModelConfigs: ModelConfig[] = [
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-World-1.5B-v1-fixed-20230612-ctx4096.pth',
|
||||
modelName: 'RWKV-5-World-1B5-v2-20231025-ctx4096.pth',
|
||||
device: 'CUDA',
|
||||
precision: 'fp32',
|
||||
storedLayers: 8,
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-4G-1B5-EN',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-Raven-1B5-v12-Eng98%-Other2%-20230520-ctx4096.pth',
|
||||
device: 'CUDA',
|
||||
precision: 'int8',
|
||||
precision: 'fp16',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41,
|
||||
useCustomCuda: true
|
||||
@@ -567,26 +383,7 @@ export const defaultModelConfigs: ModelConfig[] = [
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-World-3B-v1-20230619-ctx4096.pth',
|
||||
device: 'CUDA',
|
||||
precision: 'int8',
|
||||
storedLayers: 24,
|
||||
maxStoredLayers: 41,
|
||||
useCustomCuda: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-4G-3B-EN',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-Raven-3B-v12-Eng98%-Other2%-20230520-ctx4096.pth',
|
||||
modelName: 'RWKV-5-World-3B-v2-20231118-ctx16k.pth',
|
||||
device: 'CUDA',
|
||||
precision: 'int8',
|
||||
storedLayers: 24,
|
||||
@@ -632,25 +429,6 @@ export const defaultModelConfigs: ModelConfig[] = [
|
||||
useCustomCuda: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-4G-7B-EN',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-Raven-7B-v12-Eng98%-Other2%-20230521-ctx8192.pth',
|
||||
device: 'CUDA',
|
||||
precision: 'int8',
|
||||
storedLayers: 8,
|
||||
maxStoredLayers: 41,
|
||||
useCustomCuda: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-4G-7B-CN',
|
||||
apiParameters: {
|
||||
@@ -670,25 +448,6 @@ export const defaultModelConfigs: ModelConfig[] = [
|
||||
useCustomCuda: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-6G-1B5-EN',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-Raven-1B5-v12-Eng98%-Other2%-20230520-ctx4096.pth',
|
||||
device: 'CUDA',
|
||||
precision: 'fp16',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41,
|
||||
useCustomCuda: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-6G-3B-World',
|
||||
apiParameters: {
|
||||
@@ -700,26 +459,7 @@ export const defaultModelConfigs: ModelConfig[] = [
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-World-3B-v1-20230619-ctx4096.pth',
|
||||
device: 'CUDA',
|
||||
precision: 'int8',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41,
|
||||
useCustomCuda: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-6G-3B-EN',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-Raven-3B-v12-Eng98%-Other2%-20230520-ctx4096.pth',
|
||||
modelName: 'RWKV-5-World-3B-v2-20231118-ctx16k.pth',
|
||||
device: 'CUDA',
|
||||
precision: 'int8',
|
||||
storedLayers: 41,
|
||||
@@ -765,25 +505,6 @@ export const defaultModelConfigs: ModelConfig[] = [
|
||||
useCustomCuda: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-6G-7B-EN',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-Raven-7B-v12-Eng98%-Other2%-20230521-ctx8192.pth',
|
||||
device: 'CUDA',
|
||||
precision: 'int8',
|
||||
storedLayers: 18,
|
||||
maxStoredLayers: 41,
|
||||
useCustomCuda: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-6G-7B-CN',
|
||||
apiParameters: {
|
||||
@@ -803,24 +524,6 @@ export const defaultModelConfigs: ModelConfig[] = [
|
||||
useCustomCuda: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-8G-1B5-World',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-World-1.5B-v1-fixed-20230612-ctx4096.pth',
|
||||
device: 'CUDA',
|
||||
precision: 'fp32',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-8G-3B-World',
|
||||
apiParameters: {
|
||||
@@ -832,26 +535,7 @@ export const defaultModelConfigs: ModelConfig[] = [
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-World-3B-v1-20230619-ctx4096.pth',
|
||||
device: 'CUDA',
|
||||
precision: 'fp16',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41,
|
||||
useCustomCuda: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-8G-3B-EN',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-Raven-3B-v12-Eng98%-Other2%-20230520-ctx4096.pth',
|
||||
modelName: 'RWKV-5-World-3B-v2-20231118-ctx16k.pth',
|
||||
device: 'CUDA',
|
||||
precision: 'fp16',
|
||||
storedLayers: 41,
|
||||
@@ -897,25 +581,6 @@ export const defaultModelConfigs: ModelConfig[] = [
|
||||
useCustomCuda: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-8G-7B-EN',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-Raven-7B-v12-Eng98%-Other2%-20230521-ctx8192.pth',
|
||||
device: 'CUDA',
|
||||
precision: 'int8',
|
||||
storedLayers: 27,
|
||||
maxStoredLayers: 41,
|
||||
useCustomCuda: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-8G-7B-CN',
|
||||
apiParameters: {
|
||||
@@ -954,25 +619,6 @@ export const defaultModelConfigs: ModelConfig[] = [
|
||||
useCustomCuda: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-10G-7B-EN',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-Raven-7B-v12-Eng98%-Other2%-20230521-ctx8192.pth',
|
||||
device: 'CUDA',
|
||||
precision: 'int8',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41,
|
||||
useCustomCuda: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-10G-7B-CN',
|
||||
apiParameters: {
|
||||
@@ -992,25 +638,6 @@ export const defaultModelConfigs: ModelConfig[] = [
|
||||
useCustomCuda: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-12G-14B-EN',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-Raven-14B-v12-Eng98%-Other2%-20230523-ctx8192.pth',
|
||||
device: 'CUDA',
|
||||
precision: 'int8',
|
||||
storedLayers: 24,
|
||||
maxStoredLayers: 41,
|
||||
useCustomCuda: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-16G-7B-World',
|
||||
apiParameters: {
|
||||
@@ -1030,25 +657,6 @@ export const defaultModelConfigs: ModelConfig[] = [
|
||||
useCustomCuda: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-16G-7B-EN',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-Raven-7B-v12-Eng98%-Other2%-20230521-ctx8192.pth',
|
||||
device: 'CUDA',
|
||||
precision: 'fp16',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41,
|
||||
useCustomCuda: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-16G-7B-CN',
|
||||
apiParameters: {
|
||||
@@ -1068,63 +676,6 @@ export const defaultModelConfigs: ModelConfig[] = [
|
||||
useCustomCuda: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-16G-14B-EN',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-Raven-14B-v12-Eng98%-Other2%-20230523-ctx8192.pth',
|
||||
device: 'CUDA',
|
||||
precision: 'int8',
|
||||
storedLayers: 37,
|
||||
maxStoredLayers: 41,
|
||||
useCustomCuda: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-18G-14B-EN',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-Raven-14B-v12-Eng98%-Other2%-20230523-ctx8192.pth',
|
||||
device: 'CUDA',
|
||||
precision: 'int8',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41,
|
||||
useCustomCuda: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'GPU-32G-14B-EN',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-Raven-14B-v12-Eng98%-Other2%-20230523-ctx8192.pth',
|
||||
device: 'CUDA',
|
||||
precision: 'fp16',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41,
|
||||
useCustomCuda: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'CPU-120M-Music',
|
||||
apiParameters: {
|
||||
@@ -1136,7 +687,7 @@ export const defaultModelConfigs: ModelConfig[] = [
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-MIDI-120M-v1-20230714-ctx4096.pth',
|
||||
modelName: 'RWKV-5-MIDI-120M-v1-20230728-ctx4096.pth',
|
||||
device: 'CPU',
|
||||
precision: 'fp32',
|
||||
storedLayers: 41,
|
||||
@@ -1154,7 +705,7 @@ export const defaultModelConfigs: ModelConfig[] = [
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-MIDI-560M-v1-20230717-ctx4096.pth',
|
||||
modelName: 'RWKV-5-MIDI-560M-v1-20230902-ctx4096.pth',
|
||||
device: 'CPU',
|
||||
precision: 'fp32',
|
||||
storedLayers: 41,
|
||||
@@ -1162,7 +713,7 @@ export const defaultModelConfigs: ModelConfig[] = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'CPU-6G-1B5-World',
|
||||
name: 'AnyGPU-2G-1B5-World',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
@@ -1172,15 +723,15 @@ export const defaultModelConfigs: ModelConfig[] = [
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-World-1.5B-v1-fixed-20230612-ctx4096.pth',
|
||||
device: 'CPU',
|
||||
precision: 'fp32',
|
||||
modelName: 'RWKV-5-World-1B5-v2-20231025-ctx4096.pth',
|
||||
device: 'WebGPU',
|
||||
precision: 'nf4',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'CPU-6G-1B5-EN',
|
||||
name: 'AnyGPU-4G-3B-World',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
@@ -1190,51 +741,15 @@ export const defaultModelConfigs: ModelConfig[] = [
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-Raven-1B5-v12-Eng98%-Other2%-20230520-ctx4096.pth',
|
||||
device: 'CPU',
|
||||
precision: 'fp32',
|
||||
modelName: 'RWKV-5-World-3B-v2-20231118-ctx16k.pth',
|
||||
device: 'WebGPU',
|
||||
precision: 'nf4',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'CPU-12G-3B-World',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-World-3B-v1-20230619-ctx4096.pth',
|
||||
device: 'CPU',
|
||||
precision: 'fp32',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'CPU-12G-3B-EN',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-Raven-3B-v12-Eng98%-Other2%-20230520-ctx4096.pth',
|
||||
device: 'CPU',
|
||||
precision: 'fp32',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'CPU-12G-3B-CN',
|
||||
name: 'AnyGPU-4G-3B-CN',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
@@ -1245,14 +760,14 @@ export const defaultModelConfigs: ModelConfig[] = [
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-World-CHNtuned-3B-v1-20230625-ctx4096.pth',
|
||||
device: 'CPU',
|
||||
precision: 'fp32',
|
||||
device: 'WebGPU',
|
||||
precision: 'nf4',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'CPU-28G-7B-World',
|
||||
name: 'AnyGPU-7G-7B-World',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
@@ -1263,32 +778,14 @@ export const defaultModelConfigs: ModelConfig[] = [
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-World-7B-v1-20230626-ctx4096.pth',
|
||||
device: 'CPU',
|
||||
precision: 'fp32',
|
||||
device: 'WebGPU',
|
||||
precision: 'nf4',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'CPU-28G-7B-EN',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
temperature: 1.0,
|
||||
topP: 0.3,
|
||||
presencePenalty: 0,
|
||||
frequencyPenalty: 1
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-Raven-7B-v12-Eng98%-Other2%-20230521-ctx8192.pth',
|
||||
device: 'CPU',
|
||||
precision: 'fp32',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'CPU-28G-7B-CN',
|
||||
name: 'AnyGPU-7G-7B-CN',
|
||||
apiParameters: {
|
||||
apiPort: 8000,
|
||||
maxResponseToken: 4100,
|
||||
@@ -1299,8 +796,8 @@ export const defaultModelConfigs: ModelConfig[] = [
|
||||
},
|
||||
modelParameters: {
|
||||
modelName: 'RWKV-4-World-CHNtuned-7B-v1-20230709-ctx4096.pth',
|
||||
device: 'CPU',
|
||||
precision: 'fp32',
|
||||
device: 'WebGPU',
|
||||
precision: 'nf4',
|
||||
storedLayers: 41,
|
||||
maxStoredLayers: 41
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import commonStore, { MonitorData, Platform } from './stores/commonStore';
|
||||
import { GetPlatform, ListDirFiles, ReadJson } from '../wailsjs/go/backend_golang/App';
|
||||
import { FileExists, GetPlatform, ListDirFiles, ReadJson } from '../wailsjs/go/backend_golang/App';
|
||||
import { Cache, checkUpdate, downloadProgramFiles, LocalConfig, refreshLocalModels, refreshModels } from './utils';
|
||||
import { getStatus } from './apis';
|
||||
import { EventsOn, WindowSetTitle } from '../wailsjs/runtime';
|
||||
@@ -7,6 +7,8 @@ import manifest from '../../manifest.json';
|
||||
import { defaultModelConfigs, defaultModelConfigsMac } from './pages/defaultConfigs';
|
||||
import { t } from 'i18next';
|
||||
import { Preset } from './types/presets';
|
||||
import { toast } from 'react-toastify';
|
||||
import { MidiMessage, MidiPort } from './types/composition';
|
||||
|
||||
export async function startup() {
|
||||
initPresets();
|
||||
@@ -26,6 +28,7 @@ export async function startup() {
|
||||
initLocalModelsNotify();
|
||||
initLoraModels();
|
||||
initHardwareMonitor();
|
||||
initMidi();
|
||||
}
|
||||
|
||||
await initConfig();
|
||||
@@ -134,3 +137,22 @@ async function initHardwareMonitor() {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function initMidi() {
|
||||
EventsOn('midiError', (data: string) => {
|
||||
if (commonStore.platform === 'windows')
|
||||
toast('MIDI Error: ' + data, { type: 'error' });
|
||||
});
|
||||
EventsOn('midiPorts', (data: MidiPort[]) => {
|
||||
commonStore.setMidiPorts(data);
|
||||
});
|
||||
EventsOn('midiMessage', async (data: MidiMessage) => {
|
||||
await (await import('./pages/AudiotrackManager/AudiotrackEditor')).midiMessageHandler(data);
|
||||
});
|
||||
if (await FileExists('assets/sound-font/accordion/instrument.json')) {
|
||||
commonStore.setCompositionParams({
|
||||
...commonStore.compositionParams,
|
||||
useLocalSoundFont: true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,14 @@ import { Preset } from '../types/presets';
|
||||
import { AboutContent } from '../types/about';
|
||||
import { Attachment, ChatParams, Conversation } from '../types/chat';
|
||||
import { CompletionPreset } from '../types/completion';
|
||||
import { CompositionParams } from '../types/composition';
|
||||
import {
|
||||
CompositionParams,
|
||||
InstrumentType,
|
||||
MidiMessage,
|
||||
MidiPort,
|
||||
Track,
|
||||
tracksMinimalTotalTime
|
||||
} from '../types/composition';
|
||||
import { ModelConfig } from '../types/configs';
|
||||
import { DownloadStatus } from '../types/downloads';
|
||||
import { IntroductionContent } from '../types/home';
|
||||
@@ -63,7 +70,9 @@ class CommonStore {
|
||||
conversationOrder: string[] = [];
|
||||
activePreset: Preset | null = null;
|
||||
attachmentUploading: boolean = false;
|
||||
attachments: { [uuid: string]: Attachment[] } = {};
|
||||
attachments: {
|
||||
[uuid: string]: Attachment[]
|
||||
} = {};
|
||||
currentTempAttachment: Attachment | null = null;
|
||||
chatParams: ChatParams = {
|
||||
maxResponseToken: 1000,
|
||||
@@ -90,11 +99,26 @@ class CommonStore {
|
||||
};
|
||||
compositionGenerating: boolean = false;
|
||||
compositionSubmittedPrompt: string = defaultCompositionPrompt;
|
||||
// composition midi device
|
||||
midiPorts: MidiPort[] = [];
|
||||
activeMidiDeviceIndex: number = -1;
|
||||
instrumentType: InstrumentType = InstrumentType.Piano;
|
||||
// composition tracks
|
||||
tracks: Track[] = [];
|
||||
trackScale: number = 1;
|
||||
trackTotalTime: number = tracksMinimalTotalTime;
|
||||
trackCurrentTime: number = 0;
|
||||
trackPlayStartTime: number = 0;
|
||||
playingTrackId: string = '';
|
||||
recordingTrackId: string = '';
|
||||
recordingContent: string = ''; // used to improve performance of midiMessageHandler, and I'm too lazy to maintain an ID dictionary for this (although that would be better for realtime effects)
|
||||
recordingRawContent: MidiMessage[] = [];
|
||||
// configs
|
||||
currentModelConfigIndex: number = 0;
|
||||
modelConfigs: ModelConfig[] = [];
|
||||
modelParamsCollapsed: boolean = true;
|
||||
// models
|
||||
activeModelListTags: string[] = [];
|
||||
modelSourceManifestList: string = 'https://cdn.jsdelivr.net/gh/josstorer/RWKV-Runner@master/manifest.json;';
|
||||
modelSourceList: ModelSourceItem[] = [];
|
||||
// downloads
|
||||
@@ -306,7 +330,7 @@ class CommonStore {
|
||||
savePresets();
|
||||
}
|
||||
|
||||
setActivePreset(value: Preset) {
|
||||
setActivePreset(value: Preset | null) {
|
||||
this.activePreset = value;
|
||||
}
|
||||
|
||||
@@ -358,7 +382,9 @@ class CommonStore {
|
||||
this.attachmentUploading = value;
|
||||
}
|
||||
|
||||
setAttachments(value: { [uuid: string]: Attachment[] }) {
|
||||
setAttachments(value: {
|
||||
[uuid: string]: Attachment[]
|
||||
}) {
|
||||
this.attachments = value;
|
||||
}
|
||||
|
||||
@@ -380,6 +406,58 @@ class CommonStore {
|
||||
setSidePanelCollapsed(value: boolean | 'auto') {
|
||||
this.sidePanelCollapsed = value;
|
||||
}
|
||||
|
||||
setTracks(value: Track[]) {
|
||||
this.tracks = value;
|
||||
}
|
||||
|
||||
setTrackScale(value: number) {
|
||||
this.trackScale = value;
|
||||
}
|
||||
|
||||
setTrackTotalTime(value: number) {
|
||||
this.trackTotalTime = value;
|
||||
}
|
||||
|
||||
setTrackCurrentTime(value: number) {
|
||||
this.trackCurrentTime = value;
|
||||
}
|
||||
|
||||
setTrackPlayStartTime(value: number) {
|
||||
this.trackPlayStartTime = value;
|
||||
}
|
||||
|
||||
setMidiPorts(value: MidiPort[]) {
|
||||
this.midiPorts = value;
|
||||
}
|
||||
|
||||
setInstrumentType(value: InstrumentType) {
|
||||
this.instrumentType = value;
|
||||
}
|
||||
|
||||
setRecordingTrackId(value: string) {
|
||||
this.recordingTrackId = value;
|
||||
}
|
||||
|
||||
setActiveMidiDeviceIndex(value: number) {
|
||||
this.activeMidiDeviceIndex = value;
|
||||
}
|
||||
|
||||
setRecordingContent(value: string) {
|
||||
this.recordingContent = value;
|
||||
}
|
||||
|
||||
setRecordingRawContent(value: MidiMessage[]) {
|
||||
this.recordingRawContent = value;
|
||||
}
|
||||
|
||||
setPlayingTrackId(value: string) {
|
||||
this.playingTrackId = value;
|
||||
}
|
||||
|
||||
setActiveModelListTags(value: string[]) {
|
||||
this.activeModelListTags = value;
|
||||
}
|
||||
}
|
||||
|
||||
export default new CommonStore();
|
||||
@@ -1,5 +1,7 @@
|
||||
import { NoteSequence } from '@magenta/music/esm/protobuf';
|
||||
|
||||
export const tracksMinimalTotalTime = 5000;
|
||||
|
||||
export type CompositionParams = {
|
||||
prompt: string,
|
||||
maxResponseToken: number,
|
||||
@@ -9,4 +11,75 @@ export type CompositionParams = {
|
||||
useLocalSoundFont: boolean,
|
||||
midi: ArrayBuffer | null,
|
||||
ns: NoteSequence | null
|
||||
}
|
||||
}
|
||||
export type Track = {
|
||||
id: string;
|
||||
mainInstrument: string;
|
||||
content: string;
|
||||
rawContent: MidiMessage[];
|
||||
offsetTime: number;
|
||||
contentTime: number;
|
||||
};
|
||||
export type MidiPort = {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export type MessageType = 'NoteOff' | 'NoteOn' | 'ElapsedTime' | 'ControlChange';
|
||||
|
||||
export type MidiMessage = {
|
||||
messageType: MessageType;
|
||||
channel: number;
|
||||
note: number;
|
||||
velocity: number;
|
||||
control: number;
|
||||
value: number;
|
||||
instrument: InstrumentType;
|
||||
}
|
||||
|
||||
export enum InstrumentType {
|
||||
Piano,
|
||||
Percussion,
|
||||
Drum,
|
||||
Tuba,
|
||||
Marimba,
|
||||
Bass,
|
||||
Guitar,
|
||||
Violin,
|
||||
Trumpet,
|
||||
Sax,
|
||||
Flute,
|
||||
Lead,
|
||||
Pad,
|
||||
}
|
||||
|
||||
export const InstrumentTypeNameMap = [
|
||||
'Piano',
|
||||
'Percussion',
|
||||
'Drum',
|
||||
'Tuba',
|
||||
'Marimba',
|
||||
'Bass',
|
||||
'Guitar',
|
||||
'Violin',
|
||||
'Trumpet',
|
||||
'Sax',
|
||||
'Flute',
|
||||
'Lead',
|
||||
'Pad'
|
||||
];
|
||||
|
||||
export const InstrumentTypeTokenMap = [
|
||||
'pi',
|
||||
'p',
|
||||
'd',
|
||||
't',
|
||||
'm',
|
||||
'b',
|
||||
'g',
|
||||
'v',
|
||||
'tr',
|
||||
's',
|
||||
'f',
|
||||
'l',
|
||||
'pa'
|
||||
];
|
||||
|
||||
@@ -10,5 +10,6 @@ export type ModelSourceItem = {
|
||||
isLocal?: boolean;
|
||||
localSize?: number;
|
||||
lastUpdatedMs?: number;
|
||||
tags?: string[];
|
||||
hide?: boolean;
|
||||
};
|
||||
31
frontend/src/utils/convert-to-st.ts
Normal file
31
frontend/src/utils/convert-to-st.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { toast } from 'react-toastify';
|
||||
import commonStore from '../stores/commonStore';
|
||||
import { t } from 'i18next';
|
||||
import { ConvertSafetensors, FileExists, GetPyError } from '../../wailsjs/go/backend_golang/App';
|
||||
import { WindowShow } from '../../wailsjs/runtime';
|
||||
import { ModelConfig } from '../types/configs';
|
||||
|
||||
export const convertToSt = async (selectedConfig: ModelConfig) => {
|
||||
const modelPath = `${commonStore.settings.customModelsPath}/${selectedConfig.modelParameters.modelName}`;
|
||||
if (await FileExists(modelPath)) {
|
||||
toast(t('Start Converting'), { autoClose: 2000, type: 'info' });
|
||||
const newModelPath = modelPath.replace(/\.pth$/, '.st');
|
||||
ConvertSafetensors(modelPath, newModelPath).then(async () => {
|
||||
if (!await FileExists(newModelPath)) {
|
||||
if (commonStore.platform === 'windows' || commonStore.platform === 'linux')
|
||||
toast(t('Convert Failed') + ' - ' + await GetPyError(), { type: 'error' });
|
||||
} else {
|
||||
toast(`${t('Convert Success')} - ${newModelPath}`, { type: 'success' });
|
||||
}
|
||||
}).catch(e => {
|
||||
const errMsg = e.message || e;
|
||||
if (errMsg.includes('path contains space'))
|
||||
toast(`${t('Convert Failed')} - ${t('File Path Cannot Contain Space')}`, { type: 'error' });
|
||||
else
|
||||
toast(`${t('Convert Failed')} - ${e.message || e}`, { type: 'error' });
|
||||
});
|
||||
setTimeout(WindowShow, 1000);
|
||||
} else {
|
||||
toast(`${t('Model Not Found')} - ${modelPath}`, { type: 'error' });
|
||||
}
|
||||
};
|
||||
@@ -22,6 +22,11 @@ import { DownloadStatus } from '../types/downloads';
|
||||
import { ModelSourceItem } from '../types/models';
|
||||
import { Language, Languages, SettingsType } from '../types/settings';
|
||||
import { DataProcessParameters, LoraFinetuneParameters } from '../types/train';
|
||||
import { InstrumentTypeNameMap, tracksMinimalTotalTime } from '../types/composition';
|
||||
import logo from '../assets/images/logo.png';
|
||||
import { Preset } from '../types/presets';
|
||||
import { botName, Conversation, MessageType, userName } from '../types/chat';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
|
||||
export type Cache = {
|
||||
version: string
|
||||
@@ -39,7 +44,9 @@ export type LocalConfig = {
|
||||
}
|
||||
|
||||
export async function refreshBuiltInModels(readCache: boolean = false) {
|
||||
let cache: { models: ModelSourceItem[] } = { models: [] };
|
||||
let cache: {
|
||||
models: ModelSourceItem[]
|
||||
} = { models: [] };
|
||||
if (readCache)
|
||||
await ReadJson('cache.json').then((cacheData: Cache) => {
|
||||
if (cacheData.models)
|
||||
@@ -72,7 +79,8 @@ export async function refreshLocalModels(cache: {
|
||||
size: d.size,
|
||||
lastUpdated: d.modTime,
|
||||
isComplete: true,
|
||||
isLocal: true
|
||||
isLocal: true,
|
||||
tags: ['Local']
|
||||
}] as ModelSourceItem[];
|
||||
return [];
|
||||
}));
|
||||
@@ -82,12 +90,15 @@ export async function refreshLocalModels(cache: {
|
||||
for (let i = 0; i < cache.models.length; i++) {
|
||||
if (!cache.models[i].lastUpdatedMs)
|
||||
cache.models[i].lastUpdatedMs = Date.parse(cache.models[i].lastUpdated);
|
||||
if (!cache.models[i].tags)
|
||||
cache.models[i].tags = ['Other'];
|
||||
|
||||
for (let j = i + 1; j < cache.models.length; j++) {
|
||||
if (!cache.models[j].lastUpdatedMs)
|
||||
cache.models[j].lastUpdatedMs = Date.parse(cache.models[j].lastUpdated);
|
||||
|
||||
if (cache.models[i].name === cache.models[j].name) {
|
||||
const tags = Array.from(new Set([...cache.models[i].tags as string[], ...cache.models[j].tags as string[]]));
|
||||
if (cache.models[i].size <= cache.models[j].size) { // j is local file
|
||||
if (cache.models[i].lastUpdatedMs! < cache.models[j].lastUpdatedMs!) {
|
||||
cache.models[i] = Object.assign({}, cache.models[i], cache.models[j]);
|
||||
@@ -97,6 +108,7 @@ export async function refreshLocalModels(cache: {
|
||||
} // else is not complete local file
|
||||
cache.models[i].isLocal = true;
|
||||
cache.models[i].localSize = cache.models[j].size;
|
||||
cache.models[i].tags = tags;
|
||||
cache.models.splice(j, 1);
|
||||
j--;
|
||||
}
|
||||
@@ -117,7 +129,7 @@ function initLastUnfinishedModelDownloads() {
|
||||
{
|
||||
name: item.name,
|
||||
path: `${commonStore.settings.customModelsPath}/${item.name}`,
|
||||
url: item.downloadUrl!,
|
||||
url: getHfDownloadUrl(item.downloadUrl!),
|
||||
transferred: item.localSize!,
|
||||
size: item.size,
|
||||
speed: 0,
|
||||
@@ -131,7 +143,9 @@ function initLastUnfinishedModelDownloads() {
|
||||
commonStore.setLastUnfinishedModelDownloads(list);
|
||||
}
|
||||
|
||||
export async function refreshRemoteModels(cache: { models: ModelSourceItem[] }) {
|
||||
export async function refreshRemoteModels(cache: {
|
||||
models: ModelSourceItem[]
|
||||
}) {
|
||||
const manifestUrls = commonStore.modelSourceManifestList.split(/[,,;;\n]/);
|
||||
const requests = manifestUrls.filter(url => url.endsWith('.json')).map(
|
||||
url => fetch(url, { cache: 'no-cache' }).then(r => r.json()));
|
||||
@@ -304,6 +318,8 @@ export function getServerRoot(defaultLocalPort: number) {
|
||||
export function absPathAsset(path: string) {
|
||||
if (commonStore.platform === 'web')
|
||||
return path;
|
||||
if (path === logo)
|
||||
return path;
|
||||
if ((path.length > 0 && path[0] === '/') ||
|
||||
(path.length > 1 && path[1] === ':')) {
|
||||
return '=>' + path;
|
||||
@@ -417,7 +433,10 @@ export const checkDependencies = async (navigate: NavigateFunction) => {
|
||||
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');
|
||||
AddToDownloadList('python-3.10.11-embed-amd64.zip',
|
||||
!commonStore.settings.cnMirror
|
||||
? 'https://www.python.org/ftp/python/3.10.11/python-3.10.11-embed-amd64.zip'
|
||||
: 'https://mirrors.huaweicloud.com/python/3.10.11/python-3.10.11-embed-amd64.zip');
|
||||
});
|
||||
} else if (depErrorMsg.includes('DepCheck Error')) {
|
||||
if (depErrorMsg.includes('vc_redist') || depErrorMsg.includes('DLL load failed while importing')) {
|
||||
@@ -480,6 +499,96 @@ export function getHfDownloadUrl(url: string) {
|
||||
return url;
|
||||
}
|
||||
|
||||
export function refreshTracksTotalTime() {
|
||||
if (commonStore.tracks.length === 0) {
|
||||
commonStore.setTrackTotalTime(tracksMinimalTotalTime);
|
||||
commonStore.setTrackCurrentTime(0);
|
||||
commonStore.setTrackPlayStartTime(0);
|
||||
return;
|
||||
}
|
||||
const endTimes = commonStore.tracks.map(t => t.offsetTime + t.contentTime);
|
||||
const totalTime = Math.max(...endTimes) + tracksMinimalTotalTime;
|
||||
if (commonStore.trackPlayStartTime > totalTime)
|
||||
commonStore.setTrackPlayStartTime(totalTime);
|
||||
commonStore.setTrackTotalTime(totalTime);
|
||||
}
|
||||
|
||||
export function flushMidiRecordingContent() {
|
||||
const recordingTrackIndex = commonStore.tracks.findIndex(t => t.id === commonStore.recordingTrackId);
|
||||
if (recordingTrackIndex >= 0) {
|
||||
const recordingTrack = commonStore.tracks[recordingTrackIndex];
|
||||
const tracks = commonStore.tracks.slice();
|
||||
const contentTime = commonStore.recordingRawContent
|
||||
.reduce((sum, current) =>
|
||||
sum + (current.messageType === 'ElapsedTime' ? current.value : 0)
|
||||
, 0);
|
||||
|
||||
const sortedInstrumentFrequency = Object.entries(commonStore.recordingRawContent
|
||||
.filter(c => c.messageType === 'NoteOn')
|
||||
.map(c => c.instrument)
|
||||
.reduce((frequencyCount, current) => (frequencyCount[current] = (frequencyCount[current] || 0) + 1, frequencyCount)
|
||||
, {} as {
|
||||
[key: string]: number
|
||||
}))
|
||||
.sort((a, b) => b[1] - a[1]);
|
||||
let mainInstrument: string = '';
|
||||
if (sortedInstrumentFrequency.length > 0)
|
||||
mainInstrument = InstrumentTypeNameMap[Number(sortedInstrumentFrequency[0][0])];
|
||||
|
||||
tracks[recordingTrackIndex] = {
|
||||
...recordingTrack,
|
||||
content: commonStore.recordingContent,
|
||||
rawContent: commonStore.recordingRawContent,
|
||||
contentTime: contentTime,
|
||||
mainInstrument: mainInstrument
|
||||
};
|
||||
commonStore.setTracks(tracks);
|
||||
refreshTracksTotalTime();
|
||||
}
|
||||
commonStore.setRecordingContent('');
|
||||
commonStore.setRecordingRawContent([]);
|
||||
}
|
||||
|
||||
export async function getSoundFont() {
|
||||
let soundUrl: string;
|
||||
if (commonStore.compositionParams.useLocalSoundFont)
|
||||
soundUrl = 'assets/sound-font';
|
||||
else
|
||||
soundUrl = !commonStore.settings.giteeUpdatesSource ?
|
||||
`https://raw.githubusercontent.com/josStorer/sgm_plus/master` :
|
||||
`https://cdn.jsdelivr.net/gh/josstorer/sgm_plus`;
|
||||
const fallbackUrl = 'https://cdn.jsdelivr.net/gh/josstorer/sgm_plus';
|
||||
await fetch(soundUrl + '/soundfont.json').then(r => {
|
||||
if (!r.ok)
|
||||
soundUrl = fallbackUrl;
|
||||
}).catch(() => soundUrl = fallbackUrl);
|
||||
return soundUrl;
|
||||
}
|
||||
|
||||
export const setActivePreset = (preset: Preset | null) => {
|
||||
commonStore.setActivePreset(preset);
|
||||
//TODO if (preset.displayPresetMessages) {
|
||||
const conversation: Conversation = {};
|
||||
const conversationOrder: string[] = [];
|
||||
if (preset)
|
||||
for (const message of preset.messages) {
|
||||
const newUuid = uuid();
|
||||
conversationOrder.push(newUuid);
|
||||
conversation[newUuid] = {
|
||||
sender: message.role === 'user' ? userName : botName,
|
||||
type: MessageType.Normal,
|
||||
color: message.role === 'user' ? 'brand' : 'colorful',
|
||||
time: new Date().toISOString(),
|
||||
content: message.content,
|
||||
side: message.role === 'user' ? 'right' : 'left',
|
||||
done: true
|
||||
};
|
||||
}
|
||||
commonStore.setConversation(conversation);
|
||||
commonStore.setConversationOrder(conversationOrder);
|
||||
//}
|
||||
};
|
||||
|
||||
export function getSupportedCustomCudaFile(isBeta: boolean) {
|
||||
if ([' 10', ' 16', ' 20', ' 30', 'MX', 'Tesla P', 'Quadro P', 'NVIDIA P', 'TITAN X', 'TITAN RTX', 'RTX A',
|
||||
'Quadro RTX 4000', 'Quadro RTX 5000', 'Tesla T4', 'NVIDIA A10', 'NVIDIA A40'].some(v => commonStore.status.device_name.includes(v)))
|
||||
|
||||
72
frontend/src/utils/web-file-operations.ts
Normal file
72
frontend/src/utils/web-file-operations.ts
Normal file
@@ -0,0 +1,72 @@
|
||||
import { getDocument, GlobalWorkerOptions, PDFDocumentProxy } from 'pdfjs-dist';
|
||||
import { TextItem } from 'pdfjs-dist/types/src/display/api';
|
||||
|
||||
export function webOpenOpenFileDialog({ filterPattern, fnStartLoading }: { filterPattern: string, fnStartLoading: Function | null }): Promise<{ blob: Blob, content?: string }> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const input = document.createElement('input');
|
||||
input.type = 'file';
|
||||
input.accept = filterPattern
|
||||
.replaceAll('*.txt', 'text/plain')
|
||||
.replaceAll('*.', 'application/')
|
||||
.replaceAll(';', ',');
|
||||
|
||||
input.onchange = async e => {
|
||||
// @ts-ignore
|
||||
const file: Blob = e.target?.files[0];
|
||||
if (fnStartLoading && typeof fnStartLoading === 'function')
|
||||
fnStartLoading();
|
||||
if (!GlobalWorkerOptions.workerSrc)
|
||||
// @ts-ignore
|
||||
GlobalWorkerOptions.workerSrc = await import('pdfjs-dist/build/pdf.worker.min.mjs');
|
||||
if (file.type === 'text/plain') {
|
||||
const reader = new FileReader();
|
||||
reader.readAsText(file, 'UTF-8');
|
||||
|
||||
reader.onload = event => {
|
||||
const content = event.target?.result as string;
|
||||
resolve({
|
||||
blob: file,
|
||||
content: content
|
||||
});
|
||||
};
|
||||
reader.onerror = reject;
|
||||
} else if (file.type === 'application/pdf') {
|
||||
const readPDFPage = async (doc: PDFDocumentProxy, pageNo: number) => {
|
||||
const page = await doc.getPage(pageNo);
|
||||
const tokenizedText = await page.getTextContent();
|
||||
return tokenizedText.items.map(token => (token as TextItem).str).join('');
|
||||
};
|
||||
let reader = new FileReader();
|
||||
reader.readAsArrayBuffer(file);
|
||||
|
||||
reader.onload = async (event) => {
|
||||
try {
|
||||
const doc = await getDocument(event.target?.result!).promise;
|
||||
const pageTextPromises = [];
|
||||
for (let pageNo = 1; pageNo <= doc.numPages; pageNo++) {
|
||||
pageTextPromises.push(readPDFPage(doc, pageNo));
|
||||
}
|
||||
const pageTexts = await Promise.all(pageTextPromises);
|
||||
let content;
|
||||
if (pageTexts.length === 1)
|
||||
content = pageTexts[0];
|
||||
else
|
||||
content = pageTexts.map((p, i) => `Page ${i + 1}:\n${p}`).join('\n\n');
|
||||
resolve({
|
||||
blob: file,
|
||||
content: content
|
||||
});
|
||||
} catch (err) {
|
||||
reject(err);
|
||||
}
|
||||
};
|
||||
reader.onerror = reject;
|
||||
} else {
|
||||
resolve({
|
||||
blob: file
|
||||
});
|
||||
}
|
||||
};
|
||||
input.click();
|
||||
});
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
import { webOpenOpenFileDialog } from './utils/web-file-operations'
|
||||
|
||||
function defineRuntime(name, func) {
|
||||
window.runtime[name] = func
|
||||
}
|
||||
@@ -46,6 +48,8 @@ if (!window.go) {
|
||||
// not implemented
|
||||
defineApp('AddToDownloadList', async () => {
|
||||
})
|
||||
defineApp('CloseMidiPort', async () => {
|
||||
})
|
||||
defineApp('ContinueDownload', async () => {
|
||||
})
|
||||
defineApp('ConvertData', async () => {
|
||||
@@ -72,8 +76,12 @@ if (!window.go) {
|
||||
})
|
||||
defineApp('OpenFileFolder', async () => {
|
||||
})
|
||||
defineApp('OpenMidiPort', async () => {
|
||||
})
|
||||
defineApp('PauseDownload', async () => {
|
||||
})
|
||||
defineApp('PlayNote', async () => {
|
||||
})
|
||||
defineApp('ReadFileInfo', async () => {
|
||||
})
|
||||
defineApp('RestartApp', async () => {
|
||||
@@ -107,37 +115,7 @@ if (!window.go) {
|
||||
defineApp('ListDirFiles', async () => {
|
||||
return []
|
||||
})
|
||||
defineApp('OpenOpenFileDialog', async (filterPattern) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const input = document.createElement('input')
|
||||
input.type = 'file'
|
||||
input.accept = filterPattern
|
||||
.replaceAll('*.txt', 'text/plain')
|
||||
.replaceAll('*.', 'application/')
|
||||
.replaceAll(';', ',')
|
||||
|
||||
input.onchange = e => {
|
||||
const file = e.target?.files[0]
|
||||
if (file.type === 'text/plain') {
|
||||
const reader = new FileReader()
|
||||
reader.readAsText(file, 'UTF-8')
|
||||
|
||||
reader.onload = readerEvent => {
|
||||
const content = readerEvent.target?.result
|
||||
resolve({
|
||||
blob: file,
|
||||
content: content
|
||||
})
|
||||
}
|
||||
} else {
|
||||
resolve({
|
||||
blob: file
|
||||
})
|
||||
}
|
||||
}
|
||||
input.click()
|
||||
})
|
||||
})
|
||||
defineApp('OpenOpenFileDialog', webOpenOpenFileDialog)
|
||||
defineApp('OpenSaveFileDialog', async (filterPattern, defaultFileName, savedContent) => {
|
||||
const saver = await import('file-saver')
|
||||
saver.saveAs(new Blob([savedContent], { type: 'text/plain;charset=utf-8' }), defaultFileName)
|
||||
|
||||
@@ -3,6 +3,7 @@ import { dependencies } from './package.json';
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import { visualizer } from 'rollup-plugin-visualizer';
|
||||
import topLevelAwait from 'vite-plugin-top-level-await';
|
||||
|
||||
// dependencies that exist anywhere
|
||||
const vendor = [
|
||||
@@ -20,6 +21,7 @@ const embedded = [
|
||||
|
||||
// dependencies that exist in single component
|
||||
'react-beautiful-dnd',
|
||||
'react-draggable',
|
||||
'@magenta/music', 'html-midi-player',
|
||||
'react-markdown', 'rehype-highlight', 'rehype-raw', 'remark-breaks', 'remark-gfm'
|
||||
];
|
||||
@@ -35,12 +37,18 @@ function renderChunks(deps: Record<string, string>) {
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react(),
|
||||
plugins: [
|
||||
react(),
|
||||
visualizer({
|
||||
template: 'treemap',
|
||||
gzipSize: true,
|
||||
brotliSize: true
|
||||
})],
|
||||
}),
|
||||
topLevelAwait({
|
||||
promiseExportName: '__tla',
|
||||
promiseImportName: i => `__tla_${i}`
|
||||
})
|
||||
],
|
||||
build: {
|
||||
chunkSizeWarningLimit: 3000,
|
||||
rollupOptions: {
|
||||
@@ -48,7 +56,10 @@ export default defineConfig({
|
||||
manualChunks: {
|
||||
vendor,
|
||||
...renderChunks(dependencies)
|
||||
}
|
||||
},
|
||||
entryFileNames: `assets/[name].js`,
|
||||
chunkFileNames: `assets/[name].js`,
|
||||
assetFileNames: `assets/[name].[ext]`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
8
frontend/wailsjs/go/backend_golang/App.d.ts
generated
vendored
8
frontend/wailsjs/go/backend_golang/App.d.ts
generated
vendored
@@ -4,13 +4,15 @@ import {backend_golang} from '../models';
|
||||
|
||||
export function AddToDownloadList(arg1:string,arg2:string):Promise<void>;
|
||||
|
||||
export function CloseMidiPort():Promise<void>;
|
||||
|
||||
export function ContinueDownload(arg1:string):Promise<void>;
|
||||
|
||||
export function ConvertData(arg1:string,arg2:string,arg3:string,arg4:string):Promise<string>;
|
||||
|
||||
export function ConvertModel(arg1:string,arg2:string,arg3:string,arg4:string):Promise<string>;
|
||||
|
||||
export function ConvertSafetensors(arg1:string,arg2:string,arg3:string):Promise<string>;
|
||||
export function ConvertSafetensors(arg1:string,arg2:string):Promise<string>;
|
||||
|
||||
export function CopyFile(arg1:string,arg2:string):Promise<void>;
|
||||
|
||||
@@ -36,6 +38,8 @@ export function MergeLora(arg1:string,arg2:boolean,arg3:number,arg4:string,arg5:
|
||||
|
||||
export function OpenFileFolder(arg1:string,arg2:boolean):Promise<void>;
|
||||
|
||||
export function OpenMidiPort(arg1:number):Promise<void>;
|
||||
|
||||
export function OpenOpenFileDialog(arg1:string):Promise<string>;
|
||||
|
||||
export function OpenSaveFileDialog(arg1:string,arg2:string,arg3:string):Promise<string>;
|
||||
@@ -44,6 +48,8 @@ export function OpenSaveFileDialogBytes(arg1:string,arg2:string,arg3:Array<numbe
|
||||
|
||||
export function PauseDownload(arg1:string):Promise<void>;
|
||||
|
||||
export function PlayNote(arg1:backend_golang.MIDIMessage):Promise<void>;
|
||||
|
||||
export function ReadFileInfo(arg1:string):Promise<backend_golang.FileInfo>;
|
||||
|
||||
export function ReadJson(arg1:string):Promise<any>;
|
||||
|
||||
16
frontend/wailsjs/go/backend_golang/App.js
generated
16
frontend/wailsjs/go/backend_golang/App.js
generated
@@ -6,6 +6,10 @@ export function AddToDownloadList(arg1, arg2) {
|
||||
return window['go']['backend_golang']['App']['AddToDownloadList'](arg1, arg2);
|
||||
}
|
||||
|
||||
export function CloseMidiPort() {
|
||||
return window['go']['backend_golang']['App']['CloseMidiPort']();
|
||||
}
|
||||
|
||||
export function ContinueDownload(arg1) {
|
||||
return window['go']['backend_golang']['App']['ContinueDownload'](arg1);
|
||||
}
|
||||
@@ -18,8 +22,8 @@ export function ConvertModel(arg1, arg2, arg3, arg4) {
|
||||
return window['go']['backend_golang']['App']['ConvertModel'](arg1, arg2, arg3, arg4);
|
||||
}
|
||||
|
||||
export function ConvertSafetensors(arg1, arg2, arg3) {
|
||||
return window['go']['backend_golang']['App']['ConvertSafetensors'](arg1, arg2, arg3);
|
||||
export function ConvertSafetensors(arg1, arg2) {
|
||||
return window['go']['backend_golang']['App']['ConvertSafetensors'](arg1, arg2);
|
||||
}
|
||||
|
||||
export function CopyFile(arg1, arg2) {
|
||||
@@ -70,6 +74,10 @@ export function OpenFileFolder(arg1, arg2) {
|
||||
return window['go']['backend_golang']['App']['OpenFileFolder'](arg1, arg2);
|
||||
}
|
||||
|
||||
export function OpenMidiPort(arg1) {
|
||||
return window['go']['backend_golang']['App']['OpenMidiPort'](arg1);
|
||||
}
|
||||
|
||||
export function OpenOpenFileDialog(arg1) {
|
||||
return window['go']['backend_golang']['App']['OpenOpenFileDialog'](arg1);
|
||||
}
|
||||
@@ -86,6 +94,10 @@ export function PauseDownload(arg1) {
|
||||
return window['go']['backend_golang']['App']['PauseDownload'](arg1);
|
||||
}
|
||||
|
||||
export function PlayNote(arg1) {
|
||||
return window['go']['backend_golang']['App']['PlayNote'](arg1);
|
||||
}
|
||||
|
||||
export function ReadFileInfo(arg1) {
|
||||
return window['go']['backend_golang']['App']['ReadFileInfo'](arg1);
|
||||
}
|
||||
|
||||
22
frontend/wailsjs/go/models.ts
generated
22
frontend/wailsjs/go/models.ts
generated
@@ -18,6 +18,28 @@ export namespace backend_golang {
|
||||
this.modTime = source["modTime"];
|
||||
}
|
||||
}
|
||||
export class MIDIMessage {
|
||||
messageType: string;
|
||||
channel: number;
|
||||
note: number;
|
||||
velocity: number;
|
||||
control: number;
|
||||
value: number;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new MIDIMessage(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) source = JSON.parse(source);
|
||||
this.messageType = source["messageType"];
|
||||
this.channel = source["channel"];
|
||||
this.note = source["note"];
|
||||
this.velocity = source["velocity"];
|
||||
this.control = source["control"];
|
||||
this.value = source["value"];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
1
go.mod
1
go.mod
@@ -5,6 +5,7 @@ go 1.20
|
||||
require (
|
||||
github.com/cavaliergopher/grab/v3 v3.0.1
|
||||
github.com/fsnotify/fsnotify v1.6.0
|
||||
github.com/mattrtaylor/go-rtmidi v0.0.0-20220428034745-af795b1c1a79
|
||||
github.com/minio/selfupdate v0.6.0
|
||||
github.com/nyaosorg/go-windows-su v0.2.1
|
||||
github.com/ubuntu/gowsl v0.0.0-20230615094051-94945650cc1e
|
||||
|
||||
2
go.sum
2
go.sum
@@ -38,6 +38,8 @@ github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27k
|
||||
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
|
||||
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mattrtaylor/go-rtmidi v0.0.0-20220428034745-af795b1c1a79 h1:CA1UHN3RuY70DlC0RlvgtB1e8h3kYzmvK7s8CFe+Ohw=
|
||||
github.com/mattrtaylor/go-rtmidi v0.0.0-20220428034745-af795b1c1a79/go.mod h1:oBuZjmjlKSj9CZKrNhcx/adNhHiiE0hZknECjIP8Z0Q=
|
||||
github.com/minio/selfupdate v0.6.0 h1:i76PgT0K5xO9+hjzKcacQtO7+MjJ4JKA8Ak8XQ9DDwU=
|
||||
github.com/minio/selfupdate v0.6.0/go.mod h1:bO02GTIPCMQFTEvE5h4DjYB58bCoZ35XLeBf0buTDdM=
|
||||
github.com/nyaosorg/go-windows-su v0.2.1 h1:5V0XavLyjOqPUp7psxxCvBISaneU4XmFPSMlejSl5sc=
|
||||
|
||||
376
manifest.json
376
manifest.json
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "1.5.2",
|
||||
"version": "1.5.8",
|
||||
"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的优点结合起来 - 高性能、快速推理、节省显存、快速训练、“无限”上下文长度以及免费的语句嵌入(使用最终隐藏状态)。"
|
||||
@@ -15,6 +15,42 @@
|
||||
}
|
||||
],
|
||||
"models": [
|
||||
{
|
||||
"name": "RWKV-5-World-0.1B-v1-20230803-ctx4096.pth",
|
||||
"desc": {
|
||||
"en": "RWKV-5 Global Languages 0.1B v1",
|
||||
"zh": "RWKV-5 全球语言 0.1B v1",
|
||||
"ja": "RWKV-5 グローバル言語 0.1B v1"
|
||||
},
|
||||
"size": 385598386,
|
||||
"SHA256": "c844a3ee05bcb9065848cb05b10c48a3f381f5ac1953aad89e156ecdf31d7703",
|
||||
"lastUpdated": "2023-08-03T15:18:46",
|
||||
"url": "https://huggingface.co/BlinkDL/rwkv-5-world/blob/main/RWKV-5-World-0.1B-v1-20230803-ctx4096.pth?download=true",
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-5-world/resolve/main/RWKV-5-World-0.1B-v1-20230803-ctx4096.pth?download=true",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-5",
|
||||
"Global"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-5-World-0.4B-v2-20231113-ctx4096.pth",
|
||||
"desc": {
|
||||
"en": "RWKV-5 Global Languages 0.4B v2",
|
||||
"zh": "RWKV-5 全球语言 0.4B v2",
|
||||
"ja": "RWKV-5 グローバル言語 0.4B v2"
|
||||
},
|
||||
"size": 923523954,
|
||||
"SHA256": "5a288c54c7f30b0e2d4af23991133fad2af2d5e59ec7ad850ffe78054a5e4f92",
|
||||
"lastUpdated": "2023-11-14T01:23:49",
|
||||
"url": "https://huggingface.co/BlinkDL/rwkv-5-world/blob/main/RWKV-5-World-0.4B-v2-20231113-ctx4096.pth?download=true",
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-5-world/resolve/main/RWKV-5-World-0.4B-v2-20231113-ctx4096.pth?download=true",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-5",
|
||||
"Global"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-5-World-1B5-v2-20231025-ctx4096.pth",
|
||||
"desc": {
|
||||
@@ -26,7 +62,48 @@
|
||||
"SHA256": "5a89f56be7f82ab9dd0835af9a6838f788477471616c02f7b041e3aea0c57435",
|
||||
"lastUpdated": "2023-10-26T05:49:30",
|
||||
"url": "https://huggingface.co/BlinkDL/rwkv-5-world/blob/main/RWKV-5-World-1B5-v2-20231025-ctx4096.pth",
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-5-world/resolve/main/RWKV-5-World-1B5-v2-20231025-ctx4096.pth"
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-5-world/resolve/main/RWKV-5-World-1B5-v2-20231025-ctx4096.pth",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-5",
|
||||
"Global"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-5-World-3B-v2-20231113-ctx4096.pth",
|
||||
"desc": {
|
||||
"en": "RWKV-5 Global Languages 3B v2",
|
||||
"zh": "RWKV-5 全球语言 3B v2",
|
||||
"ja": "RWKV-5 グローバル言語 3B v2"
|
||||
},
|
||||
"size": 6126106674,
|
||||
"SHA256": "a4bd430343c6fd138b85bbc68bb20262d3a2f053ea57dc4b41078269af68ff9c",
|
||||
"lastUpdated": "2023-11-14T01:23:49",
|
||||
"url": "https://huggingface.co/BlinkDL/rwkv-5-world/blob/main/RWKV-5-World-3B-v2-20231113-ctx4096.pth?download=true",
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-5-world/resolve/main/RWKV-5-World-3B-v2-20231113-ctx4096.pth?download=true",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-5",
|
||||
"Global"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-5-World-3B-v2-20231118-ctx16k.pth",
|
||||
"desc": {
|
||||
"en": "RWKV-5 Global Languages 3B v2 Ctx16k",
|
||||
"zh": "RWKV-5 全球语言 3B v2 16k上下文",
|
||||
"ja": "RWKV-5 グローバル言語 3B v2 16kコンテキスト"
|
||||
},
|
||||
"size": 6126106467,
|
||||
"SHA256": "efa5178d1c824b94ef17c6c9a456674e5581a8be832becbda9aba4dc533f88c2",
|
||||
"lastUpdated": "2023-11-19T04:21:04",
|
||||
"url": "https://huggingface.co/BlinkDL/rwkv-5-world/blob/main/RWKV-5-World-3B-v2-20231118-ctx16k.pth?download=true",
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-5-world/resolve/main/RWKV-5-World-3B-v2-20231118-ctx16k.pth?download=true",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-5",
|
||||
"Global"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-4-World-CHNtuned-0.1B-v1-20230617-ctx4096.pth",
|
||||
@@ -39,7 +116,12 @@
|
||||
"SHA256": "a3888f9958d378ee6d4976ae1c02edb698f4382e426086febafb4a69417b9080",
|
||||
"lastUpdated": "2023-06-17T18:35:26",
|
||||
"url": "https://huggingface.co/BlinkDL/rwkv-4-world/blob/main/RWKV-4-World-CHNtuned-0.1B-v1-20230617-ctx4096.pth",
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-CHNtuned-0.1B-v1-20230617-ctx4096.pth"
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-CHNtuned-0.1B-v1-20230617-ctx4096.pth",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"CN"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-4-World-0.1B-v1-20230520-ctx4096.pth",
|
||||
@@ -52,7 +134,12 @@
|
||||
"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"
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-0.1B-v1-20230520-ctx4096.pth",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"Global"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-4-World-CHNtuned-0.4B-v1-20230618-ctx4096.pth",
|
||||
@@ -65,7 +152,12 @@
|
||||
"SHA256": "dbd5302cbee596bbc900f97eb10b2af3001a7f2c7e4d8643bf8683b2cdbdd324",
|
||||
"lastUpdated": "2023-06-18T10:46:50",
|
||||
"url": "https://huggingface.co/BlinkDL/rwkv-4-world/blob/main/RWKV-4-World-CHNtuned-0.4B-v1-20230618-ctx4096.pth",
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-CHNtuned-0.4B-v1-20230618-ctx4096.pth"
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-CHNtuned-0.4B-v1-20230618-ctx4096.pth",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"CN"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-4-World-0.4B-v1-20230529-ctx4096.pth",
|
||||
@@ -78,7 +170,12 @@
|
||||
"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"
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-0.4B-v1-20230529-ctx4096.pth",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"Global"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-4-World-CHNtuned-1.5B-v1-20230620-ctx4096.pth",
|
||||
@@ -91,7 +188,12 @@
|
||||
"SHA256": "9f31f2ed5fe52dcf2d50208eb2efd764b9674dba2adb1baeff61997b4390a26b",
|
||||
"lastUpdated": "2023-06-20T06:35:37",
|
||||
"url": "https://huggingface.co/BlinkDL/rwkv-4-world/blob/main/RWKV-4-World-CHNtuned-1.5B-v1-20230620-ctx4096.pth",
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-CHNtuned-1.5B-v1-20230620-ctx4096.pth"
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-CHNtuned-1.5B-v1-20230620-ctx4096.pth",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"CN"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-4-World-1.5B-v1-OnlyForTest_57%_trained-20230529-ctx4096.pth",
|
||||
@@ -130,6 +232,11 @@
|
||||
"lastUpdated": "2023-06-07T09:33:32",
|
||||
"url": "https://huggingface.co/BlinkDL/rwkv-4-world/blob/main/RWKV-4-World-1.5B-v1-20230607-ctx4096.pth",
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-1.5B-v1-20230607-ctx4096.pth",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"Global"
|
||||
],
|
||||
"hide": true
|
||||
},
|
||||
{
|
||||
@@ -143,7 +250,12 @@
|
||||
"SHA256": "71f0c3229f9227cbcb8ae5fee6461197129a57e26366c4d23a49058417b046c9",
|
||||
"lastUpdated": "2023-06-12T06:31:32",
|
||||
"url": "https://huggingface.co/BlinkDL/rwkv-4-world/blob/main/RWKV-4-World-1.5B-v1-fixed-20230612-ctx4096.pth",
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-1.5B-v1-fixed-20230612-ctx4096.pth"
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-1.5B-v1-fixed-20230612-ctx4096.pth",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"Global"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-4-World-3B-v1-OnlyForTest_35%_trained-20230529-ctx4096.pth",
|
||||
@@ -208,7 +320,12 @@
|
||||
"SHA256": "1b227af317fa25b6939ab3c7cd321226ca48b8fe4bbbd2df3db669f1482c54ba",
|
||||
"lastUpdated": "2023-06-20T03:00:51",
|
||||
"url": "https://huggingface.co/BlinkDL/rwkv-4-world/blob/main/RWKV-4-World-3B-v1-20230619-ctx4096.pth",
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-3B-v1-20230619-ctx4096.pth"
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-3B-v1-20230619-ctx4096.pth",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"Global"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-4-World-CHNtuned-3B-v1-20230625-ctx4096.pth",
|
||||
@@ -221,7 +338,12 @@
|
||||
"SHA256": "7d3b5a4d0e9780a3e3d9ae7c2defbe8564d240bc9a238db4ba70cfb66dc33888",
|
||||
"lastUpdated": "2023-06-25T14:53:27",
|
||||
"url": "https://huggingface.co/BlinkDL/rwkv-4-world/blob/main/RWKV-4-World-CHNtuned-3B-v1-20230625-ctx4096.pth",
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-CHNtuned-3B-v1-20230625-ctx4096.pth"
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-CHNtuned-3B-v1-20230625-ctx4096.pth",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"CN"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-4-World-7B-v1-OnlyForTest_30%_trained-20230529-ctx4096.pth",
|
||||
@@ -312,7 +434,12 @@
|
||||
"SHA256": "db7b011247a0fe4389e1d76e3d6a904185f85d509c8a44ad18bf401094efc293",
|
||||
"lastUpdated": "2023-06-26T16:40:04",
|
||||
"url": "https://huggingface.co/BlinkDL/rwkv-4-world/blob/main/RWKV-4-World-7B-v1-20230626-ctx4096.pth",
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-7B-v1-20230626-ctx4096.pth"
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-7B-v1-20230626-ctx4096.pth",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"Global"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-claude-4-World-7B-20230805-ctx65k.pth",
|
||||
@@ -325,7 +452,12 @@
|
||||
"SHA256": "8cd25f8a1ab58965993cc47b3b2f99585836eed008a2e44526c258189ea751a6",
|
||||
"lastUpdated": "2023-08-05T08:52:20",
|
||||
"url": "https://huggingface.co/xiaol/RWKV-claude-4-World-7B-65k/blob/main/RWKV-claude-4-World-7B-20230805-ctx65k.pth",
|
||||
"downloadUrl": "https://huggingface.co/xiaol/RWKV-claude-4-World-7B-65k/resolve/main/RWKV-claude-4-World-7B-20230805-ctx65k.pth"
|
||||
"downloadUrl": "https://huggingface.co/xiaol/RWKV-claude-4-World-7B-65k/resolve/main/RWKV-claude-4-World-7B-20230805-ctx65k.pth",
|
||||
"tags": [
|
||||
"Finetuned",
|
||||
"RWKV-4",
|
||||
"Global"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-toolformer-translation-japanese-chinese-english-7B-World-20230815-ctx128k.pth",
|
||||
@@ -338,7 +470,12 @@
|
||||
"SHA256": "648a3b21055bdab77021ce278da80fbada8dcaae0b3d41d1eca9aa194c1fd25f",
|
||||
"lastUpdated": "2023-08-15T07:18:23",
|
||||
"url": "https://huggingface.co/xiaol/RWKV-toolformer-translation-japanese-chinese-english-7B-World-128k/blob/main/RWKV-toolformer-translation-japanese-chinese-english-7B-World-20230815-ctx128k.pth",
|
||||
"downloadUrl": "https://huggingface.co/xiaol/RWKV-toolformer-translation-japanese-chinese-english-7B-World-128k/resolve/main/RWKV-toolformer-translation-japanese-chinese-english-7B-World-20230815-ctx128k.pth"
|
||||
"downloadUrl": "https://huggingface.co/xiaol/RWKV-toolformer-translation-japanese-chinese-english-7B-World-128k/resolve/main/RWKV-toolformer-translation-japanese-chinese-english-7B-World-20230815-ctx128k.pth",
|
||||
"tags": [
|
||||
"Finetuned",
|
||||
"RWKV-4",
|
||||
"Global"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-code-4-World-7B-20230820-ctx32k.pth",
|
||||
@@ -351,7 +488,12 @@
|
||||
"SHA256": "19666620437ae3a5fb06e16a52729d67e449fca155fab3d5861ffe9ecf247404",
|
||||
"lastUpdated": "2023-08-20T05:00:17",
|
||||
"url": "https://huggingface.co/xiaol/RWKV-Code-7B-world-32k/blob/main/RWKV-code-4-World-7B-20230820-ctx32k.pth",
|
||||
"downloadUrl": "https://huggingface.co/xiaol/RWKV-Code-7B-world-32k/resolve/main/RWKV-code-4-World-7B-20230820-ctx32k.pth"
|
||||
"downloadUrl": "https://huggingface.co/xiaol/RWKV-Code-7B-world-32k/resolve/main/RWKV-code-4-World-7B-20230820-ctx32k.pth",
|
||||
"tags": [
|
||||
"Finetuned",
|
||||
"RWKV-4",
|
||||
"Global"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "wizard-rwkv-4-world-ctx32k.pth",
|
||||
@@ -364,7 +506,12 @@
|
||||
"SHA256": "c5d991f315a1676d4bed93dd91f803b1376096e7a4af5bf72b339d055f53bac7",
|
||||
"lastUpdated": "2023-07-29T03:21:47",
|
||||
"url": "https://huggingface.co/xiaol/wizard-rwkv-world-7B-ctx32k/blob/main/wizard-rwkv-4-world-ctx32k.pth",
|
||||
"downloadUrl": "https://huggingface.co/xiaol/wizard-rwkv-world-7B-ctx32k/resolve/main/wizard-rwkv-4-world-ctx32k.pth"
|
||||
"downloadUrl": "https://huggingface.co/xiaol/wizard-rwkv-world-7B-ctx32k/resolve/main/wizard-rwkv-4-world-ctx32k.pth",
|
||||
"tags": [
|
||||
"Finetuned",
|
||||
"RWKV-4",
|
||||
"Global"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-4-World-CHNtuned-7B-v1-20230709-ctx4096.pth",
|
||||
@@ -377,7 +524,12 @@
|
||||
"SHA256": "52d33e8352a40158d21425fee4f68df1515d6324056f788d2c78a366ef578ffa",
|
||||
"lastUpdated": "2023-07-09T18:23:33",
|
||||
"url": "https://huggingface.co/BlinkDL/rwkv-4-world/blob/main/RWKV-4-World-CHNtuned-7B-v1-20230709-ctx4096.pth",
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-CHNtuned-7B-v1-20230709-ctx4096.pth"
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-CHNtuned-7B-v1-20230709-ctx4096.pth",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"CN"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Readflow-RWKV-4-World-CHNtuned-7B-v1-20230709-ctx32k.pth",
|
||||
@@ -390,7 +542,12 @@
|
||||
"SHA256": "1bd1de8cdbd56b67e1374588fe5d202884049c71278ffcb12f5c4efbdb422ee1",
|
||||
"lastUpdated": "2023-07-20T06:11:29",
|
||||
"url": "https://huggingface.co/xiaol/readflow-rwkv-4-world-ctx32k/blob/main/Readflow-RWKV-4-World-CHNtuned-7B-v1-20230709-ctx32k.pth",
|
||||
"downloadUrl": "https://huggingface.co/xiaol/readflow-rwkv-4-world-ctx32k/resolve/main/Readflow-RWKV-4-World-CHNtuned-7B-v1-20230709-ctx32k.pth"
|
||||
"downloadUrl": "https://huggingface.co/xiaol/readflow-rwkv-4-world-ctx32k/resolve/main/Readflow-RWKV-4-World-CHNtuned-7B-v1-20230709-ctx32k.pth",
|
||||
"tags": [
|
||||
"Finetuned",
|
||||
"RWKV-4",
|
||||
"CN"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "novel-RWKV-4-World-CHNtuned-7B-v1-20230709-ctx32k.pth",
|
||||
@@ -403,7 +560,12 @@
|
||||
"SHA256": "0fe2415ce61af52a8c38c071b475c01b4c9f8a4f2b4aaed6181f0334f3faf7f4",
|
||||
"lastUpdated": "2023-07-28T13:30:59",
|
||||
"url": "https://huggingface.co/xiaol/ruotangwx-rwkv-7b-novel-32k/blob/main/novel-RWKV-4-World-CHNtuned-7B-v1-20230709-ctx32k.pth",
|
||||
"downloadUrl": "https://huggingface.co/xiaol/ruotangwx-rwkv-7b-novel-32k/resolve/main/novel-RWKV-4-World-CHNtuned-7B-v1-20230709-ctx32k.pth"
|
||||
"downloadUrl": "https://huggingface.co/xiaol/ruotangwx-rwkv-7b-novel-32k/resolve/main/novel-RWKV-4-World-CHNtuned-7B-v1-20230709-ctx32k.pth",
|
||||
"tags": [
|
||||
"Finetuned",
|
||||
"RWKV-4",
|
||||
"CN"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "chatgal-RWKV-4-World-CHNtuned-7B-v1-20230709-ctx32k-1000.pth",
|
||||
@@ -416,7 +578,12 @@
|
||||
"SHA256": "aaed29cfd1bddee47c48f564aa800eb001f62fd03290d772647d5678e40d66e8",
|
||||
"lastUpdated": "2023-07-21T08:59:18",
|
||||
"url": "https://huggingface.co/xiaol/chatgal-rwkv-7b-world-32k/blob/main/chatgal-RWKV-4-World-CHNtuned-7B-v1-20230709-ctx32k-1000.pth",
|
||||
"downloadUrl": "https://huggingface.co/xiaol/chatgal-rwkv-7b-world-32k/resolve/main/chatgal-RWKV-4-World-CHNtuned-7B-v1-20230709-ctx32k-1000.pth"
|
||||
"downloadUrl": "https://huggingface.co/xiaol/chatgal-rwkv-7b-world-32k/resolve/main/chatgal-RWKV-4-World-CHNtuned-7B-v1-20230709-ctx32k-1000.pth",
|
||||
"tags": [
|
||||
"Finetuned",
|
||||
"RWKV-4",
|
||||
"CN"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "chatgal-RWKV-4-World-CHNtuned-7B-v1-20230709-ctx32k-500.pth",
|
||||
@@ -429,7 +596,12 @@
|
||||
"SHA256": "b5d347d5dedb4f398ec31489ab87b75b1dee772ae7d0a34c26635cf5d95c8794",
|
||||
"lastUpdated": "2023-07-21T07:31:05",
|
||||
"url": "https://huggingface.co/xiaol/chatgal-rwkv-7b-world-32k/blob/main/chatgal-RWKV-4-World-CHNtuned-7B-v1-20230709-ctx32k-500.pth",
|
||||
"downloadUrl": "https://huggingface.co/xiaol/chatgal-rwkv-7b-world-32k/resolve/main/chatgal-RWKV-4-World-CHNtuned-7B-v1-20230709-ctx32k-500.pth"
|
||||
"downloadUrl": "https://huggingface.co/xiaol/chatgal-rwkv-7b-world-32k/resolve/main/chatgal-RWKV-4-World-CHNtuned-7B-v1-20230709-ctx32k-500.pth",
|
||||
"tags": [
|
||||
"Finetuned",
|
||||
"RWKV-4",
|
||||
"CN"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-4-World-JPNtuned-7B-v1-20230718-ctx4096.pth",
|
||||
@@ -442,7 +614,12 @@
|
||||
"SHA256": "3e4c7664ce893ac1f6bb59cd76664fb5c872cb076bb82dbd534db0555b6e9fa5",
|
||||
"lastUpdated": "2023-07-18T20:01:12",
|
||||
"url": "https://huggingface.co/BlinkDL/rwkv-4-world/blob/main/RWKV-4-World-JPNtuned-7B-v1-20230718-ctx4096.pth",
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-JPNtuned-7B-v1-20230718-ctx4096.pth"
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-JPNtuned-7B-v1-20230718-ctx4096.pth",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"JP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-novel-4-World-7B-20230810-ctx128k.pth",
|
||||
@@ -455,7 +632,12 @@
|
||||
"SHA256": "5e429c49e4cab2f29a93f87a80635422c8710d70e5b1d962c078e47d957389c8",
|
||||
"lastUpdated": "2023-08-10T06:30:32",
|
||||
"url": "https://huggingface.co/xiaol/rwkv-7B-world-novel-128k/blob/main/RWKV-novel-4-World-7B-20230810-ctx128k.pth",
|
||||
"downloadUrl": "https://huggingface.co/xiaol/rwkv-7B-world-novel-128k/resolve/main/RWKV-novel-4-World-7B-20230810-ctx128k.pth"
|
||||
"downloadUrl": "https://huggingface.co/xiaol/rwkv-7B-world-novel-128k/resolve/main/RWKV-novel-4-World-7B-20230810-ctx128k.pth",
|
||||
"tags": [
|
||||
"Finetuned",
|
||||
"RWKV-4",
|
||||
"Global"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-4-Novel-7B-v1-ChnEng-ChnPro-20230410-ctx4096.pth",
|
||||
@@ -467,7 +649,13 @@
|
||||
"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"
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-novel/resolve/main/RWKV-4-Novel-7B-v1-ChnEng-ChnPro-20230410-ctx4096.pth",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"Raven",
|
||||
"Global"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-4-Novel-3B-v1-ChnEng-20230412-ctx4096.pth",
|
||||
@@ -479,7 +667,13 @@
|
||||
"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"
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-novel/resolve/main/RWKV-4-Novel-3B-v1-ChnEng-20230412-ctx4096.pth",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"Raven",
|
||||
"Global"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-4-Novel-7B-v1-ChnEng-20230426-ctx8192.pth",
|
||||
@@ -491,7 +685,13 @@
|
||||
"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"
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-novel/resolve/main/RWKV-4-Novel-7B-v1-ChnEng-20230426-ctx8192.pth",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"Raven",
|
||||
"Global"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-4-Novel-3B-v1-Chn-20230412-ctx4096.pth",
|
||||
@@ -503,7 +703,13 @@
|
||||
"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"
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-novel/resolve/main/RWKV-4-Novel-3B-v1-Chn-20230412-ctx4096.pth",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"Raven",
|
||||
"Global"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-4-Novel-7B-v1-Chn-20230426-ctx8192.pth",
|
||||
@@ -515,7 +721,13 @@
|
||||
"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"
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-novel/resolve/main/RWKV-4-Novel-7B-v1-Chn-20230426-ctx8192.pth",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"Raven",
|
||||
"Global"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-4-Raven-1B5-v11-Eng99%-Other1%-20230425-ctx4096.pth",
|
||||
@@ -528,6 +740,11 @@
|
||||
"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",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"Raven"
|
||||
],
|
||||
"hide": true
|
||||
},
|
||||
{
|
||||
@@ -540,7 +757,12 @@
|
||||
"SHA256": "6bbbffb3ee2372dfa9ef49c599e9a2bc0a01b94b6a264ba9bf5bd524fc38f723",
|
||||
"lastUpdated": "2023-05-21T07:08:56",
|
||||
"url": "https://huggingface.co/BlinkDL/rwkv-4-raven/blob/main/RWKV-4-Raven-1B5-v12-Eng98%25-Other2%25-20230520-ctx4096.pth",
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-raven/resolve/main/RWKV-4-Raven-1B5-v12-Eng98%25-Other2%25-20230520-ctx4096.pth"
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-raven/resolve/main/RWKV-4-Raven-1B5-v12-Eng98%25-Other2%25-20230520-ctx4096.pth",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"Raven"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-4-Raven-3B-v11-Eng99%-Other1%-20230425-ctx4096.pth",
|
||||
@@ -553,6 +775,11 @@
|
||||
"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",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"Raven"
|
||||
],
|
||||
"hide": true
|
||||
},
|
||||
{
|
||||
@@ -565,7 +792,12 @@
|
||||
"SHA256": "1eea1845acfe9729dfdaec66a8d1aeb91a1287d94bebbca5529c13c050540b33",
|
||||
"lastUpdated": "2023-05-21T07:13:25",
|
||||
"url": "https://huggingface.co/BlinkDL/rwkv-4-raven/blob/main/RWKV-4-Raven-3B-v12-Eng98%25-Other2%25-20230520-ctx4096.pth",
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-raven/resolve/main/RWKV-4-Raven-3B-v12-Eng98%25-Other2%25-20230520-ctx4096.pth"
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-raven/resolve/main/RWKV-4-Raven-3B-v12-Eng98%25-Other2%25-20230520-ctx4096.pth",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"Raven"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-4-Raven-3B-v11-Eng49%-Chn49%-Jpn1%-Other1%-20230429-ctx4096.pth",
|
||||
@@ -578,6 +810,12 @@
|
||||
"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",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"Raven",
|
||||
"CN"
|
||||
],
|
||||
"hide": true
|
||||
},
|
||||
{
|
||||
@@ -590,7 +828,13 @@
|
||||
"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"
|
||||
"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",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"Raven",
|
||||
"CN"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-4-Raven-7B-v11x-Eng99%-Other1%-20230429-ctx8192.pth",
|
||||
@@ -603,6 +847,11 @@
|
||||
"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",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"Raven"
|
||||
],
|
||||
"hide": true
|
||||
},
|
||||
{
|
||||
@@ -615,7 +864,12 @@
|
||||
"SHA256": "5a725eaeb9e09b724de6c97e6845dd0283097c7920acd05b46852ab7afa9ec32",
|
||||
"lastUpdated": "2023-05-22T10:32:17",
|
||||
"url": "https://huggingface.co/BlinkDL/rwkv-4-raven/blob/main/RWKV-4-Raven-7B-v12-Eng98%25-Other2%25-20230521-ctx8192.pth",
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-raven/resolve/main/RWKV-4-Raven-7B-v12-Eng98%25-Other2%25-20230521-ctx8192.pth"
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-raven/resolve/main/RWKV-4-Raven-7B-v12-Eng98%25-Other2%25-20230521-ctx8192.pth",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"Raven"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-4-Raven-7B-v10x-Eng49%-Chn50%-Other1%-20230423-ctx4096.pth",
|
||||
@@ -628,6 +882,12 @@
|
||||
"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",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"Raven",
|
||||
"CN"
|
||||
],
|
||||
"hide": true
|
||||
},
|
||||
{
|
||||
@@ -641,6 +901,12 @@
|
||||
"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",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"Raven",
|
||||
"CN"
|
||||
],
|
||||
"hide": true
|
||||
},
|
||||
{
|
||||
@@ -653,7 +919,13 @@
|
||||
"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"
|
||||
"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",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"Raven",
|
||||
"CN"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-4-Raven-14B-v11x-Eng99%-Other1%-20230501-ctx8192.pth",
|
||||
@@ -666,6 +938,11 @@
|
||||
"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",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"Raven"
|
||||
],
|
||||
"hide": true
|
||||
},
|
||||
{
|
||||
@@ -678,7 +955,12 @@
|
||||
"SHA256": "1193b5a9ceab572e4dbb9ed1d798eab7bf4793d18904d08bd4bf183579338ae7",
|
||||
"lastUpdated": "2023-05-23T11:22:41",
|
||||
"url": "https://huggingface.co/BlinkDL/rwkv-4-raven/blob/main/RWKV-4-Raven-14B-v12-Eng98%25-Other2%25-20230523-ctx8192.pth",
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-raven/resolve/main/RWKV-4-Raven-14B-v12-Eng98%25-Other2%25-20230523-ctx8192.pth"
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-raven/resolve/main/RWKV-4-Raven-14B-v12-Eng98%25-Other2%25-20230523-ctx8192.pth",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"Raven"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-4-MIDI-120M-v1-20230714-ctx4096.pth",
|
||||
@@ -691,7 +973,12 @@
|
||||
"SHA256": "161d27dcf50d0958d230601ba1e0f8e7dd9c236105e92d2b833496412ace430c",
|
||||
"lastUpdated": "2023-07-15T08:03:36",
|
||||
"url": "https://huggingface.co/BlinkDL/rwkv-4-music/blob/main/RWKV-4-MIDI-120M-v1-20230714-ctx4096.pth",
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-music/resolve/main/RWKV-4-MIDI-120M-v1-20230714-ctx4096.pth"
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-music/resolve/main/RWKV-4-MIDI-120M-v1-20230714-ctx4096.pth",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"Music"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-4-MIDI-560M-v1-20230717-ctx4096.pth",
|
||||
@@ -704,7 +991,12 @@
|
||||
"SHA256": "62b21841b24af38ef176e9e9d895d9fff730cea8aa0623f53a1784d74ce828d6",
|
||||
"lastUpdated": "2023-07-17T15:02:08",
|
||||
"url": "https://huggingface.co/BlinkDL/rwkv-4-music/blob/main/RWKV-4-MIDI-560M-v1-20230717-ctx4096.pth",
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-music/resolve/main/RWKV-4-MIDI-560M-v1-20230717-ctx4096.pth"
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-4-music/resolve/main/RWKV-4-MIDI-560M-v1-20230717-ctx4096.pth",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-4",
|
||||
"Music"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-5-MIDI-120M-v1-20230728-ctx4096.pth",
|
||||
@@ -717,7 +1009,12 @@
|
||||
"SHA256": "c43d4a2ee7a71a331d05d6cd818dd75f7c48c716e4b98c58e4d27231614b0144",
|
||||
"lastUpdated": "2023-07-29T02:17:27",
|
||||
"url": "https://huggingface.co/BlinkDL/rwkv-5-music/blob/main/RWKV-5-MIDI-120M-v1-20230728-ctx4096.pth",
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-5-music/resolve/main/RWKV-5-MIDI-120M-v1-20230728-ctx4096.pth"
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-5-music/resolve/main/RWKV-5-MIDI-120M-v1-20230728-ctx4096.pth",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-5",
|
||||
"Music"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RWKV-5-MIDI-560M-v1-20230902-ctx4096.pth",
|
||||
@@ -730,7 +1027,12 @@
|
||||
"SHA256": "cb4f2fd8956ca8496d6b2e33bff290c2047759b6fe74884903dbf9c73a11cc77",
|
||||
"lastUpdated": "2023-09-03T04:48:41",
|
||||
"url": "https://huggingface.co/BlinkDL/rwkv-5-music/blob/main/RWKV-5-MIDI-560M-v1-20230902-ctx4096.pth",
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-5-music/resolve/main/RWKV-5-MIDI-560M-v1-20230902-ctx4096.pth"
|
||||
"downloadUrl": "https://huggingface.co/BlinkDL/rwkv-5-music/resolve/main/RWKV-5-MIDI-560M-v1-20230902-ctx4096.pth",
|
||||
"tags": [
|
||||
"Main",
|
||||
"RWKV-5",
|
||||
"Music"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user