chahah commited on
Commit
9efbd37
1 Parent(s): 277e5fa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py CHANGED
@@ -32,6 +32,22 @@ urlsfile.close()
32
  loader = WebBaseLoader(urls)
33
  docs = loader.load()
34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  def format_docs(docs):
36
  return "\n\n".join(doc.page_content for doc in docs)
37
 
 
32
  loader = WebBaseLoader(urls)
33
  docs = loader.load()
34
 
35
+ # load arxiv papers
36
+ arxivfile = open("arxiv.txt")
37
+ arxivs = arxivfile.readlines()
38
+ arxivs = [arxiv.replace("\n","") for arxiv in arxivs]
39
+ arxivfile.close()
40
+
41
+ retriever = ArxivRetriever(
42
+ load_max_docs=2,
43
+ get_ful_documents=True,
44
+ )
45
+
46
+ for arxiv in arxivs:
47
+ doc = retriever.invoke(arxiv)
48
+ docs.append(doc)
49
+
50
+
51
  def format_docs(docs):
52
  return "\n\n".join(doc.page_content for doc in docs)
53