abdeladim-s / subsai

🎞️ Subtitles generation tool (Web-UI + CLI + Python package) powered by OpenAI's Whisper and its variants 🎞️
https://abdeladim-s.github.io/subsai/
GNU General Public License v3.0
1.31k stars 107 forks source link

Tests failing #125

Closed lotka closed 8 months ago

lotka commented 8 months ago

In order to run the tests I had to make the following changes:

diff --git a/tests/test_main.py b/tests/test_main.py
index ab52c5b..caf15e9 100644
--- a/tests/test_main.py
+++ b/tests/test_main.py
@@ -45,7 +45,7 @@ class TestSubsAI(TestCase):
         for model in self.subs_ai.available_models():
             model_instance = self.subs_ai.create_model(model)
             for file in self.files:
-                subs = model_instance.transcribe(file, model_instance)
+                subs = model_instance.transcribe(file)
                 self.assertIsInstance(subs, SSAFile, 'transcribe function should return `pysubs2.SSAFile`')

@@ -67,6 +67,6 @@ class TestTools(TestCase):

     def test_merge_subs_with_video(self):
-        Tools.merge_subs_with_video2({'English': self.subs}, self.file, 'subs-merged')
+        Tools.merge_subs_with_video({'English': self.subs}, self.file, 'subs-merged')
         in_file = pathlib.Path(self.file)
         self.assertTrue((in_file.parent / f"subs-merged{in_file.suffix}").exists())

merge_subs_with_video2 I believe needs to be merge_subs_with_video

and model_instance.transcribe(file) only needs one argument and doesn't need model_instance passed into it

abdeladim-s commented 8 months ago

Yes I think you are right @lotka. If all the tests succeeded, can you submit a PR to merge those changes as well ? Thanks a lot.

lotka commented 8 months ago

Sure here it is: https://github.com/abdeladim-s/subsai/pull/127

abdeladim-s commented 8 months ago

The PR has been merged. Thanks again @lotka.