Spaces:
Running
Running
import gradio as gr | |
from main import post_blogpost | |
def clear_everything(title, category, summary, mindmap, citation, status, access_key): | |
return None, None, None, None, None, None, None | |
theme = gr.themes.Soft( | |
primary_hue="purple", | |
secondary_hue="cyan", | |
neutral_hue="slate", | |
font=[ | |
gr.themes.GoogleFont("Syne"), | |
gr.themes.GoogleFont("Poppins"), | |
gr.themes.GoogleFont("Poppins"), | |
gr.themes.GoogleFont("Poppins") | |
], | |
) | |
with gr.Blocks(theme=theme, title="ReXplore Backend", fill_height=True) as app: | |
gr.HTML( | |
value =""" | |
<h1 style="text-align: center;">ReXplore Backend<p style="text-align: center;">Designed and Developed by <a href="https://raannakasturi.eu.org" target="_blank" rel="nofollow noreferrer external">Nayan Kasturi</a></p> </h1> | |
<p style="text-align: center;">Backend for ReXplore</p> | |
""") | |
with gr.Row(): | |
with gr.Column(): | |
access_key = gr.Textbox(label="Access Key", placeholder="Enter the Access Key", type="password") | |
start = gr.Button(value="Start", variant="primary") | |
status = gr.Textbox(label="Data", placeholder="Enter the data", lines=7) | |
start.click( | |
post_blogpost, | |
inputs=[access_key], | |
outputs=[status], | |
concurrency_limit=25, | |
scroll_to_output=True, | |
show_api=True, | |
api_name="rexplore_backend", | |
show_progress="full", | |
) | |
app.queue(default_concurrency_limit=25).launch(show_api=True) |