From 6930b1781c77b524a2d8c2c6d078a6630ef81383 Mon Sep 17 00:00:00 2001 From: yihong Date: Mon, 21 Nov 2022 13:23:30 +0800 Subject: [PATCH] ci: make ci stable (#52) --- autocut/transcribe.py | 2 ++ setup.cfg | 2 +- test/test_transcribe.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/autocut/transcribe.py b/autocut/transcribe.py index 234d101..690440d 100644 --- a/autocut/transcribe.py +++ b/autocut/transcribe.py @@ -42,6 +42,8 @@ def _detect_voice_activity(self, audio): return [{"start": 0, "end": len(audio)}] tic = time.time() if self.vad_model is None or self.detect_speech is None: + # torch load limit https://github.com/pytorch/vision/issues/4156 + torch.hub._validate_not_a_forked_repo = lambda a, b, c: True self.vad_model, funcs = torch.hub.load( repo_or_dir="snakers4/silero-vad", model="silero_vad", trust_repo=True ) diff --git a/setup.cfg b/setup.cfg index f1eb1d7..c9db10c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,7 +2,7 @@ name = autocut version = attr: autocut.__version__ license = Apache Software License -description = 通过字幕来剪切视频 +description = Cut video by subtitles long_description = file: README.md classifiers = License :: OSI Approved :: Apache Software License diff --git a/test/test_transcribe.py b/test/test_transcribe.py index 0bd7df1..b2f1184 100644 --- a/test/test_transcribe.py +++ b/test/test_transcribe.py @@ -115,7 +115,7 @@ def test_encoding_transcribe(self, file_name): transcribe = Transcribe(args) transcribe.run() with open( - os.path.exists(TEST_VIDEO_PATH + file_name.split(".")[0] + ".md"), + os.path.join(TEST_VIDEO_PATH + file_name.split(".")[0] + ".md"), encoding="gbk", ): self.assertTrue(True)