wandb 0.18.5__py3-none-win32.whl → 0.18.7__py3-none-win32.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. wandb/__init__.py +2 -2
  2. wandb/__init__.pyi +22 -20
  3. wandb/agents/pyagent.py +1 -1
  4. wandb/apis/importers/wandb.py +1 -1
  5. wandb/apis/normalize.py +2 -18
  6. wandb/apis/public/api.py +126 -62
  7. wandb/apis/public/artifacts.py +8 -3
  8. wandb/apis/public/files.py +17 -2
  9. wandb/apis/public/jobs.py +2 -2
  10. wandb/apis/public/query_generator.py +1 -1
  11. wandb/apis/public/runs.py +8 -8
  12. wandb/apis/public/teams.py +3 -3
  13. wandb/apis/public/users.py +1 -1
  14. wandb/apis/public/utils.py +68 -0
  15. wandb/bin/gpu_stats.exe +0 -0
  16. wandb/bin/wandb-core +0 -0
  17. wandb/cli/cli.py +12 -3
  18. wandb/data_types.py +1 -1
  19. wandb/docker/__init__.py +2 -1
  20. wandb/docker/auth.py +2 -3
  21. wandb/errors/links.py +73 -0
  22. wandb/errors/term.py +7 -6
  23. wandb/filesync/step_prepare.py +1 -1
  24. wandb/filesync/upload_job.py +1 -1
  25. wandb/integration/catboost/catboost.py +2 -2
  26. wandb/integration/diffusers/pipeline_resolver.py +1 -1
  27. wandb/integration/diffusers/resolvers/multimodal.py +6 -6
  28. wandb/integration/diffusers/resolvers/utils.py +1 -1
  29. wandb/integration/fastai/__init__.py +3 -2
  30. wandb/integration/keras/callbacks/metrics_logger.py +1 -1
  31. wandb/integration/keras/callbacks/model_checkpoint.py +1 -1
  32. wandb/integration/keras/keras.py +1 -1
  33. wandb/integration/kfp/kfp_patch.py +1 -1
  34. wandb/integration/lightgbm/__init__.py +2 -2
  35. wandb/integration/magic.py +2 -2
  36. wandb/integration/metaflow/metaflow.py +1 -1
  37. wandb/integration/sacred/__init__.py +1 -1
  38. wandb/integration/sagemaker/auth.py +1 -1
  39. wandb/integration/sklearn/plot/classifier.py +7 -7
  40. wandb/integration/sklearn/plot/clusterer.py +3 -3
  41. wandb/integration/sklearn/plot/regressor.py +3 -3
  42. wandb/integration/sklearn/plot/shared.py +2 -2
  43. wandb/integration/tensorboard/log.py +2 -2
  44. wandb/integration/ultralytics/callback.py +2 -2
  45. wandb/integration/xgboost/xgboost.py +1 -1
  46. wandb/jupyter.py +0 -1
  47. wandb/plot/__init__.py +17 -8
  48. wandb/plot/bar.py +53 -27
  49. wandb/plot/confusion_matrix.py +151 -70
  50. wandb/plot/custom_chart.py +124 -0
  51. wandb/plot/histogram.py +46 -20
  52. wandb/plot/line.py +57 -26
  53. wandb/plot/line_series.py +148 -60
  54. wandb/plot/pr_curve.py +89 -44
  55. wandb/plot/roc_curve.py +82 -37
  56. wandb/plot/scatter.py +53 -20
  57. wandb/plot/viz.py +20 -102
  58. wandb/proto/v3/wandb_settings_pb2.py +2 -2
  59. wandb/proto/v3/wandb_telemetry_pb2.py +4 -4
  60. wandb/proto/v4/wandb_settings_pb2.py +2 -2
  61. wandb/proto/v4/wandb_telemetry_pb2.py +4 -4
  62. wandb/proto/v5/wandb_settings_pb2.py +2 -2
  63. wandb/proto/v5/wandb_telemetry_pb2.py +4 -4
  64. wandb/proto/wandb_deprecated.py +2 -0
  65. wandb/sdk/artifacts/artifact.py +281 -329
  66. wandb/sdk/artifacts/artifact_manifest.py +10 -9
  67. wandb/sdk/artifacts/artifact_manifest_entry.py +1 -1
  68. wandb/sdk/artifacts/storage_handlers/azure_handler.py +9 -4
  69. wandb/sdk/artifacts/storage_handlers/gcs_handler.py +1 -3
  70. wandb/sdk/artifacts/storage_handlers/s3_handler.py +1 -1
  71. wandb/sdk/artifacts/storage_handlers/wb_artifact_handler.py +2 -2
  72. wandb/sdk/artifacts/storage_handlers/wb_local_artifact_handler.py +1 -1
  73. wandb/sdk/backend/backend.py +0 -1
  74. wandb/sdk/data_types/audio.py +1 -1
  75. wandb/sdk/data_types/base_types/media.py +66 -5
  76. wandb/sdk/data_types/base_types/wb_value.py +20 -10
  77. wandb/sdk/data_types/bokeh.py +1 -1
  78. wandb/sdk/data_types/helper_types/bounding_boxes_2d.py +1 -1
  79. wandb/sdk/data_types/helper_types/image_mask.py +2 -2
  80. wandb/sdk/data_types/histogram.py +1 -1
  81. wandb/sdk/data_types/html.py +1 -1
  82. wandb/sdk/data_types/image.py +1 -1
  83. wandb/sdk/data_types/molecule.py +3 -3
  84. wandb/sdk/data_types/object_3d.py +4 -4
  85. wandb/sdk/data_types/plotly.py +1 -1
  86. wandb/sdk/data_types/saved_model.py +0 -1
  87. wandb/sdk/data_types/table.py +7 -7
  88. wandb/sdk/data_types/trace_tree.py +1 -1
  89. wandb/sdk/data_types/video.py +4 -3
  90. wandb/sdk/interface/interface_queue.py +0 -6
  91. wandb/sdk/interface/router.py +1 -4
  92. wandb/sdk/interface/router_queue.py +0 -3
  93. wandb/sdk/interface/router_relay.py +0 -2
  94. wandb/sdk/internal/datastore.py +1 -1
  95. wandb/sdk/internal/file_pusher.py +1 -1
  96. wandb/sdk/internal/file_stream.py +4 -4
  97. wandb/sdk/internal/handler.py +3 -4
  98. wandb/sdk/internal/internal.py +1 -15
  99. wandb/sdk/internal/internal_api.py +178 -63
  100. wandb/sdk/internal/internal_util.py +0 -3
  101. wandb/sdk/internal/job_builder.py +4 -3
  102. wandb/sdk/internal/sender.py +0 -2
  103. wandb/sdk/internal/system/assets/__init__.py +0 -2
  104. wandb/sdk/internal/tb_watcher.py +11 -10
  105. wandb/sdk/internal/writer.py +1 -3
  106. wandb/sdk/launch/__init__.py +2 -1
  107. wandb/sdk/launch/_launch.py +4 -3
  108. wandb/sdk/launch/_launch_add.py +2 -2
  109. wandb/sdk/launch/builder/kaniko_builder.py +0 -1
  110. wandb/sdk/launch/create_job.py +1 -0
  111. wandb/sdk/launch/environment/local_environment.py +0 -1
  112. wandb/sdk/launch/errors.py +0 -6
  113. wandb/sdk/launch/registry/local_registry.py +0 -2
  114. wandb/sdk/launch/runner/abstract.py +0 -5
  115. wandb/sdk/launch/sweeps/__init__.py +0 -2
  116. wandb/sdk/launch/sweeps/scheduler.py +0 -2
  117. wandb/sdk/launch/sweeps/scheduler_sweep.py +0 -1
  118. wandb/sdk/lib/_settings_toposort_generated.py +1 -0
  119. wandb/sdk/lib/apikey.py +3 -3
  120. wandb/sdk/lib/file_stream_utils.py +1 -1
  121. wandb/sdk/lib/filesystem.py +1 -1
  122. wandb/sdk/lib/ipython.py +16 -9
  123. wandb/sdk/lib/mailbox.py +0 -4
  124. wandb/sdk/lib/printer.py +44 -8
  125. wandb/sdk/lib/retry.py +1 -1
  126. wandb/sdk/lib/sock_client.py +0 -5
  127. wandb/sdk/service/server.py +2 -11
  128. wandb/sdk/service/server_sock.py +0 -2
  129. wandb/sdk/service/service.py +3 -3
  130. wandb/sdk/service/streams.py +2 -4
  131. wandb/sdk/wandb_init.py +20 -20
  132. wandb/sdk/wandb_login.py +1 -1
  133. wandb/sdk/wandb_require.py +1 -4
  134. wandb/sdk/wandb_run.py +97 -115
  135. wandb/sdk/wandb_settings.py +23 -6
  136. wandb/sdk/wandb_setup.py +1 -5
  137. wandb/sdk/wandb_sync.py +2 -1
  138. wandb/util.py +49 -21
  139. wandb/wandb_agent.py +3 -3
  140. wandb/wandb_controller.py +2 -2
  141. {wandb-0.18.5.dist-info → wandb-0.18.7.dist-info}/METADATA +1 -1
  142. {wandb-0.18.5.dist-info → wandb-0.18.7.dist-info}/RECORD +145 -147
  143. wandb/sdk/internal/system/assets/gpu_apple.py +0 -177
  144. wandb/sdk/lib/_wburls_generate.py +0 -25
  145. wandb/sdk/lib/_wburls_generated.py +0 -22
  146. wandb/sdk/lib/tracelog.py +0 -255
  147. wandb/sdk/lib/wburls.py +0 -46
  148. {wandb-0.18.5.dist-info → wandb-0.18.7.dist-info}/WHEEL +0 -0
  149. {wandb-0.18.5.dist-info → wandb-0.18.7.dist-info}/entry_points.txt +0 -0
  150. {wandb-0.18.5.dist-info → wandb-0.18.7.dist-info}/licenses/LICENSE +0 -0
