Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
zh-plus committed Dec 19, 2024
2 parents 6efe333 + 52a3c41 commit 616d7a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Binary file added tests/data/test_nospeech_video.mp4
Binary file not shown.
6 changes: 6 additions & 0 deletions tests/test_openlrc.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class TestLRCer(unittest.TestCase):
def setUp(self) -> None:
self.audio_path = Path('data/test_audio.wav')
self.video_path = Path('data/test_video.mp4')
self.nospeech_video_path = Path('data/test_nospeech_video.mp4')

def tearDown(self) -> None:
def clear_paths(input_path):
Expand Down Expand Up @@ -78,6 +79,11 @@ def test_video_file_transcription_translation(self):
result = lrcer.run('data/test_video.mp4')
self.assertTrue(result)

def test_nospeech_video_file_transcription_translation(self):
lrcer = LRCer(whisper_model='tiny', device='cpu', compute_type='default')
result = lrcer.run('data/test_nospeech_video.mp4')
self.assertTrue(result)

@patch('openlrc.translate.LLMTranslator.translate', MagicMock(side_effect=Exception('test exception')))
def test_translation_error(self):
lrcer = LRCer(whisper_model='tiny', device='cpu', compute_type='default')
Expand Down

0 comments on commit 616d7a6

Please sign in to comment.