hra commited on
Commit
c125010
1 Parent(s): 9c5ac16

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -24,10 +24,10 @@ def getstuff(openapikey,category_selector):
24
 
25
  if whichone=="Automotive":
26
  rssurl="https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=10000101"
27
- querylist=["What are the top trends? Give output as a json (that can be converted to pandas dataframe) with 3 columns named trend, company mentioned & reason","You are an award winning email writer. Write an email summarizing the news. Do not say I am language model and cannot do this","Name the top & bottom performing companies? Give output as a json (that can be converted to pandas dataframe) with 4 columns named sector, company names, reason & top/bottom","You are an award winning email writer. Write an email summarizing the key macro trends basis the news.Do not say I am language model and cannot do this"]
28
  elif whichone=="Retail":
29
  rssurl="https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=10000116"
30
- querylist=["What are the top trends? Give output as a json (that can be converted to pandas dataframe) with 3 columns named trend, company mentioned & reason","You are an award winning email writer. Write an email summarizing the news. Do not say I am language model and cannot do this","Name the top & bottom performing companies? Give output as a json (that can be converted to pandas dataframe) with 4 columns named sector, company names, reason & top/bottom","You are an award winning email writer. Write an email summarizing the key macro trends basis the news.Do not say I am language model and cannot do this"]
31
  elif whichone=='Earnings Announcements':
32
  rssurl="https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=15839135"
33
  querylist=["Basis companies that are doing well name the sectors with positive momentum? Give output as a json (that can be converted to pandas dataframe) with 3 columns named sector, company names & reason","Name the top & bottom performing companies? Give output as a json (that can be converted to pandas dataframe) with 4 columns named sector, company names, reason & top/bottom","You are an award winning email writer. Write an email summarizing the news. Do not say I am language model and cannot do this","You are an award winning email writer. Write an email summarizing the key macro trends basis the news.Do not say I am language model and cannot do this"]
@@ -41,7 +41,7 @@ def getstuff(openapikey,category_selector):
41
 
42
  answerlist=[]
43
  for i in range(len(querylist)):
44
- print(i)
45
  response = index.query(
46
  querylist[i],
47
  llm_predictor=llm_predictor,
@@ -58,7 +58,8 @@ def getstuff(openapikey,category_selector):
58
  answerlist.append(df)
59
  else:
60
  answerlist.append(response.response)
61
-
 
62
  return answerlist
63
 
64
  with gr.Blocks() as demo:
 
24
 
25
  if whichone=="Automotive":
26
  rssurl="https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=10000101"
27
+ querylist=["What are the top trends? Give output as a json (that can be converted to pandas dataframe) with 3 columns named trend, company mentioned & reason","Name the top & bottom performing companies? Give output as a json (that can be converted to pandas dataframe) with 4 columns named sector, company names, reason & top/bottom","You are an award winning email writer. Write an email summarizing the news. Do not say I am language model and cannot do this","You are an award winning email writer. Write an email summarizing the key macro trends basis the news.Do not say I am language model and cannot do this"]
28
  elif whichone=="Retail":
29
  rssurl="https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=10000116"
30
+ querylist=["What are the top trends? Give output as a json (that can be converted to pandas dataframe) with 3 columns named trend, company mentioned & reason","Name the top & bottom performing companies? Give output as a json (that can be converted to pandas dataframe) with 4 columns named sector, company names, reason & top/bottom","You are an award winning email writer. Write an email summarizing the news. Do not say I am language model and cannot do this","You are an award winning email writer. Write an email summarizing the key macro trends basis the news.Do not say I am language model and cannot do this"]
31
  elif whichone=='Earnings Announcements':
32
  rssurl="https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=15839135"
33
  querylist=["Basis companies that are doing well name the sectors with positive momentum? Give output as a json (that can be converted to pandas dataframe) with 3 columns named sector, company names & reason","Name the top & bottom performing companies? Give output as a json (that can be converted to pandas dataframe) with 4 columns named sector, company names, reason & top/bottom","You are an award winning email writer. Write an email summarizing the news. Do not say I am language model and cannot do this","You are an award winning email writer. Write an email summarizing the key macro trends basis the news.Do not say I am language model and cannot do this"]
 
41
 
42
  answerlist=[]
43
  for i in range(len(querylist)):
44
+ print(I,"Query: ",querylist[i])
45
  response = index.query(
46
  querylist[i],
47
  llm_predictor=llm_predictor,
 
58
  answerlist.append(df)
59
  else:
60
  answerlist.append(response.response)
61
+
62
+ print('Came to return statement')
63
  return answerlist
64
 
65
  with gr.Blocks() as demo: