Spaces:
Runtime error
Runtime error
Commit
·
d410e1c
1
Parent(s):
46605b1
Update app.py
Browse files
app.py
CHANGED
@@ -132,36 +132,15 @@ with gr.Blocks() as demo:
|
|
132 |
|
133 |
gr.Markdown("### PubMed Article Summarizer")
|
134 |
|
135 |
-
with gr.Row():
|
136 |
-
password_input = gr.Textbox(label="Password", type="password")
|
137 |
|
138 |
-
|
139 |
-
|
|
|
|
|
|
|
|
|
|
|
140 |
|
141 |
-
login_button.click(check_password, inputs=[username_input, password_input], outputs=[login_result])
|
142 |
-
|
143 |
-
with gr.Row():
|
144 |
-
model_input = gr.Textbox(label="Enter the model to use", value="h2oai/h2ogpt-4096-llama2-7b-chat")
|
145 |
-
query_input = gr.Textbox(label="Query Keywords")
|
146 |
-
retmax_input = gr.Slider(minimum=1, maximum=20, value=5, step=1, label="Number of articles")
|
147 |
-
search_button = gr.Button("Search")
|
148 |
-
output_table = gr.Dataframe(headers=["PMID", "Authors", "Title","Abstract" ])
|
149 |
-
summarize_button = gr.Button("Summarize")
|
150 |
-
summary_output = gr.Textbox()
|
151 |
-
|
152 |
-
model_input.visible = False
|
153 |
-
query_input.visible = False
|
154 |
-
summarize_button.visible = False
|
155 |
-
|
156 |
-
def process_login(is_success, message):
|
157 |
-
if is_success:
|
158 |
-
model_input.visible = True
|
159 |
-
query_button.visible = True
|
160 |
-
summarize_button.visible = True
|
161 |
-
login_result.update(value=message)
|
162 |
-
login_result.visible = True
|
163 |
-
|
164 |
-
login_button.click(check_password, inputs=[username_input, password_input], outputs=[process_login])
|
165 |
|
166 |
def update_output_table(query, retmax):
|
167 |
df = search_pubmed(query, retmax)
|
|
|
132 |
|
133 |
gr.Markdown("### PubMed Article Summarizer")
|
134 |
|
|
|
|
|
135 |
|
136 |
+
model_input = gr.Textbox(label="Enter the model to use", value="h2oai/h2ogpt-4096-llama2-7b-chat")
|
137 |
+
query_input = gr.Textbox(label="Query Keywords")
|
138 |
+
retmax_input = gr.Slider(minimum=1, maximum=20, value=5, step=1, label="Number of articles")
|
139 |
+
search_button = gr.Button("Search")
|
140 |
+
output_table = gr.Dataframe(headers=["PMID", "Authors", "Title","Abstract" ])
|
141 |
+
summarize_button = gr.Button("Summarize")
|
142 |
+
summary_output = gr.Textbox()
|
143 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
|
145 |
def update_output_table(query, retmax):
|
146 |
df = search_pubmed(query, retmax)
|