-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
executable file
·38 lines (27 loc) · 914 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!python
import pyrootutils
root = pyrootutils.setup_root(
search_from=__file__,
indicator=[".git", "pyproject.toml"],
pythonpath=True,
# load environment variables from `.env` file if it exists
# recursively searches for `.env` in all folders starting from work dir
dotenv=True,
)
import dotenv
import hydra
from omegaconf import DictConfig
@hydra.main(config_path=f"{root}/configs", config_name="test.yaml")
def main(config: DictConfig):
# Imports can be nested inside @hydra.main to optimize tab completion
# https://github.com/facebookresearch/hydra/issues/934
from src import utils
from src.testing_pipeline import test
# resolve user provided config
config = utils.resolve_experiment_config(config)
# Applies optional utilities
config = utils.extras(config)
# Evaluate model
return test(config)
if __name__ == "__main__":
main()