youngtsai commited on
Commit
d58b2ab
·
1 Parent(s): 656113e
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -22,10 +22,8 @@ def main_function(rounds: int, method: str, role1: str, role2: str):
22
  with open("dialogue_output.json", "w", encoding="utf-8") as f:
23
  f.write(json_output)
24
 
25
- # 將對話格式化為 Chatbot 能接受的格式
26
- formatted_dialogue = [{"role": item[0], "content": item[1]} for item in dialogue]
27
-
28
- return formatted_dialogue, audio_path, "dialogue_output.json"
29
 
30
  def dialogue_to_audio(dialogue):
31
  text = " ".join([item[1] for item in dialogue])
 
22
  with open("dialogue_output.json", "w", encoding="utf-8") as f:
23
  f.write(json_output)
24
 
25
+ return dialogue, audio_path, "dialogue_output.json"
26
+
 
 
27
 
28
  def dialogue_to_audio(dialogue):
29
  text = " ".join([item[1] for item in dialogue])