Spaces:
Runtime error
Runtime error
Richard Fan
commited on
Commit
·
478b8c5
1
Parent(s):
a73c2d7
update app
Browse files
app.py
CHANGED
|
@@ -154,17 +154,8 @@ def register_openai_token(token):
|
|
| 154 |
|
| 155 |
with gr.Blocks() as demo:
|
| 156 |
with gr.Row():
|
| 157 |
-
with gr.Column(scale=0.40):
|
| 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.<br>")
|
| 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():
|
| 165 |
-
test_btn = gr.Button("Send email")
|
| 166 |
-
output = gr.Textbox(show_label=False, placeholder="email status")
|
| 167 |
with gr.Column(scale=1):
|
|
|
|
| 168 |
subject = gr.Radio(
|
| 169 |
list(topics.keys()), label="Topic"
|
| 170 |
)
|
|
@@ -177,7 +168,22 @@ with gr.Blocks() as demo:
|
|
| 177 |
|
| 178 |
interest = gr.Textbox(label="A natural language description of what you are interested in.", info="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.", info="For runtime purposes, this is only done on a small subset of
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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)
|
|
@@ -186,4 +192,4 @@ with gr.Blocks() as demo:
|
|
| 186 |
subsubject.change(fn=sample, inputs=[email, subject, physics_subject, subsubject, interest], outputs=sample_output)
|
| 187 |
interest.submit(fn=sample, inputs=[email, subject, physics_subject, subsubject, interest], outputs=sample_output)
|
| 188 |
|
| 189 |
-
demo.launch()
|
|
|
|
| 154 |
|
| 155 |
with gr.Blocks() as demo:
|
| 156 |
with gr.Row():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 157 |
with gr.Column(scale=1):
|
| 158 |
+
token = gr.Textbox(label="OpenAI API Key", type="password")
|
| 159 |
subject = gr.Radio(
|
| 160 |
list(topics.keys()), label="Topic"
|
| 161 |
)
|
|
|
|
| 168 |
|
| 169 |
interest = gr.Textbox(label="A natural language description of what you are interested in.", info="Press shift-enter or click the button below to update.", lines=7)
|
| 170 |
sample_btn = gr.Button("Generate Digest")
|
| 171 |
+
sample_output = gr.Textbox(label="Results for your configuration.", info="For runtime purposes, this is only done on a small subset of recent papers in the topic you have selected.")
|
| 172 |
+
with gr.Column(scale=0.40):
|
| 173 |
+
with gr.Box():
|
| 174 |
+
title = gr.Markdown(
|
| 175 |
+
"""
|
| 176 |
+
# Email Setup, Optional
|
| 177 |
+
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.
|
| 178 |
+
|
| 179 |
+
To create a scheduled job for this, see our [Github Repository](https://github.com/AutoLLM/ArxivDigest)
|
| 180 |
+
""",
|
| 181 |
+
interactive=False, show_label=False)
|
| 182 |
+
email = gr.Textbox(label="Email address", type="email", placeholder="")
|
| 183 |
+
sendgrid_token = gr.Textbox(label="SendGrid API Key", type="password")
|
| 184 |
+
with gr.Row():
|
| 185 |
+
test_btn = gr.Button("Send email")
|
| 186 |
+
output = gr.Textbox(show_label=False, placeholder="email status")
|
| 187 |
test_btn.click(fn=test, inputs=[email, subject, physics_subject, subsubject, interest, sendgrid_token], outputs=output)
|
| 188 |
token.change(fn=register_openai_token, inputs=[token])
|
| 189 |
sample_btn.click(fn=sample, inputs=[email, subject, physics_subject, subsubject, interest], outputs=sample_output)
|
|
|
|
| 192 |
subsubject.change(fn=sample, inputs=[email, subject, physics_subject, subsubject, interest], outputs=sample_output)
|
| 193 |
interest.submit(fn=sample, inputs=[email, subject, physics_subject, subsubject, interest], outputs=sample_output)
|
| 194 |
|
| 195 |
+
demo.launch(show_api=False)
|