diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index e2b1bef..38f8dea 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -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" +} \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 4603004..104115f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: diff --git a/server/app.py b/server/app.py index 6c6ff8a..42813a5 100644 --- a/server/app.py +++ b/server/app.py @@ -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) diff --git a/server/entrypoint.sh b/server/entrypoint.sh index 70ed285..59d740a 100755 --- a/server/entrypoint.sh +++ b/server/entrypoint.sh @@ -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