raannakasturi commited on
Commit
f64b2ad
·
2 Parent(s): 733aa95 56dd9ba

Merge branch 'main' of https://huggingface.co/spaces/raannakasturi/ReXploreBackend

Browse files
Files changed (2) hide show
  1. app.py +50 -40
  2. post_blog.py +3 -3
app.py CHANGED
@@ -1,41 +1,51 @@
1
- import gradio as gr
2
- from main import post_blogpost
3
-
4
- def clear_everything(title, category, summary, mindmap, citation, status, access_key):
5
- return None, None, None, None, None, None, None
6
-
7
- theme = gr.themes.Soft(
8
- primary_hue="purple",
9
- secondary_hue="cyan",
10
- neutral_hue="slate",
11
- font=[
12
- gr.themes.GoogleFont("Syne"),
13
- gr.themes.GoogleFont("Poppins"),
14
- gr.themes.GoogleFont("Poppins"),
15
- gr.themes.GoogleFont("Poppins")
16
- ],
17
- )
18
-
19
- with gr.Blocks(theme=theme, title="ReXplore Backend", fill_height=True) as app:
20
- gr.HTML(
21
- value ="""
22
- <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>
23
- <p style="text-align: center;">Backend for ReXplore</p>
24
- """)
25
- with gr.Row():
26
- with gr.Column():
27
- access_key = gr.Textbox(label="Access Key", placeholder="Enter the Access Key", type="password")
28
- start = gr.Button(value="Start", variant="primary")
29
- status = gr.Textbox(label="Data", placeholder="Enter the data", lines=7)
30
- start.click(
31
- post_blogpost,
32
- inputs=[access_key],
33
- outputs=[status],
34
- concurrency_limit=25,
35
- scroll_to_output=True,
36
- show_api=True,
37
- api_name="rexplore_backend",
38
- show_progress="full",
39
- )
40
-
 
 
 
 
 
 
 
 
 
 
41
  app.queue(default_concurrency_limit=25).launch(show_api=True, show_error=True, debug=True)
 
1
+ import gradio as gr
2
+ from main import post_blogpost
3
+ from post_blog import test
4
+
5
+ def clear_everything(title, category, summary, mindmap, citation, status, access_key):
6
+ return None, None, None, None, None, None, None
7
+
8
+ theme = gr.themes.Soft(
9
+ primary_hue="purple",
10
+ secondary_hue="cyan",
11
+ neutral_hue="slate",
12
+ font=[
13
+ gr.themes.GoogleFont("Syne"),
14
+ gr.themes.GoogleFont("Poppins"),
15
+ gr.themes.GoogleFont("Poppins"),
16
+ gr.themes.GoogleFont("Poppins")
17
+ ],
18
+ )
19
+
20
+ with gr.Blocks(theme=theme, title="ReXplore Backend", fill_height=True) as app:
21
+ gr.HTML(
22
+ value ="""
23
+ <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>
24
+ <p style="text-align: center;">Backend for ReXplore</p>
25
+ """)
26
+ with gr.Row():
27
+ with gr.Column():
28
+ access_key = gr.Textbox(label="Access Key", placeholder="Enter the Access Key", type="password")
29
+ start = gr.Button(value="Start", variant="primary")
30
+ test_btn = gr.Button(value="Test")
31
+ status = gr.Textbox(label="Data", placeholder="Enter the data", lines=7)
32
+ start.click(
33
+ post_blogpost,
34
+ inputs=[access_key],
35
+ outputs=[status],
36
+ concurrency_limit=25,
37
+ scroll_to_output=True,
38
+ show_api=True,
39
+ api_name="rexplore_backend",
40
+ show_progress="full",
41
+ )
42
+ test_btn.click(test,
43
+ inputs=[access_key],
44
+ outputs=[status],
45
+ concurrency_limit=25,
46
+ scroll_to_output=True,
47
+ show_api=True,
48
+ api_name="rexplore_backend_test",
49
+ show_progress="full",)
50
+
51
  app.queue(default_concurrency_limit=25).launch(show_api=True, show_error=True, debug=True)
post_blog.py CHANGED
@@ -8,9 +8,9 @@ import mistune
8
 
9
  dotenv.load_dotenv()
10
  access_key = os.getenv('ACCESS_KEY')
11
- client_id = os.getenv('CLIENT_ID_1')
12
- client_secret = os.getenv('CLIENT_SECRET_1')
13
- refresh_token = os.getenv('REFRESH_TOKEN_1')
14
  blog_id = os.getenv('BLOG_ID')
15
 
16
  def extract_summary(text):
 
8
 
9
  dotenv.load_dotenv()
10
  access_key = os.getenv('ACCESS_KEY')
11
+ client_id = os.getenv('CLIENT_ID')
12
+ client_secret = os.getenv('CLIENT_SECRET')
13
+ refresh_token = os.getenv('REFRESH_TOKEN')
14
  blog_id = os.getenv('BLOG_ID')
15
 
16
  def extract_summary(text):