jspr commited on
Commit
6c160b4
1 Parent(s): fc356c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -35,13 +35,13 @@ def download_paper_and_embed(paper_arxiv_url, api_key):
35
  else:
36
  raise ValueError("Invalid arXiv URL")
37
  suffix = 'paper-dir/' + eprint_url.replace("https://arxiv.org/e-print/", "")
 
38
  if not os.path.exists(suffix + "/docs.index"):
39
  create_vector_store(suffix, paper_text)
40
 
41
- os.environ["OPENAI_API_KEY"] = api_key
42
  vectorstore = get_vectorstore(suffix)
43
  qa_chain = VectorDBQAWithSourcesChain.from_llm(llm=OpenAI(temperature=0), vectorstore=vectorstore)
44
- os.environ["OPENAI_API_KEY"] = ""
45
  return qa_chain
46
 
47
  chain = None
 
35
  else:
36
  raise ValueError("Invalid arXiv URL")
37
  suffix = 'paper-dir/' + eprint_url.replace("https://arxiv.org/e-print/", "")
38
+ os.environ["OPENAI_API_KEY"] = api_key
39
  if not os.path.exists(suffix + "/docs.index"):
40
  create_vector_store(suffix, paper_text)
41
 
42
+
43
  vectorstore = get_vectorstore(suffix)
44
  qa_chain = VectorDBQAWithSourcesChain.from_llm(llm=OpenAI(temperature=0), vectorstore=vectorstore)
 
45
  return qa_chain
46
 
47
  chain = None