Omnibus commited on
Commit
b610a83
·
verified ·
1 Parent(s): 729d28e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -233,6 +233,7 @@ def get_key(inp,data):
233
  NEWS_REPORTER="""You are an Expert News Aggregator. Your duty is to compress all of the News Articles you are given into 10 or more individual articles that capture the full context of the current news. Compile your articles into JSON format which the user will load into an RSS reader for other users to read.
234
  Add NEW DATA that you recieve to your CURRENT DATA by combining and reformatting when needed.
235
  Output Format:
 
236
  {"title": "title of the first article",
237
  "description": "description of the article",
238
  "article": "your custom written article",
@@ -241,6 +242,7 @@ Output Format:
241
  "description": "description of the article",
242
  "article": "your custom written article",
243
  "links": "all source links that have contributed to the article"}
 
244
 
245
  News Articles:
246
  {new_data}
@@ -292,7 +294,7 @@ def summarize(inp,history,data=None):
292
  new_data = out[s:e]
293
  #yield "", [(inp,f'{mes}\n{new_history}')]
294
 
295
- content = NEWS_REPORTER.format(new_data=str(new_data))
296
  stream = client.text_generation(content, **generate_kwargs, stream=True, details=True, return_full_text=False)
297
  for response in stream:
298
  resp += response.token.text
@@ -514,7 +516,7 @@ with gr.Blocks() as app:
514
  with gr.Row():
515
  out_json = gr.JSON()
516
  #error_box=gr.JSON()
517
- error_box=gr.Textbox()
518
  fil = gr.Textbox()
519
  keyw.click(get_records,[inst,out_json],[inst,cb])
520
  load_btn.click(load_data,rss_custom,[out_json,cb])
 
233
  NEWS_REPORTER="""You are an Expert News Aggregator. Your duty is to compress all of the News Articles you are given into 10 or more individual articles that capture the full context of the current news. Compile your articles into JSON format which the user will load into an RSS reader for other users to read.
234
  Add NEW DATA that you recieve to your CURRENT DATA by combining and reformatting when needed.
235
  Output Format:
236
+ [
237
  {"title": "title of the first article",
238
  "description": "description of the article",
239
  "article": "your custom written article",
 
242
  "description": "description of the article",
243
  "article": "your custom written article",
244
  "links": "all source links that have contributed to the article"}
245
+ ]
246
 
247
  News Articles:
248
  {new_data}
 
294
  new_data = out[s:e]
295
  #yield "", [(inp,f'{mes}\n{new_history}')]
296
 
297
+ content = NEWS_REPORTER.format(new_data=str(new_data.replace("{","").replace("}","")))
298
  stream = client.text_generation(content, **generate_kwargs, stream=True, details=True, return_full_text=False)
299
  for response in stream:
300
  resp += response.token.text
 
516
  with gr.Row():
517
  out_json = gr.JSON()
518
  #error_box=gr.JSON()
519
+ error_box=gr.JSON()
520
  fil = gr.Textbox()
521
  keyw.click(get_records,[inst,out_json],[inst,cb])
522
  load_btn.click(load_data,rss_custom,[out_json,cb])