Skip to content

use an instruct model #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 70 additions & 70 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,73 +1,73 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/miniconda
{
"name": "Miniconda (Python 3)",
"image": "mcr.microsoft.com/devcontainers/miniconda:0-3",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": true,
"configureZshAsDefaultShell": true,
"installOhMyZsh": true,
"upgradePackages": true,
"username": "automatic",
"userUid": "automatic",
"userGid": "automatic"
},
"ghcr.io/devcontainers/features/node:1": {
"nodeGypDependencies": true,
"version": "18"
},
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "latest",
"enableNonRootDocker": "true",
"moby": "true"
},
"ghcr.io/stuartleeks/dev-container-features/shell-history:0": {},
},
"mounts": [
// node modules cache
"source=${localWorkspaceFolderBasename}-node_modules,target=${containerWorkspaceFolder}/node_modules,type=volume",
// models cache
{
"source": "models",
"target": "/models",
"type": "volume"
},
// pip cachce
{
"source": "${localWorkspaceFolderBasename}-pip-cache",
"target": "/home/vscode/.cache/pip",
"type": "volume"
},
],
"remoteEnv": {
"MODELS_DIR": "/models",
"MODEL_FILE": "RWKV-4-Pile-1B5-20220929-ctx4096"
},
// If you have a gpu this will pass it in!
// "runArgs": [
// "--gpus",
// "all"
// ],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
3000,
8080
],
"postCreateCommand": "npm i -g diff-so-fancy && conda init zsh && sudo chown -R vscode node_modules ~/.cache",
"postStartCommand": "npm install",
"customizations": {
"vscode": {
"extensions": [
"dbaeumer.vscode-eslint",
"GitHub.copilot",
"ms-python.pylint",
"ms-python.python",
"streetsidesoftware.code-spell-checker",
],
"settings": {}
},
},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
"name": "Miniconda (Python 3)",
"image": "mcr.microsoft.com/devcontainers/miniconda:0-3",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": true,
"configureZshAsDefaultShell": true,
"installOhMyZsh": true,
"upgradePackages": true,
"username": "automatic",
"userUid": "automatic",
"userGid": "automatic"
},
"ghcr.io/devcontainers/features/node:1": {
"nodeGypDependencies": true,
"version": "18"
},
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "latest",
"enableNonRootDocker": "true",
"moby": "true"
},
"ghcr.io/stuartleeks/dev-container-features/shell-history:0": {},
},
"mounts": [
// node modules cache
"source=${localWorkspaceFolderBasename}-node_modules,target=${containerWorkspaceFolder}/node_modules,type=volume",
// models cache
{
"source": "models",
"target": "/models",
"type": "volume"
},
// pip cachce
{
"source": "${localWorkspaceFolderBasename}-pip-cache",
"target": "/home/vscode/.cache/pip",
"type": "volume"
},
],
"remoteEnv": {
"MODELS_DIR": "/workspaces/rwkv-web-inference/models",
"MODEL_FILE": "RWKV-4-Raven-1B5-v8-Eng-20230408-ctx4096"
},
// If you have a gpu this will pass it in!
// "runArgs": [
// "--gpus",
// "all"
// ],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
3000,
8080
],
"postCreateCommand": "npm i -g diff-so-fancy && conda init zsh && sudo chown -R vscode node_modules ~/.cache",
"postStartCommand": "npm install",
"customizations": {
"vscode": {
"extensions": [
"dbaeumer.vscode-eslint",
"GitHub.copilot",
"ms-python.pylint",
"ms-python.python",
"streetsidesoftware.code-spell-checker",
],
"settings": {}
},
},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
# restart: always
environment:
- MODELS_DIR=/models
- MODEL_FILE=RWKV-4-Pile-1B5-20220929-ctx4096
- MODEL_FILE=RWKV-4-Raven-1B5-v8-Eng-20230408-ctx4096
volumes:
- models:/models
ports:
Expand Down
3 changes: 2 additions & 1 deletion server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
########################################################################################################

# args.RUN_DEVICE = "cuda" # 'cpu' (already very fast) // 'cuda'
# args.FLOAT_MODE = "bf16" # fp32 (good for cpu) // fp16 (might overflow) // bf16 (less accurate)
# fp32 (good for cpu) // fp16 (might overflow) // bf16 (less accurate)
# args.FLOAT_MODE = "fp16"

args.RUN_DEVICE = "cpu" # 'cpu' (already very fast) // 'cuda'
# fp32 (good for cpu) // fp16 (might overflow) // bf16 (less accurate)
Expand Down
2 changes: 1 addition & 1 deletion server/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fi
pushd "$MODELS_DIR"

if [ ! -f "${MODEL_FILE}.pth" ]; then
wget -q https://huggingface.co/BlinkDL/rwkv-4-pile-1b5/resolve/main/RWKV-4-Pile-1B5-20220929-ctx4096.pth
wget -q https://huggingface.co/BlinkDL/rwkv-4-raven/resolve/main/RWKV-4-Raven-1B5-v8-Eng-20230408-ctx4096.pth
fi

popd
Expand Down