Spaces:
Build error
Build error
DWizard commited on
Commit ·
00ca03a
1
Parent(s): f01af1f
task_config & improvement
Browse filesFormer-commit-id: 497c2df17859e1c0d7fd9d17df7ef096741a7350
- configs/task_config.yaml +6 -0
- src/task.py +4 -3
configs/task_config.yaml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# configuration for each task
|
| 2 |
+
model: "gpt-4"
|
| 3 |
+
local_dump: ./local_dump
|
| 4 |
+
output_type: srt
|
| 5 |
+
target_lang: CN
|
| 6 |
+
field: SC2
|
src/task.py
CHANGED
|
@@ -111,11 +111,12 @@ class Task:
|
|
| 111 |
self.SRT_Script.form_whole_sentence()
|
| 112 |
# self.SRT_Script.spell_check_term()
|
| 113 |
self.SRT_Script.correct_with_force_term()
|
| 114 |
-
|
|
|
|
| 115 |
|
| 116 |
-
if self.
|
| 117 |
logging.info("write English .srt file to .ass")
|
| 118 |
-
assSub_en = srt2ass(
|
| 119 |
logging.info('ASS subtitle saved as: ' + assSub_en)
|
| 120 |
self.script_input = self.SRT_Script.get_source_only()
|
| 121 |
pass
|
|
|
|
| 111 |
self.SRT_Script.form_whole_sentence()
|
| 112 |
# self.SRT_Script.spell_check_term()
|
| 113 |
self.SRT_Script.correct_with_force_term()
|
| 114 |
+
processed_srt_path_en = str(Path(self.srt_path).with_suffix('')) + '_processed.srt'
|
| 115 |
+
self.SRT_Script.write_srt_file_src(processed_srt_path_en)
|
| 116 |
|
| 117 |
+
if self.output_type == "ass":
|
| 118 |
logging.info("write English .srt file to .ass")
|
| 119 |
+
assSub_en = srt2ass(processed_srt_path_en)
|
| 120 |
logging.info('ASS subtitle saved as: ' + assSub_en)
|
| 121 |
self.script_input = self.SRT_Script.get_source_only()
|
| 122 |
pass
|