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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -233,7 +233,6 @@ 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
- [
237
  {"title": "title of the first article",
238
  "description": "description of the article",
239
  "article": "your custom written article",
@@ -242,7 +241,7 @@ Output Format:
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
  News Articles:
247
  {new_data}
248
  """
@@ -298,7 +297,12 @@ def summarize(inp,history,data=None):
298
  for response in stream:
299
  resp += response.token.text
300
  yield "", [(inp,resp)],None
301
- #out_json=""
 
 
 
 
 
302
  out_json=resp.replace("\n","").strip("</s>")
303
  #out_box.append(out_json.strip("</s>"))
304
  out_box=eval(out_box)
@@ -509,7 +513,8 @@ with gr.Blocks() as app:
509
  keyw = gr.Button("Use Keyword [Experimental]")
510
  with gr.Row():
511
  out_json = gr.JSON()
512
- error_box=gr.JSON()
 
513
  fil = gr.Textbox()
514
  keyw.click(get_records,[inst,out_json],[inst,cb])
515
  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
  {"title": "title of the first article",
237
  "description": "description of the article",
238
  "article": "your custom written article",
 
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}
247
  """
 
297
  for response in stream:
298
  resp += response.token.text
299
  yield "", [(inp,resp)],None
300
+
301
+ #for line in resp.split("\n"):
302
+ #if 'title:' in line.lower():
303
+
304
+
305
+ #out_json=""
306
  out_json=resp.replace("\n","").strip("</s>")
307
  #out_box.append(out_json.strip("</s>"))
308
  out_box=eval(out_box)
 
513
  keyw = gr.Button("Use Keyword [Experimental]")
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])