hra commited on
Commit
76d488b
1 Parent(s): a5a25a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -46,7 +46,7 @@ def getstuff(openapikey,category_selector,ticker_input):
46
  filetextcontentlist=[]
47
  for each in files:
48
  headers = {
49
- "User-Agent": 'a@yahoo.com',
50
  "Accept-Encoding": "gzip, deflate",
51
  "Host": "www.sec.gov",
52
  }
@@ -89,7 +89,7 @@ def getstuff(openapikey,category_selector,ticker_input):
89
  temp=temp.split('.')
90
  newlist=[]
91
  for each in temp:
92
- if len(each.split())>8:
93
  newlist.append(each)
94
  documents=[Document(t) for t in newlist]
95
  index = GPTSimpleVectorIndex.from_documents(documents)
@@ -107,7 +107,7 @@ def getstuff(openapikey,category_selector,ticker_input):
107
  print(i,"Query: ",querylist[i])
108
  response = index.query(
109
  querylist[i],
110
- llm_predictor=llm_predictor,
111
  response_mode="tree_summarize",
112
  similarity_top_k=min(int(len(documents)/3),20)
113
  )
 
46
  filetextcontentlist=[]
47
  for each in files:
48
  headers = {
49
+ "User-Agent": 'random@yahoo.com',
50
  "Accept-Encoding": "gzip, deflate",
51
  "Host": "www.sec.gov",
52
  }
 
89
  temp=temp.split('.')
90
  newlist=[]
91
  for each in temp:
92
+ if len(each.split())>10: ###eliminate sentences with less words
93
  newlist.append(each)
94
  documents=[Document(t) for t in newlist]
95
  index = GPTSimpleVectorIndex.from_documents(documents)
 
107
  print(i,"Query: ",querylist[i])
108
  response = index.query(
109
  querylist[i],
110
+ service_context=service_context,
111
  response_mode="tree_summarize",
112
  similarity_top_k=min(int(len(documents)/3),20)
113
  )