remove local_files_only=True
This commit is contained in:
@@ -20,8 +20,7 @@ def create(audio_file, subtitle_file: str = ""):
|
|||||||
logger.info(f"loading model: {model_size}, device: {device}, compute_type: {compute_type}")
|
logger.info(f"loading model: {model_size}, device: {device}, compute_type: {compute_type}")
|
||||||
model = WhisperModel(model_size_or_path=model_size,
|
model = WhisperModel(model_size_or_path=model_size,
|
||||||
device=device,
|
device=device,
|
||||||
compute_type=compute_type,
|
compute_type=compute_type)
|
||||||
local_files_only=True)
|
|
||||||
|
|
||||||
logger.info(f"start, output file: {subtitle_file}")
|
logger.info(f"start, output file: {subtitle_file}")
|
||||||
if not subtitle_file:
|
if not subtitle_file:
|
||||||
@@ -160,6 +159,7 @@ if __name__ == "__main__":
|
|||||||
task_id = "c12fd1e6-4b0a-4d65-a075-c87abe35a072"
|
task_id = "c12fd1e6-4b0a-4d65-a075-c87abe35a072"
|
||||||
task_dir = utils.task_dir(task_id)
|
task_dir = utils.task_dir(task_id)
|
||||||
subtitle_file = f"{task_dir}/subtitle.srt"
|
subtitle_file = f"{task_dir}/subtitle.srt"
|
||||||
|
audio_file = f"{task_dir}/audio.mp3"
|
||||||
|
|
||||||
subtitles = file_to_subtitles(subtitle_file)
|
subtitles = file_to_subtitles(subtitle_file)
|
||||||
print(subtitles)
|
print(subtitles)
|
||||||
@@ -171,3 +171,6 @@ if __name__ == "__main__":
|
|||||||
script = s.get("script")
|
script = s.get("script")
|
||||||
|
|
||||||
correct(subtitle_file, script)
|
correct(subtitle_file, script)
|
||||||
|
|
||||||
|
subtitle_file = f"{task_dir}/subtitle-test.srt"
|
||||||
|
create(audio_file, subtitle_file)
|
||||||
|
|||||||
Reference in New Issue
Block a user