Test: ran the code and checked for ffmpeg functionality
This commit is contained in:
-20
@@ -1,20 +0,0 @@
|
||||
import os
|
||||
|
||||
from src.transcript_generator import TranscriptGenerator
|
||||
|
||||
|
||||
def main():
|
||||
# input could be a YouTube link or a local file
|
||||
input_sources = ["https://www.youtube.com/watch?v=BVVo1BaL6JA"]
|
||||
|
||||
hf_token = os.environ.get("HF_TOKEN")
|
||||
if not hf_token:
|
||||
hf_token = input("Please enter your HF_TOKEN: ")
|
||||
os.environ["HF_TOKEN"] = hf_token
|
||||
|
||||
transcript_generator = TranscriptGenerator()
|
||||
transcript_generator.generate(input_sources)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
+2
-4
@@ -102,14 +102,12 @@ class Transcriber:
|
||||
logger.exception("Failed to save transcript: %s", e)
|
||||
raise
|
||||
|
||||
def _clear_memory(self):
|
||||
@staticmethod
|
||||
def _clear_memory():
|
||||
"""
|
||||
Clear GPU memory.
|
||||
"""
|
||||
try:
|
||||
del self.transcription_model
|
||||
del self.alignment_model
|
||||
del self.metadata
|
||||
gc.collect()
|
||||
torch.cuda.empty_cache()
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user