drmjh commited on
Commit
be15989
·
1 Parent(s): 916b1ff

Changed exiting behavior

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -63,7 +63,7 @@ def reset_interview() -> tuple[list[list[str | None]], gr.Button, gr.Button]:
63
  gr.Button("Start Interview", visible=True),
64
  gr.Button("Reply", visible=False),
65
  gr.Button("Save Survey", visible=False, variant="secondary"),
66
- gr.Button("Reset Survey", visible=False, variant="stop"),
67
  )
68
 
69
 
@@ -83,7 +83,7 @@ def initialize_interview(
83
  placeholder="Type response here.", interactive=True, show_label=False
84
  ),
85
  gr.Button("Start Interview", visible=False),
86
- gr.Button("Reset Survey", visible=True, variant="stop"),
87
  )
88
 
89
 
@@ -104,8 +104,9 @@ def save_interview(
104
  if pair[i] is not None:
105
  chat_data += [[role, pair[i]]]
106
  chat_table = wandb.Table(data=chat_data, columns=["role", "message"])
107
- gr.Info("Uploading interview transcript to WandB...")
108
  wandb.log({"chat_history": chat_table})
 
109
 
110
 
111
  def call_openai(
@@ -203,7 +204,7 @@ with gr.Blocks() as demo:
203
  show_label=False,
204
  )
205
  startInterview = gr.Button("Start Interview", variant="primary")
206
- resetButton = gr.Button("Reset Survey", visible=False, variant="stop")
207
 
208
  ## INTERACTIONS
209
  startInterview.click(
 
63
  gr.Button("Start Interview", visible=True),
64
  gr.Button("Reply", visible=False),
65
  gr.Button("Save Survey", visible=False, variant="secondary"),
66
+ gr.Button("Save and Exit", visible=False, variant="stop"),
67
  )
68
 
69
 
 
83
  placeholder="Type response here.", interactive=True, show_label=False
84
  ),
85
  gr.Button("Start Interview", visible=False),
86
+ gr.Button("Save and Exit", visible=True, variant="stop"),
87
  )
88
 
89
 
 
104
  if pair[i] is not None:
105
  chat_data += [[role, pair[i]]]
106
  chat_table = wandb.Table(data=chat_data, columns=["role", "message"])
107
+ gr.Info("Uploading interview transcript to WandB, please do not close window...")
108
  wandb.log({"chat_history": chat_table})
109
+ gr.Info("Uploading complete. Thank you for participating.")
110
 
111
 
112
  def call_openai(
 
204
  show_label=False,
205
  )
206
  startInterview = gr.Button("Start Interview", variant="primary")
207
+ resetButton = gr.Button("Save and Exit", visible=False, variant="stop")
208
 
209
  ## INTERACTIONS
210
  startInterview.click(