Richard Fan commited on
Commit
85348f7
1 Parent(s): abb7128
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -158,7 +158,7 @@ with gr.Blocks() as demo:
158
  with gr.Box():
159
  token = gr.Textbox(label="OpenAI API Key", type="password")
160
  with gr.Box():
161
- description = gr.HTML(value="Send an email to the below address using the configuration on the right. Requires a sendgrid token. These values are not needed to use the right side of this page.")
162
  email = gr.Textbox(label="Email address", type="email", placeholder="")
163
  sendgrid_token = gr.Textbox(label="SendGrid API Key", type="password")
164
  with gr.Row():
@@ -175,10 +175,12 @@ with gr.Blocks() as demo:
175
  subject.change(fn=change_subsubject, inputs=[subject, physics_subject], outputs=subsubject)
176
  physics_subject.change(fn=change_subsubject, inputs=[subject, physics_subject], outputs=subsubject)
177
 
178
- interest = gr.Textbox(label="A natural language description of what you are interested in. Press shift-enter to update.", lines=7)
 
179
  sample_output = gr.Textbox(label="Results for your configuration")
180
  test_btn.click(fn=test, inputs=[email, subject, physics_subject, subsubject, interest, sendgrid_token], outputs=output)
181
  token.change(fn=register_openai_token, inputs=[token])
 
182
  subject.change(fn=sample, inputs=[email, subject, physics_subject, subsubject, interest], outputs=sample_output)
183
  physics_subject.change(fn=sample, inputs=[email, subject, physics_subject, subsubject, interest], outputs=sample_output)
184
  subsubject.change(fn=sample, inputs=[email, subject, physics_subject, subsubject, interest], outputs=sample_output)
 
158
  with gr.Box():
159
  token = gr.Textbox(label="OpenAI API Key", type="password")
160
  with gr.Box():
161
+ description = gr.HTML(value="Send an email to the below address using the configuration on the right. Requires a sendgrid token. These values are not needed to use the right side of this page.\n")
162
  email = gr.Textbox(label="Email address", type="email", placeholder="")
163
  sendgrid_token = gr.Textbox(label="SendGrid API Key", type="password")
164
  with gr.Row():
 
175
  subject.change(fn=change_subsubject, inputs=[subject, physics_subject], outputs=subsubject)
176
  physics_subject.change(fn=change_subsubject, inputs=[subject, physics_subject], outputs=subsubject)
177
 
178
+ interest = gr.Textbox(label="A natural language description of what you are interested in. Press shift-enter or click the button below to update.", lines=7)
179
+ sample_btn = gr.Button("Generate Digest")
180
  sample_output = gr.Textbox(label="Results for your configuration")
181
  test_btn.click(fn=test, inputs=[email, subject, physics_subject, subsubject, interest, sendgrid_token], outputs=output)
182
  token.change(fn=register_openai_token, inputs=[token])
183
+ sample_btn.click(fn=sample, inputs=[email, subject, physics_subject, subsubject, interest], outputs=sample_output)
184
  subject.change(fn=sample, inputs=[email, subject, physics_subject, subsubject, interest], outputs=sample_output)
185
  physics_subject.change(fn=sample, inputs=[email, subject, physics_subject, subsubject, interest], outputs=sample_output)
186
  subsubject.change(fn=sample, inputs=[email, subject, physics_subject, subsubject, interest], outputs=sample_output)