Spaces:
Running
Running
Commit
·
1285c5d
1
Parent(s):
b813dda
Rename access_key to uaccess_key for consistency in app.py and post_blog.py
Browse files- app.py +3 -3
- post_blog.py +3 -3
app.py
CHANGED
@@ -23,7 +23,7 @@ with gr.Blocks(theme=theme, title="ReXplore Backend", fill_height=True) as app:
|
|
23 |
with gr.Row():
|
24 |
with gr.Column():
|
25 |
with gr.Row():
|
26 |
-
|
27 |
wait_time = gr.Number(value=5, minimum=3, maximum=15, step=1, label="Wait Time", interactive=True)
|
28 |
with gr.Row():
|
29 |
start = gr.Button(value="Start", variant="primary")
|
@@ -31,7 +31,7 @@ with gr.Blocks(theme=theme, title="ReXplore Backend", fill_height=True) as app:
|
|
31 |
status = gr.Textbox(label="Data", placeholder="Enter the data", lines=7)
|
32 |
start.click(
|
33 |
post_blogpost,
|
34 |
-
inputs=[
|
35 |
outputs=[status],
|
36 |
concurrency_limit=25,
|
37 |
scroll_to_output=True,
|
@@ -40,7 +40,7 @@ with gr.Blocks(theme=theme, title="ReXplore Backend", fill_height=True) as app:
|
|
40 |
show_progress="full",
|
41 |
)
|
42 |
test_btn.click(test,
|
43 |
-
inputs=[
|
44 |
outputs=[status],
|
45 |
concurrency_limit=25,
|
46 |
scroll_to_output=True,
|
|
|
23 |
with gr.Row():
|
24 |
with gr.Column():
|
25 |
with gr.Row():
|
26 |
+
uaccess_key = gr.Textbox(label="Access Key", placeholder="Enter the Access Key", type="password")
|
27 |
wait_time = gr.Number(value=5, minimum=3, maximum=15, step=1, label="Wait Time", interactive=True)
|
28 |
with gr.Row():
|
29 |
start = gr.Button(value="Start", variant="primary")
|
|
|
31 |
status = gr.Textbox(label="Data", placeholder="Enter the data", lines=7)
|
32 |
start.click(
|
33 |
post_blogpost,
|
34 |
+
inputs=[uaccess_key],
|
35 |
outputs=[status],
|
36 |
concurrency_limit=25,
|
37 |
scroll_to_output=True,
|
|
|
40 |
show_progress="full",
|
41 |
)
|
42 |
test_btn.click(test,
|
43 |
+
inputs=[uaccess_key],
|
44 |
outputs=[status],
|
45 |
concurrency_limit=25,
|
46 |
scroll_to_output=True,
|
post_blog.py
CHANGED
@@ -117,7 +117,7 @@ def post_blog(title, category, summary, mindmap, citation, uaccess_key, wait_tim
|
|
117 |
print('Failed to create post')
|
118 |
return False
|
119 |
|
120 |
-
def test(
|
121 |
data = {
|
122 |
"status": "success",
|
123 |
"Astrophysics": {
|
@@ -143,8 +143,8 @@ def test(access_key):
|
|
143 |
summary = paperdata['summary']
|
144 |
mindmap = paperdata['mindmap']
|
145 |
citation = paperdata['citation']
|
146 |
-
|
147 |
-
status = post_blog(title, category, summary, mindmap, citation,
|
148 |
print(status)
|
149 |
return status
|
150 |
|
|
|
117 |
print('Failed to create post')
|
118 |
return False
|
119 |
|
120 |
+
def test(uaccess_key):
|
121 |
data = {
|
122 |
"status": "success",
|
123 |
"Astrophysics": {
|
|
|
143 |
summary = paperdata['summary']
|
144 |
mindmap = paperdata['mindmap']
|
145 |
citation = paperdata['citation']
|
146 |
+
uaccess_key = access_key
|
147 |
+
status = post_blog(title, category, summary, mindmap, citation, uaccess_key, 0)
|
148 |
print(status)
|
149 |
return status
|
150 |
|