youngtsai commited on
Commit
1e07170
·
1 Parent(s): e3bfb15

def main_function(password: str, rounds: int, method: str, role1: str, role2: str):

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -13,7 +13,7 @@ def generate_dialogue(rounds, method, role1, role2):
13
  dialogue = [{"role": role1, "content": "手動輸入文本 1"}, {"role": role2, "content": "手動輸入文本 2"}]
14
  return dialogue
15
 
16
- def main_function(rounds: int, method: str, role1: str, role2: str):
17
  if password != os.environ.get("PASSWORD", ""):
18
  return "错误的密码,请重新输入。", "", ""
19
 
@@ -51,6 +51,7 @@ if __name__ == "__main__":
51
  gr.Interface(
52
  main_function,
53
  [
 
54
  gr.components.Slider(minimum=2, maximum=6, step=2, label="對話輪數"),
55
  gr.components.Dropdown(choices=["auto", "manual"], label="生成方式"),
56
  gr.components.Textbox(label="角色 1 名稱"),
 
13
  dialogue = [{"role": role1, "content": "手動輸入文本 1"}, {"role": role2, "content": "手動輸入文本 2"}]
14
  return dialogue
15
 
16
+ def main_function(password: str, rounds: int, method: str, role1: str, role2: str):
17
  if password != os.environ.get("PASSWORD", ""):
18
  return "错误的密码,请重新输入。", "", ""
19
 
 
51
  gr.Interface(
52
  main_function,
53
  [
54
+ gr.components.Textbox(label="输入密码", type="password"), # 加入密碼輸入框
55
  gr.components.Slider(minimum=2, maximum=6, step=2, label="對話輪數"),
56
  gr.components.Dropdown(choices=["auto", "manual"], label="生成方式"),
57
  gr.components.Textbox(label="角色 1 名稱"),