diff --git a/Dockerfile-GPU b/Dockerfile-GPU index 97fdfb4..86795b0 100644 --- a/Dockerfile-GPU +++ b/Dockerfile-GPU @@ -19,4 +19,4 @@ ENV TZ="Asia/Shanghai" EXPOSE 2233 -CMD ["python", "-m", "src.upload.upload"] \ No newline at end of file +CMD ["./start.sh"] \ No newline at end of file diff --git a/README.md b/README.md index 651305b..df8adeb 100644 --- a/README.md +++ b/README.md @@ -173,7 +173,7 @@ pip install -r requirements.txt > [!TIP] > - 有关自动切片的配置在 `bilive.toml` 文件的 `[slice]` 部分。 > - `auto_slice` 默认为 false, 即不进行自动切片。 -> - 可以通过单元测试调试你自己的 prompt,单元测试在 `tests/test_autoslice.py`,执行 `python -m unittest` 即可,后接 `tests.test_autoslice` 测试整个模块,`tests.test_autoslice.TestXXXMain` 测试某个模型。部分模型会返回多个标题,请在 prompt 中指出,仅返回一个标题的字符串即可。 +> - 可以通过单元测试调试你自己的 prompt,单元测试在 `tests/test_autoslice.py`,执行 `python -m unittest` 即可,后接 `tests.test_autoslice` 测试整个模块,`tests.test_autoslice.TestXXXMain` 测试某个模型。部分模型会返回多个标题及 emoji,请在 prompt 中指出,仅返回一个标题的字符串即可,推荐先自行调试确保您的 prompt works,欢迎在 issue 中分享你的 prompt。 MLLM 模型主要用于自动切片后的切片标题生成,此功能默认关闭,如果需要打开请将 `auto_slice` 参数设置为 `true`,并且写下你自己的 `slice_prompt`(可以包含 `{artist}` 关键词会自动替换),其他配置分别有: - `slice_duration` 以秒为单位设置切片时长(不建议超过 180 秒)。 @@ -328,13 +328,17 @@ docker run -itd \ #### 有 GPU 版本 -如果你能看到这行字,说明 0.3.0 版本还没有发布,会在两天内测试完发布,请耐心等待。可以尝试源码部署。注意:0.2.x 版本和 0.3.0 版本不兼容,如需采用 0.2.x 版本,请参考项目文档而不是本 README。 +有 GPU 版本仅支持 amd64 架构,已内置 small 参数量的模型,如需使用其他参数量模型,请自行按照 2.1.2 步骤调整。`your_record_password` 规则同上。 ```bash -sudo docker run \ - -itd \ +sudo docker run -itd \ + -v your/path/to/bilive.toml:/app/bilive.toml \ + -v your/path/to/settings.toml:/app/settings.toml \ + -v your/path/to/Videos:/app/Videos \ + -v your/path/to/logs:/app/logs \ --gpus 'all,"capabilities=compute,utility,video"' \ --name bilive_docker_gpu \ + -e RECORD_KEY=your_record_password \ -p 22333:2233 \ ghcr.io/timerring/bilive-gpu:0.3.0 ``` @@ -345,7 +349,7 @@ sudo docker run \ #### 使用镜像 -默认 CPU latest version,如需使用 GPU 版本,请自行在 `compose.yml` 中调整。 +如需使用 GPU 版本,请自行在 `compose.yml` 中调整。 ```bash docker compose up -d diff --git a/docs/installation.md b/docs/installation.md index 06b61b3..5d3ed28 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -241,11 +241,9 @@ sudo docker run \ ### Docker Compose -See [Installation](https://bilive.timerring.com/installation.html) for the adjustment method of `compose.yml`. - #### Use image -Default CPU latest version, if you need to use the GPU version, please adjust it in `compose.yml` yourself. +The default is CPU latest version, if you need to use the GPU version, please modify the `image: ghcr.io/timerring/bilive:X.X.X` to `image: ghcr.io/timerring/bilive-gpu:X.X.X` in `compose.yml`. ```bash docker compose up -d @@ -253,7 +251,17 @@ docker compose up -d #### Self-build -Please adjust the relevant configuration in `compose.yml`, then execute the following command: +> [!IMPORTANT] +> If you want to compose self-built images, **please change the login method** in `src/upload/upload.py` from `LoginController().login_bilibili_with_cookie_file(file)` to `LoginController().login_bilibili(export=False)`, otherwise the login process will fail. + +The relevant configuration has been written, please replace the 3 to 6 lines of `compose.yml` with: + +```yaml + build: + context: . + dockerfile: Dockerfile # Dockerfile-GPU + # image: ghcr.io/timerring/bilive:X.X.X # ghcr.io/timerring/bilive-gpu:X.X.X +``` ```bash docker build