Ramon Meffert commited on
Commit
f2e3e47
1 Parent(s): af461f3

Move env var to .env

Browse files
Files changed (2) hide show
  1. .env.example +2 -1
  2. main.py +3 -2
.env.example CHANGED
@@ -1,5 +1,6 @@
1
  ELASTIC_USERNAME=elastic
2
  ELASTIC_PASSWORD=<password>
3
- ELASTIC_HOST=<localhost>
4
 
5
  LOG_LEVEL=INFO
 
 
1
  ELASTIC_USERNAME=elastic
2
  ELASTIC_PASSWORD=<password>
3
+ ELASTIC_HOST=https://localhost:9200
4
 
5
  LOG_LEVEL=INFO
6
+ TRANSFORMERS_NO_ADVISORY_WARNINGS
main.py CHANGED
@@ -5,6 +5,7 @@ from typing import cast
5
  import torch
6
  import transformers
7
  from datasets import DatasetDict, load_dataset
 
8
 
9
  from src.evaluation import evaluate
10
  from src.readers.dpr_reader import DprReader
@@ -13,9 +14,9 @@ from src.retrievers.faiss_retriever import FaissRetriever
13
  from src.utils.log import get_logger
14
  from src.utils.preprocessing import result_to_reader_input
15
 
16
- os.environ['TRANSFORMERS_NO_ADVISORY_WARNINGS'] = '1'
17
-
18
  logger = get_logger()
 
 
19
  transformers.logging.set_verbosity_error()
20
 
21
  if __name__ == '__main__':
 
5
  import torch
6
  import transformers
7
  from datasets import DatasetDict, load_dataset
8
+ from dotenv import load_dotenv
9
 
10
  from src.evaluation import evaluate
11
  from src.readers.dpr_reader import DprReader
 
14
  from src.utils.log import get_logger
15
  from src.utils.preprocessing import result_to_reader_input
16
 
 
 
17
  logger = get_logger()
18
+
19
+ load_dotenv()
20
  transformers.logging.set_verbosity_error()
21
 
22
  if __name__ == '__main__':