aitech-ium/IUM_07/file_observer.py

20 lines
464 B
Python

from sacred.observers import FileStorageObserver
from sacred import Experiment
ex = Experiment("file_observer")
ex.observers.append(FileStorageObserver('my_runs'))
@ex.config
def my_config():
recipient = "Świecie"
greeting = "Witaj"
@ex.capture
def prepare_message(recipient, greeting):
return "{0} {1}!".format(greeting, recipient)
@ex.automain
def my_main(recipient, greeting):
print(prepare_message()) ## Nie musimy przekazywać wartości