Spaces:
Running
Running
jhj0517
commited on
Commit
·
e0f6a34
1
Parent(s):
f22356a
add output path
Browse files
modules/translation/deepl_api.py
CHANGED
|
@@ -168,15 +168,17 @@ class DeepLAPI:
|
|
| 168 |
|
| 169 |
write_file(subtitle, output_path)
|
| 170 |
|
| 171 |
-
files_info[file_name] = subtitle
|
| 172 |
total_result = ''
|
| 173 |
-
|
|
|
|
| 174 |
total_result += '------------------------------------\n'
|
| 175 |
total_result += f'{file_name}\n\n'
|
| 176 |
-
total_result += f'{subtitle}'
|
|
|
|
| 177 |
|
| 178 |
gr_str = f"Done! Subtitle is in the outputs/translation folder.\n\n{total_result}"
|
| 179 |
-
return [gr_str,
|
| 180 |
|
| 181 |
def request_deepl_translate(self,
|
| 182 |
auth_key: str,
|
|
|
|
| 168 |
|
| 169 |
write_file(subtitle, output_path)
|
| 170 |
|
| 171 |
+
files_info[file_name] = {"subtitle": subtitle, "path": output_path}
|
| 172 |
total_result = ''
|
| 173 |
+
result_file_path = []
|
| 174 |
+
for file_name, info in files_info.items():
|
| 175 |
total_result += '------------------------------------\n'
|
| 176 |
total_result += f'{file_name}\n\n'
|
| 177 |
+
total_result += f'{info["subtitle"]}'
|
| 178 |
+
result_file_path.append(info["path"])
|
| 179 |
|
| 180 |
gr_str = f"Done! Subtitle is in the outputs/translation folder.\n\n{total_result}"
|
| 181 |
+
return [gr_str, result_file_path]
|
| 182 |
|
| 183 |
def request_deepl_translate(self,
|
| 184 |
auth_key: str,
|