wandb/sdk/wandb_run.py CHANGED
@@ -31,14 +31,15 @@ import requests
31
31
 
32
32
  import wandb
33
33
  import wandb.env
34
- from wandb import errors, trigger
34
+ from wandb import trigger
35
35
  from wandb._globals import _datatypes_set_callback
36
36
  from wandb.apis import internal, public
37
37
  from wandb.apis.internal import Api
38
38
  from wandb.apis.public import Api as PublicApi
39
- from wandb.errors import CommError
39
+ from wandb.errors import CommError, UnsupportedError, UsageError
40
+ from wandb.errors.links import url_registry
40
41
  from wandb.integration.torch import wandb_torch
41
- from wandb.plot.viz import CustomChart, Visualize, custom_chart
42
+ from wandb.plot import CustomChart, Visualize, plot_table
42
43
  from wandb.proto.wandb_internal_pb2 import (
43
44
  MetricRecord,
44
45
  PollExitResponse,
@@ -89,7 +90,6 @@ from .lib.gitlib import GitRepo
89
90
  from .lib.mailbox import MailboxError, MailboxHandle, MailboxProbe, MailboxProgress
90
91
  from .lib.proto_util import message_to_dict
91
92
  from .lib.reporting import Reporter
92
- from .lib.wburls import wburls
93
93
  from .wandb_alerts import AlertLevel
94
94
  from .wandb_settings import Settings
95
95
  from .wandb_setup import _WandbSetup
@@ -410,7 +410,7 @@ class _run_decorator: # noqa: N801
410
410
  if only_warn:
411
411
  warnings.warn(resolved_message, UserWarning, stacklevel=2)
412
412
  else:
413
- raise errors.UsageError(resolved_message)
413
+ raise UsageError(resolved_message)
414
414
 
415
415
  return wrapper_fn
416
416
 
@@ -430,11 +430,10 @@ class _run_decorator: # noqa: N801
430
430
  # - for fork case the new process share mem space hence the value would be of parent process.
431
431
  _init_pid = getattr(self, "_init_pid", None)
432
432
  if _init_pid != os.getpid():
433
- message = "`{}` ignored (called from pid={}, `init` called from pid={}). See: {}".format(
434
- func.__name__,
435
- os.getpid(),
436
- _init_pid,
437
- wburls.get("multiprocess"),
433
+ message = (
434
+ f"`{func.__name__}` ignored (called from pid={os.getpid()}, "
435
+ f"`init` called from pid={_init_pid}). "
436
+ f"See: {url_registry.url('multiprocess')}"
438
437
  )
439
438
  # - if this process was pickled in non-service case,
440
439
  # we ignore the attributes (since pickle is not supported)
@@ -443,7 +442,7 @@ class _run_decorator: # noqa: N801
443
442
  settings = getattr(self, "_settings", None)
444
443
  if settings and settings["strict"]:
445
444
  wandb.termerror(message, repeat=False)
446
- raise errors.UnsupportedError(
445
+ raise UnsupportedError(
447
446
  f"`{func.__name__}` does not support multiprocessing"
448
447
  )
449
448
  wandb.termwarn(message, repeat=False)
@@ -550,7 +549,6 @@ class Run:
550
549
  _redirect_cb: Callable[[str, str], None] | None
551
550
  _redirect_raw_cb: Callable[[str, str], None] | None
552
551
  _output_writer: filesystem.CRDedupedFile | None
553
- _quiet: bool | None
554
552
 
555
553
  _atexit_cleanup_called: bool
556
554
  _hooks: ExitHooks | None
@@ -633,7 +631,7 @@ class Run:
633
631
 
634
632
  _datatypes_set_callback(self._datatypes_callback)
635
633
 
636
- self._printer = printer.get_printer(self._settings._jupyter)
634
+ self._printer = printer.new_printer()
637
635
  self._wl = None
638
636
  self._reporter: Reporter | None = None
639
637
 
@@ -658,7 +656,6 @@ class Run:
658
656
  self._stderr_slave_fd = None
659
657
  self._exit_code = None
660
658
  self._exit_result = None
661
- self._quiet = self._settings.quiet
662
659
 
663
660
  self._output_writer = None
664
661
  self._used_artifact_slots: dict[str, str] = {}
@@ -1158,7 +1155,7 @@ class Run:
1158
1155
 
1159
1156
  By default, it walks the current directory and logs all files that end with `.py`.
1160
1157
 
1161
- Arguments:
1158
+ Args:
1162
1159
  root: The relative (to `os.getcwd()`) or absolute path to recursively find code from.
1163
1160
  name: (str, optional) The name of our code artifact. By default, we'll name
1164
1161
  the artifact `source-$PROJECT_ID-$ENTRYPOINT_RELPATH`. There may be scenarios where you want
@@ -1415,7 +1412,7 @@ class Run:
1415
1412
  if is_id:
1416
1413
  artifact = Artifact._from_id(artifact_string, public_api._client)
1417
1414
  else:
1418
- artifact = public_api.artifact(name=artifact_string)
1415
+ artifact = public_api._artifact(name=artifact_string)
1419
1416
  # in the future we'll need to support using artifacts from
1420
1417
  # different instances of wandb.
1421
1418
 
@@ -1470,61 +1467,56 @@ class Run:
1470
1467
  files: FilesDict = dict(files=[(GlobStr(glob.escape(fname)), "now")])
1471
1468
  self._backend.interface.publish_files(files)
1472
1469
 
1473
- def _visualization_hack(self, row: dict[str, Any]) -> dict[str, Any]:
1474
- # TODO(jhr): move visualize hack somewhere else
1470
+ def _serialize_custom_charts(self, data: dict[str, Any]) -> dict[str, Any]:
1471
+ if not data:
1472
+ return data
1473
+
1475
1474
  chart_keys = set()
1476
- split_table_set = set()
1477
- for k in row:
1478
- if isinstance(row[k], Visualize):
1479
- key = row[k].get_config_key(k)
1480
- value = row[k].get_config_value(k)
1481
- row[k] = row[k]._data
1482
- self._config_callback(val=value, key=key)
1483
- elif isinstance(row[k], CustomChart):
1475
+ for k, v in data.items():
1476
+ if isinstance(v, Visualize):
1477
+ data[k] = v.table
1478
+ v.set_key(k)
1479
+ self._config_callback(
1480
+ val=v.spec.config_value,
1481
+ key=v.spec.config_key,
1482
+ )
1483
+ elif isinstance(v, CustomChart):
1484
1484
  chart_keys.add(k)
1485
- key = row[k].get_config_key(k)
1486
- if row[k]._split_table:
1487
- value = row[k].get_config_value(
1488
- "Vega2", row[k].user_query(f"Custom Chart Tables/{k}_table")
1489
- )
1490
- split_table_set.add(k)
1491
- else:
1492
- value = row[k].get_config_value(
1493
- "Vega2", row[k].user_query(f"{k}_table")
1494
- )
1495
- row[k] = row[k]._data
1496
- self._config_callback(val=value, key=key)
1485
+ v.set_key(k)
1486
+ self._config_callback(
1487
+ key=v.spec.config_key,
1488
+ val=v.spec.config_value,
1489
+ )
1497
1490
 
1498
1491
  for k in chart_keys:
1499
1492
  # remove the chart key from the row
1500
- # TODO: is this really the right move? what if the user logs
1501
- # a non-custom chart to this key?
1502
- if k in split_table_set:
1503
- row[f"Custom Chart Tables/{k}_table"] = row.pop(k)
1504
- else:
1505
- row[f"{k}_table"] = row.pop(k)
1506
- return row
1493
+ v = data.pop(k)
1494
+ if isinstance(v, CustomChart):
1495
+ data[v.spec.table_key] = v.table
1496
+ return data
1507
1497
 
1508
1498
  def _partial_history_callback(
1509
1499
  self,
1510
- row: dict[str, Any],
1500
+ data: dict[str, Any],
1511
1501
  step: int | None = None,
1512
1502
  commit: bool | None = None,
1513
1503
  ) -> None:
1514
- row = row.copy()
1515
- if row:
1516
- row = self._visualization_hack(row)
1504
+ if not (self._backend and self._backend.interface):
1505
+ return
1517
1506
 
1518
- if self._backend and self._backend.interface:
1519
- not_using_tensorboard = len(wandb.patched["tensorboard"]) == 0
1520
-
1521
- self._backend.interface.publish_partial_history(
1522
- row,
1523
- user_step=self._step,
1524
- step=step,
1525
- flush=commit,
1526
- publish_step=not_using_tensorboard,
1527
- )
1507
+ data = data.copy() # avoid modifying the original data
1508
+
1509
+ # Serialize custom charts before publishing
1510
+ data = self._serialize_custom_charts(data)
1511
+
1512
+ not_using_tensorboard = len(wandb.patched["tensorboard"]) == 0
1513
+ self._backend.interface.publish_partial_history(
1514
+ data,
1515
+ user_step=self._step,
1516
+ step=step,
1517
+ flush=commit,
1518
+ publish_step=not_using_tensorboard,
1519
+ )
1528
1520
 
1529
1521
  def _console_callback(self, name: str, data: str) -> None:
1530
1522
  # logger.info("console callback: %s, %s", name, data)
@@ -1707,7 +1699,7 @@ class Run:
1707
1699
  [guides to logging](https://docs.wandb.ai/guides/track/log) for examples,
1708
1700
  from 3D molecular structures and segmentation masks to PR curves and histograms.
1709
1701
  You can use `wandb.Table` to log structured data. See our
1710
- [guide to logging tables](https://docs.wandb.ai/guides/data-vis/log-tables)
1702
+ [guide to logging tables](https://docs.wandb.ai/guides/tables/tables-walkthrough)
1711
1703
  for details.
1712
1704
 
1713
1705
  The W&B UI organizes metrics with a forward slash (`/`) in their name
@@ -1770,7 +1762,7 @@ class Run:
1770
1762
  run.log({"accuracy": 0.9}, step=current_step)
1771
1763
  ```
1772
1764
 
1773
- Arguments:
1765
+ Args:
1774
1766
  data: A `dict` with `str` keys and values that are serializable
1775
1767
  Python objects including: `int`, `float` and `string`;
1776
1768
  any of the `wandb.data_types`; lists, tuples and NumPy arrays
@@ -1923,7 +1915,7 @@ class Run:
1923
1915
  if self._settings._shared and step is not None:
1924
1916
  wandb.termwarn(
1925
1917
  "In shared mode, the use of `wandb.log` with the step argument is not supported "
1926
- f"and will be ignored. Please refer to {wburls.get('wandb_define_metric')} "
1918
+ f"and will be ignored. Please refer to {url_registry.url('define-metric')} "
1927
1919
  "on how to customize your x-axis.",
1928
1920
  repeat=False,
1929
1921
  )
@@ -1971,7 +1963,7 @@ class Run:
1971
1963
  Note: when given an absolute path or glob and no `base_path`, one
1972
1964
  directory level is preserved as in the example above.
1973
1965
 
1974
- Arguments:
1966
+ Args:
1975
1967
  glob_str: A relative or absolute path or Unix glob.
1976
1968
  base_path: A path to use to infer a directory structure; see examples.
1977
1969
  policy: One of `live`, `now`, or `end`.
@@ -1998,9 +1990,7 @@ class Run:
1998
1990
  if isinstance(glob_str, bytes):
1999
1991
  # Preserved for backward compatibility: allow bytes inputs.
2000
1992
  glob_str = glob_str.decode("utf-8")
2001
- if isinstance(glob_str, str) and (
2002
- glob_str.startswith("gs://") or glob_str.startswith("s3://")
2003
- ):
1993
+ if isinstance(glob_str, str) and (glob_str.startswith(("gs://", "s3://"))):
2004
1994
  # Provide a better error message for a common misuse.
2005
1995
  wandb.termlog(f"{glob_str} is a cloud storage url, can't save file to W&B.")
2006
1996
  return []
@@ -2144,24 +2134,28 @@ class Run:
2144
2134
  This is used when creating multiple runs in the same process. We automatically
2145
2135
  call this method when your script exits or if you use the run context manager.
2146
2136
 
2147
- Arguments:
2137
+ Args:
2148
2138
  exit_code: Set to something other than 0 to mark a run as failed
2149
- quiet: Set to true to minimize log output
2139
+ quiet: Deprecated, use `wandb.Settings(quiet=...)` to set this instead.
2150
2140
  """
2151
- return self._finish(exit_code, quiet)
2141
+ if quiet is not None:
2142
+ deprecate.deprecate(
2143
+ field_name=deprecate.Deprecated.run__finish_quiet,
2144
+ warning_message=(
2145
+ "The `quiet` argument to `wandb.run.finish()` is deprecated, "
2146
+ "use `wandb.Settings(quiet=...)` to set this instead."
2147
+ ),
2148
+ )
2149
+ return self._finish(exit_code)
2152
2150
 
2153
2151
  def _finish(
2154
2152
  self,
2155
2153
  exit_code: int | None = None,
2156
- quiet: bool | None = None,
2157
2154
  ) -> None:
2158
2155
  logger.info(f"finishing run {self._get_path()}")
2159
2156
  with telemetry.context(run=self) as tel:
2160
2157
  tel.feature.finish = True
2161
2158
 
2162
- if quiet is not None:
2163
- self._quiet = quiet
2164
-
2165
2159
  # Pop this run (hopefully) from the run stack, to support the "reinit"
2166
2160
  # functionality of wandb.init().
2167
2161
  #
@@ -2246,11 +2240,11 @@ class Run:
2246
2240
  data_table: Table,
2247
2241
  fields: dict[str, Any],
2248
2242
  string_fields: dict[str, Any] | None = None,
2249
- split_table: bool | None = False,
2243
+ split_table: bool = False,
2250
2244
  ) -> CustomChart:
2251
2245
  """Create a custom plot on a table.
2252
2246
 
2253
- Arguments:
2247
+ Args:
2254
2248
  vega_spec_name: the name of the spec for the plot
2255
2249
  data_table: a wandb.Table object containing the data to
2256
2250
  be used on the visualization
@@ -2261,7 +2255,7 @@ class Run:
2261
2255
  split_table: a boolean that indicates whether the table should be in
2262
2256
  a separate section in the UI
2263
2257
  """
2264
- return custom_chart(
2258
+ return plot_table(
2265
2259
  vega_spec_name, data_table, fields, string_fields or {}, split_table
2266
2260
  )
2267
2261
 
@@ -2454,7 +2448,6 @@ class Run:
2454
2448
  poll_exit_response=self._poll_exit_response,
2455
2449
  internal_messages_response=self._internal_messages_response,
2456
2450
  reporter=self._reporter,
2457
- quiet=self._quiet,
2458
2451
  settings=self._settings,
2459
2452
  printer=self._printer,
2460
2453
  )
@@ -2751,7 +2744,7 @@ class Run:
2751
2744
  ) -> wandb_metric.Metric:
2752
2745
  """Customize metrics logged with `wandb.log()`.
2753
2746
 
2754
- Arguments:
2747
+ Args:
2755
2748
  name: The name of the metric to customize.
2756
2749
  step_metric: The name of another metric to serve as the X-axis
2757
2750
  for this metric in automatically generated charts.
@@ -2977,10 +2970,10 @@ class Run:
2977
2970
 
2978
2971
  The linked artifact will be visible in the UI for the specified portfolio.
2979
2972
 
2980
- Arguments:
2973
+ Args:
2981
2974
  artifact: the (public or local) artifact which will be linked
2982
- target_path: `str` - takes the following forms: {portfolio}, {project}/{portfolio},
2983
- or {entity}/{project}/{portfolio}
2975
+ target_path: `str` - takes the following forms: `{portfolio}`, `{project}/{portfolio}`,
2976
+ or `{entity}/{project}/{portfolio}`
2984
2977
  aliases: `List[str]` - optional alias(es) that will only be applied on this linked artifact
2985
2978
  inside the portfolio.
2986
2979
  The alias "latest" will always be applied to the latest version of an artifact that is linked.
@@ -3046,7 +3039,7 @@ class Run:
3046
3039
 
3047
3040
  Call `download` or `file` on the returned object to get the contents locally.
3048
3041
 
3049
- Arguments:
3042
+ Args:
3050
3043
  artifact_or_name: (str or Artifact) An artifact name.
3051
3044
  May be prefixed with project/ or entity/project/.
3052
3045
  If no entity is specified in the name, the Run or API setting's entity is used.
@@ -3075,7 +3068,7 @@ class Run:
3075
3068
  else:
3076
3069
  name = artifact_or_name
3077
3070
  public_api = self._public_api()
3078
- artifact = public_api.artifact(type=type, name=name)
3071
+ artifact = public_api._artifact(type=type, name=name)
3079
3072
  if type is not None and type != artifact.type:
3080
3073
  raise ValueError(
3081
3074
  "Supplied type {} does not match type {} of artifact {}".format(
@@ -3155,7 +3148,7 @@ class Run:
3155
3148
  ) -> Artifact:
3156
3149
  """Declare an artifact as an output of a run.
3157
3150
 
3158
- Arguments:
3151
+ Args:
3159
3152
  artifact_or_path: (str or Artifact) A path to the contents of this artifact,
3160
3153
  can be in the following forms:
3161
3154
  - `/local/directory`
@@ -3200,7 +3193,7 @@ class Run:
3200
3193
  Note that you must call run.finish_artifact() to finalize the artifact.
3201
3194
  This is useful when distributed jobs need to all contribute to the same artifact.
3202
3195
 
3203
- Arguments:
3196
+ Args:
3204
3197
  artifact_or_path: (str or Artifact) A path to the contents of this artifact,
3205
3198
  can be in the following forms:
3206
3199
  - `/local/directory`
@@ -3253,7 +3246,7 @@ class Run:
3253
3246
 
3254
3247
  Subsequent "upserts" with the same distributed ID will result in a new version.
3255
3248
 
3256
- Arguments:
3249
+ Args:
3257
3250
  artifact_or_path: (str or Artifact) A path to the contents of this artifact,
3258
3251
  can be in the following forms:
3259
3252
  - `/local/directory`
@@ -3442,7 +3435,7 @@ class Run:
3442
3435
  ) -> None:
3443
3436
  """Logs a model artifact containing the contents inside the 'path' to a run and marks it as an output to this run.
3444
3437
 
3445
- Arguments:
3438
+ Args:
3446
3439
  path: (str) A path to the contents of this model,
3447
3440
  can be in the following forms:
3448
3441
  - `/local/directory`
@@ -3488,7 +3481,7 @@ class Run:
3488
3481
  def use_model(self, name: str) -> FilePathStr:
3489
3482
  """Download the files logged in a model artifact 'name'.
3490
3483
 
3491
- Arguments:
3484
+ Args:
3492
3485
  name: (str) A model artifact name. 'name' must match the name of an existing logged
3493
3486
  model artifact.
3494
3487
  May be prefixed with entity/project/. Valid names
@@ -3558,7 +3551,7 @@ class Run:
3558
3551
  - Link version of model artifact 'name' to registered model, 'registered_model_name'.
3559
3552
  - Attach aliases from 'aliases' list to the newly linked model artifact version.
3560
3553
 
3561
- Arguments:
3554
+ Args:
3562
3555
  path: (str) A path to the contents of this model,
3563
3556
  can be in the following forms:
3564
3557
  - `/local/directory`
@@ -3617,7 +3610,7 @@ class Run:
3617
3610
 
3618
3611
  public_api = self._public_api()
3619
3612
  try:
3620
- artifact = public_api.artifact(name=f"{name}:latest")
3613
+ artifact = public_api._artifact(name=f"{name}:latest")
3621
3614
  assert (
3622
3615
  "model" in str(artifact.type.lower())
3623
3616
  ), "You can only use this method for 'model' artifacts. For an artifact to be a 'model' artifact, its type property must contain the substring 'model'."
@@ -3641,7 +3634,7 @@ class Run:
3641
3634
  ) -> None:
3642
3635
  """Launch an alert with the given title and text.
3643
3636
 
3644
- Arguments:
3637
+ Args:
3645
3638
  title: (str) The title of the alert, must be less than 64 characters long.
3646
3639
  text: (str) The text body of the alert.
3647
3640
  level: (str or AlertLevel, optional) The alert level to use, either: `INFO`, `WARN`, or `ERROR`.
@@ -3815,7 +3808,7 @@ class Run:
3815
3808
 
3816
3809
  # TODO(settings): make settings the source of truth
3817
3810
  if not wandb.jupyter.quiet(): # type: ignore
3818
- doc_html = printer.link(wburls.get("doc_run"), "docs")
3811
+ doc_html = printer.link(url_registry.url("developer-guide"), "docs")
3819
3812
 
3820
3813
  project_html = printer.link(project_url, "Weights & Biases")
3821
3814
  project_line = f"to {project_html} ({doc_html})"
@@ -3865,7 +3858,6 @@ class Run:
3865
3858
  poll_exit_response: PollExitResponse | None = None,
3866
3859
  internal_messages_response: InternalMessagesResponse | None = None,
3867
3860
  reporter: Reporter | None = None,
3868
- quiet: bool | None = None,
3869
3861
  *,
3870
3862
  settings: Settings,
3871
3863
  printer: printer.Printer,
@@ -3873,37 +3865,32 @@ class Run:
3873
3865
  Run._footer_history_summary_info(
3874
3866
  history=sampled_history,
3875
3867
  summary=final_summary,
3876
- quiet=quiet,
3877
3868
  settings=settings,
3878
3869
  printer=printer,
3879
3870
  )
3880
3871
 
3881
3872
  Run._footer_sync_info(
3882
3873
  poll_exit_response=poll_exit_response,
3883
- quiet=quiet,
3884
3874
  settings=settings,
3885
3875
  printer=printer,
3886
3876
  )
3887
- Run._footer_log_dir_info(quiet=quiet, settings=settings, printer=printer)
3877
+ Run._footer_log_dir_info(settings=settings, printer=printer)
3888
3878
  Run._footer_notify_wandb_core(
3889
- quiet=quiet,
3890
3879
  settings=settings,
3891
3880
  printer=printer,
3892
3881
  )
3893
3882
  Run._footer_internal_messages(
3894
3883
  internal_messages_response=internal_messages_response,
3895
- quiet=quiet,
3896
3884
  settings=settings,
3897
3885
  printer=printer,
3898
3886
  )
3899
3887
  Run._footer_reporter_warn_err(
3900
- reporter=reporter, quiet=quiet, settings=settings, printer=printer
3888
+ reporter=reporter, settings=settings, printer=printer
3901
3889
  )
3902
3890
 
3903
3891
  @staticmethod
3904
3892
  def _footer_sync_info(
3905
3893
  poll_exit_response: PollExitResponse | None = None,
3906
- quiet: bool | None = None,
3907
3894
  *,
3908
3895
  settings: Settings,
3909
3896
  printer: printer.Printer,
@@ -3912,7 +3899,7 @@ class Run:
3912
3899
  return
3913
3900
 
3914
3901
  if settings._offline:
3915
- if not quiet and not settings.quiet:
3902
+ if not settings.quiet:
3916
3903
  printer.display(
3917
3904
  [
3918
3905
  "You can sync this run to the cloud by running:",
@@ -3941,12 +3928,11 @@ class Run:
3941
3928
 
3942
3929
  @staticmethod
3943
3930
  def _footer_log_dir_info(
3944
- quiet: bool | None = None,
3945
3931
  *,
3946
3932
  settings: Settings,
3947
3933
  printer: printer.Printer,
3948
3934
  ) -> None:
3949
- if (quiet or settings.quiet) or settings.silent:
3935
+ if settings.quiet or settings.silent:
3950
3936
  return
3951
3937
 
3952
3938
  log_dir = settings.log_user or settings.log_internal
@@ -3960,12 +3946,11 @@ class Run:
3960
3946
  def _footer_history_summary_info(
3961
3947
  history: SampledHistoryResponse | None = None,
3962
3948
  summary: GetSummaryResponse | None = None,
3963
- quiet: bool | None = None,
3964
3949
  *,
3965
3950
  settings: Settings,
3966
3951
  printer: printer.Printer,
3967
3952
  ) -> None:
3968
- if (quiet or settings.quiet) or settings.silent:
3953
+ if settings.quiet or settings.silent:
3969
3954
  return
3970
3955
 
3971
3956
  panel = []
@@ -4030,12 +4015,11 @@ class Run:
4030
4015
  @staticmethod
4031
4016
  def _footer_internal_messages(
4032
4017
  internal_messages_response: InternalMessagesResponse | None = None,
4033
- quiet: bool | None = None,
4034
4018
  *,
4035
4019
  settings: Settings,
4036
4020
  printer: printer.Printer,
4037
4021
  ) -> None:
4038
- if (quiet or settings.quiet) or settings.silent:
4022
+ if settings.quiet or settings.silent:
4039
4023
  return
4040
4024
 
4041
4025
  if not internal_messages_response:
@@ -4047,30 +4031,28 @@ class Run:
4047
4031
  @staticmethod
4048
4032
  def _footer_notify_wandb_core(
4049
4033
  *,
4050
- quiet: bool | None = None,
4051
4034
  settings: Settings,
4052
4035
  printer: printer.Printer,
4053
4036
  ) -> None:
4054
4037
  """Prints a message advertising the upcoming core release."""
4055
- if quiet or not settings._require_legacy_service:
4038
+ if settings.quiet or not settings._require_legacy_service:
4056
4039
  return
4057
4040
 
4058
4041
  printer.display(
4059
4042
  "The legacy backend is deprecated. In future versions, `wandb-core` will become "
4060
4043
  "the sole backend service, and the `wandb.require('legacy-service')` flag will be removed. "
4061
- "For more information, visit https://wandb.me/wandb-core",
4044
+ f"For more information, visit {url_registry.url('wandb-core')}",
4062
4045
  level="warn",
4063
4046
  )
4064
4047
 
4065
4048
  @staticmethod
4066
4049
  def _footer_reporter_warn_err(
4067
4050
  reporter: Reporter | None = None,
4068
- quiet: bool | None = None,
4069
4051
  *,
4070
4052
  settings: Settings,
4071
4053
  printer: printer.Printer,
4072
4054
  ) -> None:
4073
- if (quiet or settings.quiet) or settings.silent:
4055
+ if settings.quiet or settings.silent:
4074
4056
  return
4075
4057
 
4076
4058
  if not reporter:
@@ -4103,7 +4085,7 @@ def restore(
4103
4085
  File is placed into the current directory or run directory.
4104
4086
  By default, will only download the file if it doesn't already exist.
4105
4087
 
4106
- Arguments:
4088
+ Args:
4107
4089
  name: the name of the file
4108
4090
  run_path: optional path to a run to pull files from, i.e. `username/project_name/run_id`
4109
4091
  if wandb.init has not been called, this is required.
@@ -4161,9 +4143,9 @@ def finish(exit_code: int | None = None, quiet: bool | None = None) -> None:
4161
4143
  This is used when creating multiple runs in the same process.
4162
4144
  We automatically call this method when your script exits.
4163
4145
 
4164
- Arguments:
4146
+ Args:
4165
4147
  exit_code: Set to something other than 0 to mark a run as failed
4166
- quiet: Set to true to minimize log output
4148
+ quiet: Deprecated, use `wandb.Settings(quiet=...)` to set this instead.
4167
4149
  """
4168
4150
  if wandb.run:
4169
4151
  wandb.run.finish(exit_code=exit_code, quiet=quiet)
@@ -48,9 +48,8 @@ from wandb.sdk.lib._settings_toposort_generated import SETTINGS_TOPOLOGICALLY_SO
48
48
  from wandb.sdk.lib.run_moment import RunMoment
49
49
  from wandb.sdk.wandb_setup import _EarlyLogger
50
50
 
51
- from .lib import apikey
51
+ from .lib import apikey, ipython
52
52
  from .lib.gitlib import GitRepo
53
- from .lib.ipython import _get_python_type
54
53
  from .lib.runid import generate_id
55
54
 
56
55
  if sys.version_info >= (3, 8):
@@ -161,6 +160,20 @@ def _get_program() -> Optional[str]:
161
160
  return None
162
161
 
163
162
 
163
+ def _preprocess_file_stream_max_line_bytes(val: Any) -> Optional[int]:
164
+ """Preprocess the file_stream_max_line_bytes setting.
165
+
166
+ For now treat negative values as 0, which means use the default.
167
+ """
168
+ try:
169
+ value = int(val)
170
+ if value < 0:
171
+ return None
172
+ return value
173
+ except ValueError:
174
+ return None
175
+
176
+
164
177
  def _runmoment_preprocessor(val: Any) -> Optional[RunMoment]:
165
178
  if isinstance(val, RunMoment) or val is None:
166
179
  return val
@@ -321,6 +334,7 @@ class SettingsData:
321
334
  _file_stream_retry_wait_min_seconds: float # min wait time between retries
322
335
  _file_stream_retry_wait_max_seconds: float # max wait time between retries
323
336
  _file_stream_timeout_seconds: float # timeout for individual HTTP requests
337
+ _file_stream_max_line_bytes: int # max line length for filestream jsonl files
324
338
  # file transfer retry client configuration
325
339
  _file_transfer_retry_max: int
326
340
  _file_transfer_retry_wait_min_seconds: float
@@ -383,10 +397,10 @@ class SettingsData:
383
397
  _stats_disk_paths: Sequence[str] # paths to monitor disk usage
384
398
  _stats_buffer_size: int # number of consolidated samples to buffer before flushing, available in run obj
385
399
  _tmp_code_dir: str
386
- _tracelog: str
387
400
  _unsaved_keys: Sequence[str]
388
401
  _windows: bool
389
402
  _show_operation_stats: bool
403
+ allow_offline_artifacts: bool
390
404
  allow_val_change: bool
391
405
  anonymous: str
392
406
  api_key: str
@@ -671,6 +685,9 @@ class Settings(SettingsData):
671
685
  _file_stream_retry_wait_min_seconds={"preprocessor": float},
672
686
  _file_stream_retry_wait_max_seconds={"preprocessor": float},
673
687
  _file_stream_timeout_seconds={"preprocessor": float},
688
+ _file_stream_max_line_bytes={
689
+ "preprocessor": _preprocess_file_stream_max_line_bytes,
690
+ },
674
691
  _file_transfer_retry_max={"preprocessor": int},
675
692
  _file_transfer_retry_wait_min_seconds={"preprocessor": float},
676
693
  _file_transfer_retry_wait_max_seconds={"preprocessor": float},
@@ -690,11 +707,11 @@ class Settings(SettingsData):
690
707
  _internal_check_process={"value": 8, "preprocessor": float},
691
708
  _internal_queue_timeout={"value": 2, "preprocessor": float},
692
709
  _ipython={
693
- "hook": lambda _: _get_python_type() == "ipython",
710
+ "hook": lambda _: ipython.in_ipython(),
694
711
  "auto_hook": True,
695
712
  },
696
713
  _jupyter={
697
- "hook": lambda _: _get_python_type() == "jupyter",
714
+ "hook": lambda _: ipython.in_jupyter(),
698
715
  "auto_hook": True,
699
716
  },
700
717
  _kaggle={"hook": lambda _: util._is_likely_kaggle(), "auto_hook": True},
@@ -778,6 +795,7 @@ class Settings(SettingsData):
778
795
  "auto_hook": True,
779
796
  },
780
797
  _show_operation_stats={"preprocessor": _str_as_bool},
798
+ allow_offline_artifacts={"value": "True", "preprocessor": _str_as_bool},
781
799
  anonymous={"validator": self._validate_anonymous},
782
800
  api_key={"validator": self._validate_api_key},
783
801
  base_url={
@@ -1678,7 +1696,6 @@ class Settings(SettingsData):
1678
1696
  ) -> None:
1679
1697
  env_prefix: str = "WANDB_"
1680
1698
  special_env_var_names = {
1681
- "WANDB_TRACELOG": "_tracelog",
1682
1699
  "WANDB_DISABLE_SERVICE": "_disable_service",
1683
1700
  "WANDB_SERVICE_TRANSPORT": "_service_transport",
1684
1701
  "WANDB_DIR": "root_dir",