Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -114,7 +114,7 @@ Provided News Articles:
|
|
114 |
{new_data}
|
115 |
"""
|
116 |
output_format="""{"title": "title of the first article","description": "description of the article","article": "your custom written article","links": "all source links that have contributed to the article"},{"title": "title of the second article","description": "description of the article","article": "your custom written article","links": "all source links that have contributed to the article"}"""
|
117 |
-
def summarize(inp,history,data=None):
|
118 |
json_box=[]
|
119 |
if inp == "":
|
120 |
inp = "Process this data"
|
@@ -126,7 +126,8 @@ def summarize(inp,history,data=None):
|
|
126 |
|
127 |
if data != "Error" and data != "":
|
128 |
timestamp=datetime.datetime.now()
|
129 |
-
seed=random.randint(1,1000000000)
|
|
|
130 |
print(seed)
|
131 |
generate_kwargs = dict(
|
132 |
temperature=0.9,
|
@@ -364,6 +365,7 @@ with gr.Blocks() as app:
|
|
364 |
with gr.Row():
|
365 |
rss_custom=gr.Textbox(label="URL for RSS feed (.rss,.xml)")
|
366 |
load_btn = gr.Button("Load RSS")
|
|
|
367 |
with gr.Accordion(open=False):
|
368 |
u_btn=gr.Button("Update [RSS Data]")
|
369 |
keyw = gr.Button("Use Keyword [Experimental]")
|
@@ -375,7 +377,7 @@ with gr.Blocks() as app:
|
|
375 |
#keyw.click(get_records,[inst,out_json],[inst,cb])
|
376 |
load_btn.click(load_data,rss_custom,[out_json,cb])
|
377 |
u_btn.click(find_rss,None,[out_json,cb,error_box])
|
378 |
-
sub_btn.click(summarize,[inst,cb,out_json],[inst,cb,error_box])
|
379 |
app.queue(default_concurrency_limit=20).launch()
|
380 |
|
381 |
|
|
|
114 |
{new_data}
|
115 |
"""
|
116 |
output_format="""{"title": "title of the first article","description": "description of the article","article": "your custom written article","links": "all source links that have contributed to the article"},{"title": "title of the second article","description": "description of the article","article": "your custom written article","links": "all source links that have contributed to the article"}"""
|
117 |
+
def summarize(inp,history,seed_slider,data=None):
|
118 |
json_box=[]
|
119 |
if inp == "":
|
120 |
inp = "Process this data"
|
|
|
126 |
|
127 |
if data != "Error" and data != "":
|
128 |
timestamp=datetime.datetime.now()
|
129 |
+
#seed=random.randint(1,1000000000)
|
130 |
+
seed=seed_slider
|
131 |
print(seed)
|
132 |
generate_kwargs = dict(
|
133 |
temperature=0.9,
|
|
|
365 |
with gr.Row():
|
366 |
rss_custom=gr.Textbox(label="URL for RSS feed (.rss,.xml)")
|
367 |
load_btn = gr.Button("Load RSS")
|
368 |
+
seed_slider=gr.Slider(label="Seed",step=1,minimum=1,maximum=9999999999999999999,value=1,interactive=True)
|
369 |
with gr.Accordion(open=False):
|
370 |
u_btn=gr.Button("Update [RSS Data]")
|
371 |
keyw = gr.Button("Use Keyword [Experimental]")
|
|
|
377 |
#keyw.click(get_records,[inst,out_json],[inst,cb])
|
378 |
load_btn.click(load_data,rss_custom,[out_json,cb])
|
379 |
u_btn.click(find_rss,None,[out_json,cb,error_box])
|
380 |
+
sub_btn.click(summarize,[inst,cb,seed_slider,out_json],[inst,cb,error_box])
|
381 |
app.queue(default_concurrency_limit=20).launch()
|
382 |
|
383 |
|