From 66661be5c74925e61c689f84b2692bf4b2c57657 Mon Sep 17 00:00:00 2001 From: chenqianhe <1278095698@qq.com> Date: Sat, 5 Oct 2024 23:16:54 +0800 Subject: [PATCH 1/4] Add `large-v3-turbo` --- autocut/type.py | 1 + test/test_cut.py | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/autocut/type.py b/autocut/type.py index aacc27c..66965cb 100644 --- a/autocut/type.py +++ b/autocut/type.py @@ -72,6 +72,7 @@ class WhisperModel(Enum): LARGE = "large" LARGE_V2 = "large-v2" LARGE_V3 = "large-v3" + LARGE_V3_TURBO = "large-v3-turbo" @staticmethod def get_values(): diff --git a/test/test_cut.py b/test/test_cut.py index feef41f..973c772 100644 --- a/test/test_cut.py +++ b/test/test_cut.py @@ -14,10 +14,7 @@ def setUpClass(cls): logging.info("检查测试文件是否正常存在") scan_file = os.listdir(TEST_MEDIA_PATH) logging.info( - "应存在文件列表:" - + str(TEST_MEDIA_FILE_SIMPLE) - + " 扫描到文件列表:" - + str(scan_file) + "应存在文件列表:" + str(TEST_MEDIA_FILE_SIMPLE) + " 扫描到文件列表:" + str(scan_file) ) for file in TEST_MEDIA_FILE_SIMPLE: assert file in scan_file From 78939cd915746991938ad84d417ba33c3f470050 Mon Sep 17 00:00:00 2001 From: chenqianhe <1278095698@qq.com> Date: Sat, 5 Oct 2024 23:19:15 +0800 Subject: [PATCH 2/4] Refactor code --- test/test_cut.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/test_cut.py b/test/test_cut.py index 973c772..feef41f 100644 --- a/test/test_cut.py +++ b/test/test_cut.py @@ -14,7 +14,10 @@ def setUpClass(cls): logging.info("检查测试文件是否正常存在") scan_file = os.listdir(TEST_MEDIA_PATH) logging.info( - "应存在文件列表:" + str(TEST_MEDIA_FILE_SIMPLE) + " 扫描到文件列表:" + str(scan_file) + "应存在文件列表:" + + str(TEST_MEDIA_FILE_SIMPLE) + + " 扫描到文件列表:" + + str(scan_file) ) for file in TEST_MEDIA_FILE_SIMPLE: assert file in scan_file From 6f06996144372993c48443c7f02e86fbaf7aef7a Mon Sep 17 00:00:00 2001 From: chenqianhe <1278095698@qq.com> Date: Sat, 5 Oct 2024 23:29:48 +0800 Subject: [PATCH 3/4] Update version and README --- README.md | 6 ++++++ autocut/__init__.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c467051..c73a45b 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,12 @@ AutoCut 对你的视频自动生成字幕。然后你选择需要保留的句子,AutoCut 将对你视频中对应的片段裁切并保存。你无需使用视频编辑软件,只需要编辑文本文件即可完成剪切。 +**2024.10.05更新**:支持 `large-v3-turbo` [模型](https://github.com/openai/whisper/discussions/2363),提供更快的转录速度。 + +```shell +autocut -t xxx --whisper-model large-v3-turbo +```` + **2024.03.10更新**:支持 pip 安装和提供 import 转录相关的功能 ```shell diff --git a/autocut/__init__.py b/autocut/__init__.py index 19b0979..e232be1 100644 --- a/autocut/__init__.py +++ b/autocut/__init__.py @@ -1,4 +1,4 @@ -__version__ = "1.0.2" +__version__ = "1.1.0" from .type import LANG, WhisperModel, WhisperMode from .utils import load_audio From 60b452303667cbde07310736bdc02b76dbd1a89c Mon Sep 17 00:00:00 2001 From: chenqianhe <1278095698@qq.com> Date: Sat, 5 Oct 2024 23:46:14 +0800 Subject: [PATCH 4/4] Fix action --- .github/workflows/base.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml index 61dfceb..70efd8e 100644 --- a/.github/workflows/base.yml +++ b/.github/workflows/base.yml @@ -12,8 +12,8 @@ jobs: strategy: matrix: python-version: ['3.9', '3.10'] - # macos did not support m1 for now - os: [ubuntu, windows, macos] + # Wait for fix on macos-m1: https://github.com/federicocarboni/setup-ffmpeg/issues/21 + os: [ubuntu, windows, macos-12] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} @@ -32,7 +32,7 @@ jobs: path: ${{ steps.set_variables.outputs.PIP_CACHE }} key: ${{ runner.os }}-pip-${{ steps.set_variables.outputs.PY }} - - name: Setup ffmpeg for differnt platforms + - name: Setup ffmpeg for different platforms uses: FedericoCarboni/setup-ffmpeg@v3 - name: Install dependencies