Spaces:
Runtime error
Runtime error
file_name = "dialogue_output.json"
Browse files
app.py
CHANGED
@@ -20,10 +20,11 @@ def main_function(rounds: int, method: str, role1: str, role2: str):
|
|
20 |
json_output = json.dumps({"dialogue": dialogue}, ensure_ascii=False, indent=4)
|
21 |
|
22 |
# 儲存對話為 JSON 文件
|
23 |
-
|
|
|
24 |
f.write(json_output)
|
25 |
|
26 |
-
return dialogue, audio_path,
|
27 |
|
28 |
|
29 |
def dialogue_to_audio(dialogue):
|
|
|
20 |
json_output = json.dumps({"dialogue": dialogue}, ensure_ascii=False, indent=4)
|
21 |
|
22 |
# 儲存對話為 JSON 文件
|
23 |
+
file_name = "dialogue_output.json"
|
24 |
+
with open(file_name, "w", encoding="utf-8") as f:
|
25 |
f.write(json_output)
|
26 |
|
27 |
+
return dialogue, audio_path, file_name
|
28 |
|
29 |
|
30 |
def dialogue_to_audio(dialogue):
|