Refactoring: adapted for changes in cuda, updated README.md, improved logger and added sentence level transcript generation.
Signed-off-by: Orihara Izaya <xloki.stormbringery@gmail.com>
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import os
|
||||
import unittest
|
||||
|
||||
from src.transcriber import Transcriber
|
||||
@@ -9,24 +8,10 @@ class TranscriberTest(unittest.TestCase):
|
||||
self.transcriber = Transcriber()
|
||||
|
||||
def test_transcribe(self):
|
||||
wav_file = '<Your wav file>' # Replace with path to a .wav file on your machine
|
||||
wav_file = "<Your wav file>"
|
||||
result = self.transcriber.transcribe(wav_file)
|
||||
self.assertIsNotNone(result)
|
||||
|
||||
def test_save_transcript(self):
|
||||
wav_file = '<Your wav file>' # Replace with path to a .wav file on your machine
|
||||
result = self.transcriber.transcribe(wav_file)
|
||||
|
||||
json_output_file = '<Path to your temporary JSON output file>' # Temporary output file for testing
|
||||
txt_output_file = '<Path to your temporary TXT output file>' # Temporary output file for testing
|
||||
self.transcriber.save_transcript(json_output_file, txt_output_file)
|
||||
|
||||
self.assertTrue(os.path.exists(json_output_file))
|
||||
self.assertTrue(os.path.exists(txt_output_file))
|
||||
|
||||
os.remove(json_output_file) # clean up after test
|
||||
os.remove(txt_output_file) # clean up after test
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user