File size: 1,897 Bytes
927b324
adbfd57
927b324
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ea7c078
1285c5d
ea7c078
 
 
 
927b324
 
 
1285c5d
927b324
 
 
 
 
 
 
65a59ab
1285c5d
65a59ab
 
927b324
 
 
ea7c078
927b324
6cdd093
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
42
43
44
45
46
47
48
49
50
import gradio as gr
from main import post_blogpost, test

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():
            with gr.Row():
                uaccess_key = gr.Textbox(label="Access Key", placeholder="Enter the Access Key", type="password")
                wait_time = gr.Number(value=5, minimum=3, maximum=15, step=1, label="Wait Time", interactive=True)
            with gr.Row():
                start = gr.Button(value="Start", variant="primary")
                test_btn = gr.Button(value="Test", variant="secondary")
        status = gr.Textbox(label="Data", placeholder="Enter the data", lines=7)
    start.click(
        post_blogpost,
        inputs=[uaccess_key],
        outputs=[status],
        concurrency_limit=25,
        scroll_to_output=True,
        show_api=True,
        api_name="rexplore_backend",
        show_progress="full",
    )
    test_btn.click(test,
        inputs=[uaccess_key],
        outputs=[status],
        concurrency_limit=25,
        scroll_to_output=True,
        show_api=True,
        api_name="rexplore_backend_test",
        show_progress="full")

app.queue(default_concurrency_limit=25).launch(show_api=True, max_threads=500, ssr_mode=False)