isayahc commited on
Commit
2ee991b
1 Parent(s): dc03a57

added logging to the top of app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -45,6 +45,12 @@ from prompt import template
45
 
46
  set_verbose(True)
47
 
 
 
 
 
 
 
48
  # load .env variables
49
  config = load_dotenv(".env")
50
  HUGGINGFACEHUB_API_TOKEN=os.getenv('HUGGINGFACEHUB_API_TOKEN')
@@ -104,12 +110,6 @@ prompt = PromptTemplate(
104
  )
105
  memory = ConversationBufferMemory(memory_key="history", input_key="question")
106
 
107
- # logging for the chain
108
- logging.basicConfig()
109
- logging.getLogger("langchain.retrievers").setLevel(logging.INFO)
110
- logging.getLogger("langchain.chains.qa_with_sources").setLevel(logging.INFO)
111
-
112
-
113
 
114
 
115
  qa = RetrievalQAWithSourcesChain.from_chain_type(llm=llm, retriever=retriever, return_source_documents=True, verbose=True, chain_type_kwargs={
 
45
 
46
  set_verbose(True)
47
 
48
+
49
+ # set up logging for the chain
50
+ logging.basicConfig()
51
+ logging.getLogger("langchain.retrievers").setLevel(logging.INFO)
52
+ logging.getLogger("langchain.chains.qa_with_sources").setLevel(logging.INFO)
53
+
54
  # load .env variables
55
  config = load_dotenv(".env")
56
  HUGGINGFACEHUB_API_TOKEN=os.getenv('HUGGINGFACEHUB_API_TOKEN')
 
110
  )
111
  memory = ConversationBufferMemory(memory_key="history", input_key="question")
112
 
 
 
 
 
 
 
113
 
114
 
115
  qa = RetrievalQAWithSourcesChain.from_chain_type(llm=llm, retriever=retriever, return_source_documents=True, verbose=True, chain_type_kwargs={