tregu0458 commited on
Commit
519198a
·
verified ·
1 Parent(s): 1517e67

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -33,6 +33,7 @@ def fetch_message(df, num, direction):
33
  else:
34
  return "これ以上のメッセージはありません。", num, ""
35
 
 
36
  def create_prompt(instruction, num, tone, limit):
37
  return f"{instruction}\n## 制約条件\n- {num}文字以上\n- {tone}\n- {limit}\n"
38
 
@@ -142,8 +143,8 @@ with gr.Blocks() as demo:
142
  target.change(create_prompt, [prompt_now, slider_select, target, limit], textbox_submit)
143
  limit.change(create_prompt, [prompt_now, slider_select, target, limit], textbox_submit)
144
 
145
- button_next.click(lambda df, num: fetch_message(df, num, 1), [df, number_now], [message, number_now, textbox_submit, prompt_now])
146
- button_back.click(lambda df, num: fetch_message(df, num, -1), [df, number_now], [message, number_now, textbox_submit, prompt_now])
147
 
148
  button_submit.click(respond, [textbox_submit, chat, system_prompt, model, api_key, temperature, max_tokens], chat)
149
  clear_button.add([chat, textbox_submit])
 
33
  else:
34
  return "これ以上のメッセージはありません。", num, ""
35
 
36
+
37
  def create_prompt(instruction, num, tone, limit):
38
  return f"{instruction}\n## 制約条件\n- {num}文字以上\n- {tone}\n- {limit}\n"
39
 
 
143
  target.change(create_prompt, [prompt_now, slider_select, target, limit], textbox_submit)
144
  limit.change(create_prompt, [prompt_now, slider_select, target, limit], textbox_submit)
145
 
146
+ button_next.click(lambda df, num: fetch_message(df, num, 1), [df, number_now], [message, number_now, textbox_submit])
147
+ button_back.click(lambda df, num: fetch_message(df, num, -1), [df, number_now], [message, number_now, textbox_submit])
148
 
149
  button_submit.click(respond, [textbox_submit, chat, system_prompt, model, api_key, temperature, max_tokens], chat)
150
  clear_button.add([chat, textbox_submit])