raannakasturi commited on
Commit
6c40cb7
·
verified ·
1 Parent(s): 389dda3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +54 -54
app.py CHANGED
@@ -1,54 +1,54 @@
1
- import gradio as gr
2
- from post_blog import main
3
-
4
- def post_blog(title, category, summary, mindmap, citation, access_key):
5
- status = main(title, category, summary, mindmap, citation, access_key)
6
- return status
7
-
8
- def clear_everything(title, category, summary, mindmap, citation, status, access_key):
9
- return None, None, None, None, None, None, None
10
-
11
- theme = gr.themes.Soft(
12
- primary_hue="purple",
13
- secondary_hue="cyan",
14
- neutral_hue="slate",
15
- font=[
16
- gr.themes.GoogleFont("Syne"),
17
- gr.themes.GoogleFont("Poppins"),
18
- gr.themes.GoogleFont("Poppins"),
19
- gr.themes.GoogleFont("Poppins")
20
- ],
21
- )
22
-
23
- with gr.Blocks(theme=theme, title="ReXplore Blog Poster", fill_height=True) as app:
24
- gr.HTML(
25
- value ="""
26
- <h1 style="text-align: center;">ReXplore Blog Poster <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>
27
- <p style="text-align: center;">This app posts Blogs to Blogger.</p>
28
- """)
29
- with gr.Column():
30
- with gr.Row():
31
- title = gr.Textbox(label="Title", placeholder="Enter Blog Title")
32
- category = gr.Textbox(label="Category", placeholder="Enter Blog Category")
33
- access_key = gr.Textbox(label="Access Key", placeholder="Enter the Access Key", type="password")
34
- with gr.Row():
35
- summary = gr.Textbox(label="Summary", placeholder="Enter the summary", lines=7)
36
- mindmap = gr.Textbox(label="Mindmap", placeholder="Enter the mindmap", lines=7)
37
- citation = gr.Textbox(label="Citation", placeholder="Enter the citation", lines=7)
38
- with gr.Row():
39
- clear_btn = gr.Button(value="Clear", variant="stop")
40
- summarize_btn = gr.Button(value="Summarize", variant="primary")
41
- status = gr.Textbox(label="Status", placeholder="Blog Post Status", interactive=False)
42
- summarize_btn.click(
43
- post_blog,
44
- inputs=[category, title, summary, mindmap, citation, access_key],
45
- outputs=[status],
46
- concurrency_limit=25,
47
- scroll_to_output=True,
48
- show_api=True,
49
- api_name="rexplore_blog_poster",
50
- show_progress="full",
51
- )
52
- clear_btn.click(clear_everything, inputs=[category, title, summary, mindmap, citation, access_key, status], outputs=[category, title, summary, mindmap, citation, access_key, status], show_api=False)
53
-
54
- app.queue(default_concurrency_limit=25).launch(show_api=True)
 
1
+ import gradio as gr
2
+ from post_blog import main
3
+
4
+ def post_blog(title, category, summary, mindmap, citation, access_key):
5
+ status = main(title, category, summary, mindmap, citation, access_key)
6
+ return status
7
+
8
+ def clear_everything(title, category, summary, mindmap, citation, status, access_key):
9
+ return None, None, None, None, None, None, None
10
+
11
+ theme = gr.themes.Soft(
12
+ primary_hue="purple",
13
+ secondary_hue="cyan",
14
+ neutral_hue="slate",
15
+ font=[
16
+ gr.themes.GoogleFont("Syne"),
17
+ gr.themes.GoogleFont("Poppins"),
18
+ gr.themes.GoogleFont("Poppins"),
19
+ gr.themes.GoogleFont("Poppins")
20
+ ],
21
+ )
22
+
23
+ with gr.Blocks(theme=theme, title="ReXplore Blog Poster", fill_height=True) as app:
24
+ gr.HTML(
25
+ value ="""
26
+ <h1 style="text-align: center;">ReXplore Blog Poster <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>
27
+ <p style="text-align: center;">This app posts Blogs to Blogger.</p>
28
+ """)
29
+ with gr.Column():
30
+ with gr.Row():
31
+ title = gr.Textbox(label="Title", placeholder="Enter Blog Title")
32
+ category = gr.Textbox(label="Category", placeholder="Enter Blog Category")
33
+ access_key = gr.Textbox(label="Access Key", placeholder="Enter the Access Key", type="password")
34
+ with gr.Row():
35
+ summary = gr.Textbox(label="Summary", placeholder="Enter the summary", lines=7)
36
+ mindmap = gr.Textbox(label="Mindmap", placeholder="Enter the mindmap", lines=7)
37
+ citation = gr.Textbox(label="Citation", placeholder="Enter the citation", lines=7)
38
+ with gr.Row():
39
+ clear_btn = gr.Button(value="Clear", variant="stop")
40
+ summarize_btn = gr.Button(value="Post Blog", variant="primary")
41
+ status = gr.Textbox(label="Status", placeholder="Blog Post Status", interactive=False)
42
+ summarize_btn.click(
43
+ post_blog,
44
+ inputs=[category, title, summary, mindmap, citation, access_key],
45
+ outputs=[status],
46
+ concurrency_limit=25,
47
+ scroll_to_output=True,
48
+ show_api=True,
49
+ api_name="rexplore_blog_poster",
50
+ show_progress="full",
51
+ )
52
+ clear_btn.click(clear_everything, inputs=[category, title, summary, mindmap, citation, access_key, status], outputs=[category, title, summary, mindmap, citation, access_key, status], show_api=False)
53
+
54
+ app.queue(default_concurrency_limit=25).launch(show_api=True)