Spaces:
Running
Running
jhj0517
commited on
Commit
·
320b77a
1
Parent(s):
d8a7425
Enable writer options
Browse files
modules/utils/subtitle_manager.py
CHANGED
|
@@ -339,7 +339,8 @@ def get_writer(
|
|
| 339 |
|
| 340 |
|
| 341 |
def generate_file(
|
| 342 |
-
output_format: str, output_dir: str, result: Union[dict, List[Segment]], output_file_name: str,
|
|
|
|
| 343 |
) -> Tuple[str, str]:
|
| 344 |
output_format = output_format.strip().lower().replace(".", "")
|
| 345 |
|
|
@@ -349,7 +350,7 @@ def generate_file(
|
|
| 349 |
|
| 350 |
file_path = os.path.join(output_dir, f"{output_file_name}.{output_format}")
|
| 351 |
file_writer = get_writer(output_format=output_format, output_dir=output_dir)
|
| 352 |
-
file_writer(result=result, output_file_name=output_file_name)
|
| 353 |
content = read_file(file_path)
|
| 354 |
return content, file_path
|
| 355 |
|
|
|
|
| 339 |
|
| 340 |
|
| 341 |
def generate_file(
|
| 342 |
+
output_format: str, output_dir: str, result: Union[dict, List[Segment]], output_file_name: str,
|
| 343 |
+
add_timestamp: bool = True, **kwargs
|
| 344 |
) -> Tuple[str, str]:
|
| 345 |
output_format = output_format.strip().lower().replace(".", "")
|
| 346 |
|
|
|
|
| 350 |
|
| 351 |
file_path = os.path.join(output_dir, f"{output_file_name}.{output_format}")
|
| 352 |
file_writer = get_writer(output_format=output_format, output_dir=output_dir)
|
| 353 |
+
file_writer(result=result, output_file_name=output_file_name, **kwargs)
|
| 354 |
content = read_file(file_path)
|
| 355 |
return content, file_path
|
| 356 |
|