Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lengstrom committed Aug 21, 2019
1 parent 00b1f27 commit 57f872a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions robustness/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from .datasets import DATASETS
from .train import train_model, eval_model
from .tools import constants, helpers
from . import defaults
from . import defaults, __version__
from .defaults import check_and_fill_args
except:
raise ValueError("Make sure to run with python -m (see README.md)")
Expand Down Expand Up @@ -90,11 +90,10 @@ def setup_store_with_metadata(args):
try:
repo = git.Repo(path=os.path.dirname(os.path.realpath(__file__)),
search_parent_directories=True)
git_commit = repo.head.object.hexsha
version = repo.head.object.hexsha
except git.exc.InvalidGitRepositoryError:
git_commit = 'pip_' + helpers.get_pip_version()
print(git_commit)
args.git_commit = git_commit
version = __version__
args.version = version

# Create the store
store = cox.store.Store(args.out_dir, args.exp_name)
Expand Down

0 comments on commit 57f872a

Please sign in to comment.