Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

__init__.py 1.5 KB

You have to be logged in to leave a comment. Sign In
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
  1. # -*- coding: utf-8 -*-
  2. __author__ = """Chris Van Pelt"""
  3. __email__ = 'vanpelt@wandb.com'
  4. __version__ = '0.4.19'
  5. import types
  6. import sys
  7. import logging
  8. import os
  9. # We use the hidden version if it already exists, otherwise non-hidden.
  10. if os.path.exists('.wandb'):
  11. __stage_dir__ = '.wandb/'
  12. elif os.path.exists('wandb'):
  13. __stage_dir__ = "wandb/"
  14. else:
  15. __stage_dir__ = None
  16. from .git_repo import GitRepo
  17. from .api import Api, Error
  18. from .sync import Sync
  19. from .config import Config
  20. from .results import Results
  21. from .summary import Summary
  22. from .history import History
  23. from .keras import WandBKerasCallback
  24. from .run import Run
  25. # The current run (a Run object)
  26. run = None
  27. if __stage_dir__ is not None:
  28. log_fname = __stage_dir__ + 'debug.log'
  29. else:
  30. log_fname = './wandb-debug.log'
  31. logging.basicConfig(
  32. filemode="w",
  33. filename=log_fname,
  34. level=logging.DEBUG)
  35. def push(*args, **kwargs):
  36. Api().push(*args, **kwargs)
  37. def pull(*args, **kwargs):
  38. Api().pull(*args, **kwargs)
  39. def sync(globs=['*'], **kwargs):
  40. global run
  41. if os.getenv('WANDB_CLI_LAUNCHED'):
  42. run = Run(os.getenv('WANDB_RUN_ID'), os.getenv('WANDB_RUN_DIR'), {})
  43. return
  44. api = Api()
  45. if api.api_key is None:
  46. raise Error("No API key found, run `wandb login` or set WANDB_API_KEY")
  47. # TODO: wandb describe
  48. sync = Sync(api, **kwargs)
  49. sync.watch(files=globs)
  50. run = sync.run
  51. return run
  52. __all__ = ["Api", "Error", "Config", "Results", "History", "Summary",
  53. "WandBKerasCallback"]
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...