Spaces:
Build error
Build error
File size: 829 Bytes
98bb602 |
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 |
import os
import sys
import json
import logging
import webbrowser
from tensorboard import program
sys.path.append(os.getcwd())
from main.configs.config import Config
translations = Config().translations
with open(os.path.join("main", "configs", "config.json"), "r") as f:
configs = json.load(f)
def launch_tensorboard_pipeline():
logging.getLogger("root").setLevel(logging.ERROR)
logging.getLogger("tensorboard").setLevel(logging.ERROR)
tb = program.TensorBoard()
tb.configure(argv=[None, "--logdir", "assets/logs", f"--port={configs["tensorboard_port"]}"])
url = tb.launch()
print(f"{translations['tensorboard_url']}: {url}")
webbrowser.open(url)
return f"{translations['tensorboard_url']}: {url}"
if __name__ == "__main__": launch_tensorboard_pipeline() |