File size: 1,579 Bytes
9e062cd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4b0577b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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, show_error=True, debug=True)