wandb 0.18.1__py3-none-macosx_11_0_x86_64.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (826) hide show
  1. package_readme.md +89 -0
  2. wandb/__init__.py +245 -0
  3. wandb/__init__.pyi +1084 -0
  4. wandb/__main__.py +3 -0
  5. wandb/_globals.py +19 -0
  6. wandb/agents/__init__.py +0 -0
  7. wandb/agents/pyagent.py +363 -0
  8. wandb/analytics/__init__.py +3 -0
  9. wandb/analytics/sentry.py +266 -0
  10. wandb/apis/__init__.py +48 -0
  11. wandb/apis/attrs.py +40 -0
  12. wandb/apis/importers/__init__.py +1 -0
  13. wandb/apis/importers/internals/internal.py +385 -0
  14. wandb/apis/importers/internals/protocols.py +99 -0
  15. wandb/apis/importers/internals/util.py +78 -0
  16. wandb/apis/importers/mlflow.py +254 -0
  17. wandb/apis/importers/validation.py +108 -0
  18. wandb/apis/importers/wandb.py +1603 -0
  19. wandb/apis/internal.py +229 -0
  20. wandb/apis/normalize.py +89 -0
  21. wandb/apis/paginator.py +81 -0
  22. wandb/apis/public/__init__.py +34 -0
  23. wandb/apis/public/api.py +1179 -0
  24. wandb/apis/public/artifacts.py +1086 -0
  25. wandb/apis/public/const.py +4 -0
  26. wandb/apis/public/files.py +195 -0
  27. wandb/apis/public/history.py +149 -0
  28. wandb/apis/public/jobs.py +651 -0
  29. wandb/apis/public/projects.py +154 -0
  30. wandb/apis/public/query_generator.py +166 -0
  31. wandb/apis/public/reports.py +469 -0
  32. wandb/apis/public/runs.py +903 -0
  33. wandb/apis/public/sweeps.py +240 -0
  34. wandb/apis/public/teams.py +198 -0
  35. wandb/apis/public/users.py +136 -0
  36. wandb/apis/reports/__init__.py +1 -0
  37. wandb/apis/reports/v1/__init__.py +8 -0
  38. wandb/apis/reports/v2/__init__.py +8 -0
  39. wandb/apis/workspaces/__init__.py +8 -0
  40. wandb/beta/workflows.py +288 -0
  41. wandb/bin/wandb-core +0 -0
  42. wandb/cli/__init__.py +0 -0
  43. wandb/cli/cli.py +3007 -0
  44. wandb/data_types.py +63 -0
  45. wandb/docker/__init__.py +342 -0
  46. wandb/docker/auth.py +436 -0
  47. wandb/docker/wandb-entrypoint.sh +33 -0
  48. wandb/docker/www_authenticate.py +94 -0
  49. wandb/env.py +514 -0
  50. wandb/errors/__init__.py +46 -0
  51. wandb/errors/term.py +103 -0
  52. wandb/errors/util.py +57 -0
  53. wandb/filesync/__init__.py +0 -0
  54. wandb/filesync/dir_watcher.py +403 -0
  55. wandb/filesync/stats.py +100 -0
  56. wandb/filesync/step_checksum.py +142 -0
  57. wandb/filesync/step_prepare.py +179 -0
  58. wandb/filesync/step_upload.py +290 -0
  59. wandb/filesync/upload_job.py +142 -0
  60. wandb/integration/__init__.py +0 -0
  61. wandb/integration/catboost/__init__.py +5 -0
  62. wandb/integration/catboost/catboost.py +178 -0
  63. wandb/integration/cohere/__init__.py +3 -0
  64. wandb/integration/cohere/cohere.py +21 -0
  65. wandb/integration/cohere/resolver.py +347 -0
  66. wandb/integration/diffusers/__init__.py +3 -0
  67. wandb/integration/diffusers/autologger.py +76 -0
  68. wandb/integration/diffusers/pipeline_resolver.py +50 -0
  69. wandb/integration/diffusers/resolvers/__init__.py +9 -0
  70. wandb/integration/diffusers/resolvers/multimodal.py +882 -0
  71. wandb/integration/diffusers/resolvers/utils.py +102 -0
  72. wandb/integration/fastai/__init__.py +249 -0
  73. wandb/integration/gym/__init__.py +105 -0
  74. wandb/integration/huggingface/__init__.py +3 -0
  75. wandb/integration/huggingface/huggingface.py +18 -0
  76. wandb/integration/huggingface/resolver.py +213 -0
  77. wandb/integration/keras/__init__.py +11 -0
  78. wandb/integration/keras/callbacks/__init__.py +5 -0
  79. wandb/integration/keras/callbacks/metrics_logger.py +136 -0
  80. wandb/integration/keras/callbacks/model_checkpoint.py +195 -0
  81. wandb/integration/keras/callbacks/tables_builder.py +226 -0
  82. wandb/integration/keras/keras.py +1091 -0
  83. wandb/integration/kfp/__init__.py +6 -0
  84. wandb/integration/kfp/helpers.py +28 -0
  85. wandb/integration/kfp/kfp_patch.py +324 -0
  86. wandb/integration/kfp/wandb_logging.py +182 -0
  87. wandb/integration/langchain/__init__.py +3 -0
  88. wandb/integration/langchain/wandb_tracer.py +48 -0
  89. wandb/integration/lightgbm/__init__.py +239 -0
  90. wandb/integration/lightning/__init__.py +0 -0
  91. wandb/integration/lightning/fabric/__init__.py +3 -0
  92. wandb/integration/lightning/fabric/logger.py +762 -0
  93. wandb/integration/magic.py +556 -0
  94. wandb/integration/metaflow/__init__.py +3 -0
  95. wandb/integration/metaflow/metaflow.py +383 -0
  96. wandb/integration/openai/__init__.py +3 -0
  97. wandb/integration/openai/fine_tuning.py +480 -0
  98. wandb/integration/openai/openai.py +22 -0
  99. wandb/integration/openai/resolver.py +240 -0
  100. wandb/integration/prodigy/__init__.py +3 -0
  101. wandb/integration/prodigy/prodigy.py +299 -0
  102. wandb/integration/sacred/__init__.py +117 -0
  103. wandb/integration/sagemaker/__init__.py +12 -0
  104. wandb/integration/sagemaker/auth.py +28 -0
  105. wandb/integration/sagemaker/config.py +49 -0
  106. wandb/integration/sagemaker/files.py +3 -0
  107. wandb/integration/sagemaker/resources.py +34 -0
  108. wandb/integration/sb3/__init__.py +3 -0
  109. wandb/integration/sb3/sb3.py +153 -0
  110. wandb/integration/sklearn/__init__.py +37 -0
  111. wandb/integration/sklearn/calculate/__init__.py +32 -0
  112. wandb/integration/sklearn/calculate/calibration_curves.py +125 -0
  113. wandb/integration/sklearn/calculate/class_proportions.py +68 -0
  114. wandb/integration/sklearn/calculate/confusion_matrix.py +93 -0
  115. wandb/integration/sklearn/calculate/decision_boundaries.py +40 -0
  116. wandb/integration/sklearn/calculate/elbow_curve.py +55 -0
  117. wandb/integration/sklearn/calculate/feature_importances.py +67 -0
  118. wandb/integration/sklearn/calculate/learning_curve.py +64 -0
  119. wandb/integration/sklearn/calculate/outlier_candidates.py +69 -0
  120. wandb/integration/sklearn/calculate/residuals.py +86 -0
  121. wandb/integration/sklearn/calculate/silhouette.py +118 -0
  122. wandb/integration/sklearn/calculate/summary_metrics.py +62 -0
  123. wandb/integration/sklearn/plot/__init__.py +35 -0
  124. wandb/integration/sklearn/plot/classifier.py +329 -0
  125. wandb/integration/sklearn/plot/clusterer.py +146 -0
  126. wandb/integration/sklearn/plot/regressor.py +121 -0
  127. wandb/integration/sklearn/plot/shared.py +91 -0
  128. wandb/integration/sklearn/utils.py +183 -0
  129. wandb/integration/tensorboard/__init__.py +10 -0
  130. wandb/integration/tensorboard/log.py +355 -0
  131. wandb/integration/tensorboard/monkeypatch.py +185 -0
  132. wandb/integration/tensorflow/__init__.py +5 -0
  133. wandb/integration/tensorflow/estimator_hook.py +54 -0
  134. wandb/integration/torch/__init__.py +0 -0
  135. wandb/integration/torch/wandb_torch.py +554 -0
  136. wandb/integration/ultralytics/__init__.py +11 -0
  137. wandb/integration/ultralytics/bbox_utils.py +208 -0
  138. wandb/integration/ultralytics/callback.py +524 -0
  139. wandb/integration/ultralytics/classification_utils.py +83 -0
  140. wandb/integration/ultralytics/mask_utils.py +202 -0
  141. wandb/integration/ultralytics/pose_utils.py +103 -0
  142. wandb/integration/xgboost/__init__.py +11 -0
  143. wandb/integration/xgboost/xgboost.py +189 -0
  144. wandb/integration/yolov8/__init__.py +0 -0
  145. wandb/integration/yolov8/yolov8.py +284 -0
  146. wandb/jupyter.py +515 -0
  147. wandb/magic.py +3 -0
  148. wandb/mpmain/__init__.py +0 -0
  149. wandb/mpmain/__main__.py +1 -0
  150. wandb/old/__init__.py +0 -0
  151. wandb/old/core.py +131 -0
  152. wandb/old/settings.py +173 -0
  153. wandb/old/summary.py +440 -0
  154. wandb/plot/__init__.py +19 -0
  155. wandb/plot/bar.py +42 -0
  156. wandb/plot/confusion_matrix.py +99 -0
  157. wandb/plot/histogram.py +36 -0
  158. wandb/plot/line.py +40 -0
  159. wandb/plot/line_series.py +88 -0
  160. wandb/plot/pr_curve.py +136 -0
  161. wandb/plot/roc_curve.py +118 -0
  162. wandb/plot/scatter.py +32 -0
  163. wandb/plot/utils.py +183 -0
  164. wandb/proto/__init__.py +0 -0
  165. wandb/proto/v3/__init__.py +0 -0
  166. wandb/proto/v3/wandb_base_pb2.py +55 -0
  167. wandb/proto/v3/wandb_internal_pb2.py +1608 -0
  168. wandb/proto/v3/wandb_server_pb2.py +208 -0
  169. wandb/proto/v3/wandb_settings_pb2.py +112 -0
  170. wandb/proto/v3/wandb_telemetry_pb2.py +106 -0
  171. wandb/proto/v4/__init__.py +0 -0
  172. wandb/proto/v4/wandb_base_pb2.py +30 -0
  173. wandb/proto/v4/wandb_internal_pb2.py +360 -0
  174. wandb/proto/v4/wandb_server_pb2.py +63 -0
  175. wandb/proto/v4/wandb_settings_pb2.py +45 -0
  176. wandb/proto/v4/wandb_telemetry_pb2.py +41 -0
  177. wandb/proto/v5/wandb_base_pb2.py +31 -0
  178. wandb/proto/v5/wandb_internal_pb2.py +361 -0
  179. wandb/proto/v5/wandb_server_pb2.py +64 -0
  180. wandb/proto/v5/wandb_settings_pb2.py +46 -0
  181. wandb/proto/v5/wandb_telemetry_pb2.py +42 -0
  182. wandb/proto/wandb_base_pb2.py +10 -0
  183. wandb/proto/wandb_deprecated.py +53 -0
  184. wandb/proto/wandb_generate_deprecated.py +34 -0
  185. wandb/proto/wandb_generate_proto.py +49 -0
  186. wandb/proto/wandb_internal_pb2.py +16 -0
  187. wandb/proto/wandb_server_pb2.py +10 -0
  188. wandb/proto/wandb_settings_pb2.py +10 -0
  189. wandb/proto/wandb_telemetry_pb2.py +10 -0
  190. wandb/py.typed +0 -0
  191. wandb/sdk/__init__.py +37 -0
  192. wandb/sdk/artifacts/__init__.py +0 -0
  193. wandb/sdk/artifacts/_validators.py +45 -0
  194. wandb/sdk/artifacts/artifact.py +2415 -0
  195. wandb/sdk/artifacts/artifact_download_logger.py +43 -0
  196. wandb/sdk/artifacts/artifact_file_cache.py +251 -0
  197. wandb/sdk/artifacts/artifact_instance_cache.py +15 -0
  198. wandb/sdk/artifacts/artifact_manifest.py +72 -0
  199. wandb/sdk/artifacts/artifact_manifest_entry.py +247 -0
  200. wandb/sdk/artifacts/artifact_manifests/__init__.py +0 -0
  201. wandb/sdk/artifacts/artifact_manifests/artifact_manifest_v1.py +90 -0
  202. wandb/sdk/artifacts/artifact_saver.py +267 -0
  203. wandb/sdk/artifacts/artifact_state.py +11 -0
  204. wandb/sdk/artifacts/artifact_ttl.py +7 -0
  205. wandb/sdk/artifacts/exceptions.py +56 -0
  206. wandb/sdk/artifacts/staging.py +25 -0
  207. wandb/sdk/artifacts/storage_handler.py +60 -0
  208. wandb/sdk/artifacts/storage_handlers/__init__.py +0 -0
  209. wandb/sdk/artifacts/storage_handlers/azure_handler.py +206 -0
  210. wandb/sdk/artifacts/storage_handlers/gcs_handler.py +226 -0
  211. wandb/sdk/artifacts/storage_handlers/http_handler.py +113 -0
  212. wandb/sdk/artifacts/storage_handlers/local_file_handler.py +139 -0
  213. wandb/sdk/artifacts/storage_handlers/multi_handler.py +54 -0
  214. wandb/sdk/artifacts/storage_handlers/s3_handler.py +300 -0
  215. wandb/sdk/artifacts/storage_handlers/tracking_handler.py +70 -0
  216. wandb/sdk/artifacts/storage_handlers/wb_artifact_handler.py +133 -0
  217. wandb/sdk/artifacts/storage_handlers/wb_local_artifact_handler.py +72 -0
  218. wandb/sdk/artifacts/storage_layout.py +6 -0
  219. wandb/sdk/artifacts/storage_policies/__init__.py +4 -0
  220. wandb/sdk/artifacts/storage_policies/register.py +1 -0
  221. wandb/sdk/artifacts/storage_policies/wandb_storage_policy.py +376 -0
  222. wandb/sdk/artifacts/storage_policy.py +72 -0
  223. wandb/sdk/backend/__init__.py +0 -0
  224. wandb/sdk/backend/backend.py +240 -0
  225. wandb/sdk/data_types/__init__.py +0 -0
  226. wandb/sdk/data_types/_dtypes.py +914 -0
  227. wandb/sdk/data_types/_private.py +10 -0
  228. wandb/sdk/data_types/audio.py +165 -0
  229. wandb/sdk/data_types/base_types/__init__.py +0 -0
  230. wandb/sdk/data_types/base_types/json_metadata.py +55 -0
  231. wandb/sdk/data_types/base_types/media.py +315 -0
  232. wandb/sdk/data_types/base_types/wb_value.py +274 -0
  233. wandb/sdk/data_types/bokeh.py +70 -0
  234. wandb/sdk/data_types/graph.py +405 -0
  235. wandb/sdk/data_types/helper_types/__init__.py +0 -0
  236. wandb/sdk/data_types/helper_types/bounding_boxes_2d.py +295 -0
  237. wandb/sdk/data_types/helper_types/classes.py +159 -0
  238. wandb/sdk/data_types/helper_types/image_mask.py +235 -0
  239. wandb/sdk/data_types/histogram.py +96 -0
  240. wandb/sdk/data_types/html.py +115 -0
  241. wandb/sdk/data_types/image.py +845 -0
  242. wandb/sdk/data_types/molecule.py +241 -0
  243. wandb/sdk/data_types/object_3d.py +474 -0
  244. wandb/sdk/data_types/plotly.py +82 -0
  245. wandb/sdk/data_types/saved_model.py +446 -0
  246. wandb/sdk/data_types/table.py +1204 -0
  247. wandb/sdk/data_types/trace_tree.py +438 -0
  248. wandb/sdk/data_types/utils.py +229 -0
  249. wandb/sdk/data_types/video.py +247 -0
  250. wandb/sdk/integration_utils/__init__.py +0 -0
  251. wandb/sdk/integration_utils/auto_logging.py +239 -0
  252. wandb/sdk/integration_utils/data_logging.py +475 -0
  253. wandb/sdk/interface/__init__.py +0 -0
  254. wandb/sdk/interface/constants.py +4 -0
  255. wandb/sdk/interface/interface.py +996 -0
  256. wandb/sdk/interface/interface_queue.py +59 -0
  257. wandb/sdk/interface/interface_relay.py +53 -0
  258. wandb/sdk/interface/interface_shared.py +549 -0
  259. wandb/sdk/interface/interface_sock.py +61 -0
  260. wandb/sdk/interface/message_future.py +27 -0
  261. wandb/sdk/interface/message_future_poll.py +50 -0
  262. wandb/sdk/interface/router.py +118 -0
  263. wandb/sdk/interface/router_queue.py +44 -0
  264. wandb/sdk/interface/router_relay.py +39 -0
  265. wandb/sdk/interface/router_sock.py +36 -0
  266. wandb/sdk/interface/summary_record.py +67 -0
  267. wandb/sdk/internal/__init__.py +0 -0
  268. wandb/sdk/internal/context.py +89 -0
  269. wandb/sdk/internal/datastore.py +297 -0
  270. wandb/sdk/internal/file_pusher.py +181 -0
  271. wandb/sdk/internal/file_stream.py +695 -0
  272. wandb/sdk/internal/flow_control.py +263 -0
  273. wandb/sdk/internal/handler.py +911 -0
  274. wandb/sdk/internal/internal.py +417 -0
  275. wandb/sdk/internal/internal_api.py +4287 -0
  276. wandb/sdk/internal/internal_util.py +100 -0
  277. wandb/sdk/internal/job_builder.py +629 -0
  278. wandb/sdk/internal/profiler.py +78 -0
  279. wandb/sdk/internal/progress.py +83 -0
  280. wandb/sdk/internal/run.py +25 -0
  281. wandb/sdk/internal/sample.py +70 -0
  282. wandb/sdk/internal/sender.py +1729 -0
  283. wandb/sdk/internal/sender_config.py +197 -0
  284. wandb/sdk/internal/settings_static.py +90 -0
  285. wandb/sdk/internal/system/__init__.py +0 -0
  286. wandb/sdk/internal/system/assets/__init__.py +27 -0
  287. wandb/sdk/internal/system/assets/aggregators.py +37 -0
  288. wandb/sdk/internal/system/assets/asset_registry.py +20 -0
  289. wandb/sdk/internal/system/assets/cpu.py +163 -0
  290. wandb/sdk/internal/system/assets/disk.py +210 -0
  291. wandb/sdk/internal/system/assets/gpu.py +416 -0
  292. wandb/sdk/internal/system/assets/gpu_amd.py +239 -0
  293. wandb/sdk/internal/system/assets/gpu_apple.py +177 -0
  294. wandb/sdk/internal/system/assets/interfaces.py +207 -0
  295. wandb/sdk/internal/system/assets/ipu.py +177 -0
  296. wandb/sdk/internal/system/assets/memory.py +166 -0
  297. wandb/sdk/internal/system/assets/network.py +125 -0
  298. wandb/sdk/internal/system/assets/open_metrics.py +299 -0
  299. wandb/sdk/internal/system/assets/tpu.py +154 -0
  300. wandb/sdk/internal/system/assets/trainium.py +399 -0
  301. wandb/sdk/internal/system/env_probe_helpers.py +13 -0
  302. wandb/sdk/internal/system/system_info.py +249 -0
  303. wandb/sdk/internal/system/system_monitor.py +229 -0
  304. wandb/sdk/internal/tb_watcher.py +518 -0
  305. wandb/sdk/internal/thread_local_settings.py +18 -0
  306. wandb/sdk/internal/update.py +113 -0
  307. wandb/sdk/internal/writer.py +206 -0
  308. wandb/sdk/launch/__init__.py +14 -0
  309. wandb/sdk/launch/_launch.py +330 -0
  310. wandb/sdk/launch/_launch_add.py +255 -0
  311. wandb/sdk/launch/_project_spec.py +566 -0
  312. wandb/sdk/launch/agent/__init__.py +5 -0
  313. wandb/sdk/launch/agent/agent.py +924 -0
  314. wandb/sdk/launch/agent/config.py +296 -0
  315. wandb/sdk/launch/agent/job_status_tracker.py +53 -0
  316. wandb/sdk/launch/agent/run_queue_item_file_saver.py +45 -0
  317. wandb/sdk/launch/builder/__init__.py +0 -0
  318. wandb/sdk/launch/builder/abstract.py +156 -0
  319. wandb/sdk/launch/builder/build.py +297 -0
  320. wandb/sdk/launch/builder/context_manager.py +235 -0
  321. wandb/sdk/launch/builder/docker_builder.py +177 -0
  322. wandb/sdk/launch/builder/kaniko_builder.py +595 -0
  323. wandb/sdk/launch/builder/noop.py +58 -0
  324. wandb/sdk/launch/builder/templates/_wandb_bootstrap.py +188 -0
  325. wandb/sdk/launch/builder/templates/dockerfile.py +92 -0
  326. wandb/sdk/launch/create_job.py +528 -0
  327. wandb/sdk/launch/environment/abstract.py +29 -0
  328. wandb/sdk/launch/environment/aws_environment.py +322 -0
  329. wandb/sdk/launch/environment/azure_environment.py +105 -0
  330. wandb/sdk/launch/environment/gcp_environment.py +335 -0
  331. wandb/sdk/launch/environment/local_environment.py +66 -0
  332. wandb/sdk/launch/errors.py +19 -0
  333. wandb/sdk/launch/git_reference.py +109 -0
  334. wandb/sdk/launch/inputs/files.py +148 -0
  335. wandb/sdk/launch/inputs/internal.py +315 -0
  336. wandb/sdk/launch/inputs/manage.py +113 -0
  337. wandb/sdk/launch/inputs/schema.py +39 -0
  338. wandb/sdk/launch/loader.py +249 -0
  339. wandb/sdk/launch/registry/abstract.py +48 -0
  340. wandb/sdk/launch/registry/anon.py +29 -0
  341. wandb/sdk/launch/registry/azure_container_registry.py +124 -0
  342. wandb/sdk/launch/registry/elastic_container_registry.py +192 -0
  343. wandb/sdk/launch/registry/google_artifact_registry.py +219 -0
  344. wandb/sdk/launch/registry/local_registry.py +67 -0
  345. wandb/sdk/launch/runner/__init__.py +0 -0
  346. wandb/sdk/launch/runner/abstract.py +195 -0
  347. wandb/sdk/launch/runner/kubernetes_monitor.py +474 -0
  348. wandb/sdk/launch/runner/kubernetes_runner.py +963 -0
  349. wandb/sdk/launch/runner/local_container.py +301 -0
  350. wandb/sdk/launch/runner/local_process.py +78 -0
  351. wandb/sdk/launch/runner/sagemaker_runner.py +426 -0
  352. wandb/sdk/launch/runner/vertex_runner.py +230 -0
  353. wandb/sdk/launch/sweeps/__init__.py +39 -0
  354. wandb/sdk/launch/sweeps/scheduler.py +742 -0
  355. wandb/sdk/launch/sweeps/scheduler_sweep.py +91 -0
  356. wandb/sdk/launch/sweeps/utils.py +316 -0
  357. wandb/sdk/launch/utils.py +746 -0
  358. wandb/sdk/launch/wandb_reference.py +138 -0
  359. wandb/sdk/lib/__init__.py +5 -0
  360. wandb/sdk/lib/_settings_toposort_generate.py +159 -0
  361. wandb/sdk/lib/_settings_toposort_generated.py +249 -0
  362. wandb/sdk/lib/_wburls_generate.py +25 -0
  363. wandb/sdk/lib/_wburls_generated.py +22 -0
  364. wandb/sdk/lib/apikey.py +273 -0
  365. wandb/sdk/lib/capped_dict.py +26 -0
  366. wandb/sdk/lib/config_util.py +101 -0
  367. wandb/sdk/lib/credentials.py +141 -0
  368. wandb/sdk/lib/deprecate.py +42 -0
  369. wandb/sdk/lib/disabled.py +29 -0
  370. wandb/sdk/lib/exit_hooks.py +54 -0
  371. wandb/sdk/lib/file_stream_utils.py +118 -0
  372. wandb/sdk/lib/filenames.py +64 -0
  373. wandb/sdk/lib/filesystem.py +372 -0
  374. wandb/sdk/lib/fsm.py +174 -0
  375. wandb/sdk/lib/gitlib.py +239 -0
  376. wandb/sdk/lib/gql_request.py +65 -0
  377. wandb/sdk/lib/handler_util.py +21 -0
  378. wandb/sdk/lib/hashutil.py +62 -0
  379. wandb/sdk/lib/import_hooks.py +275 -0
  380. wandb/sdk/lib/ipython.py +146 -0
  381. wandb/sdk/lib/json_util.py +80 -0
  382. wandb/sdk/lib/lazyloader.py +63 -0
  383. wandb/sdk/lib/mailbox.py +460 -0
  384. wandb/sdk/lib/module.py +69 -0
  385. wandb/sdk/lib/paths.py +106 -0
  386. wandb/sdk/lib/preinit.py +42 -0
  387. wandb/sdk/lib/printer.py +313 -0
  388. wandb/sdk/lib/proto_util.py +90 -0
  389. wandb/sdk/lib/redirect.py +845 -0
  390. wandb/sdk/lib/reporting.py +99 -0
  391. wandb/sdk/lib/retry.py +289 -0
  392. wandb/sdk/lib/run_moment.py +78 -0
  393. wandb/sdk/lib/runid.py +12 -0
  394. wandb/sdk/lib/server.py +52 -0
  395. wandb/sdk/lib/sock_client.py +291 -0
  396. wandb/sdk/lib/sparkline.py +45 -0
  397. wandb/sdk/lib/telemetry.py +100 -0
  398. wandb/sdk/lib/timed_input.py +133 -0
  399. wandb/sdk/lib/timer.py +19 -0
  400. wandb/sdk/lib/tracelog.py +255 -0
  401. wandb/sdk/lib/viz.py +123 -0
  402. wandb/sdk/lib/wburls.py +46 -0
  403. wandb/sdk/service/__init__.py +0 -0
  404. wandb/sdk/service/_startup_debug.py +22 -0
  405. wandb/sdk/service/port_file.py +53 -0
  406. wandb/sdk/service/server.py +119 -0
  407. wandb/sdk/service/server_sock.py +276 -0
  408. wandb/sdk/service/service.py +264 -0
  409. wandb/sdk/service/service_base.py +50 -0
  410. wandb/sdk/service/service_sock.py +70 -0
  411. wandb/sdk/service/streams.py +417 -0
  412. wandb/sdk/verify/__init__.py +0 -0
  413. wandb/sdk/verify/verify.py +501 -0
  414. wandb/sdk/wandb_alerts.py +12 -0
  415. wandb/sdk/wandb_config.py +322 -0
  416. wandb/sdk/wandb_helper.py +54 -0
  417. wandb/sdk/wandb_init.py +1256 -0
  418. wandb/sdk/wandb_login.py +349 -0
  419. wandb/sdk/wandb_manager.py +232 -0
  420. wandb/sdk/wandb_metric.py +110 -0
  421. wandb/sdk/wandb_require.py +97 -0
  422. wandb/sdk/wandb_require_helpers.py +44 -0
  423. wandb/sdk/wandb_run.py +4231 -0
  424. wandb/sdk/wandb_settings.py +1999 -0
  425. wandb/sdk/wandb_setup.py +400 -0
  426. wandb/sdk/wandb_summary.py +150 -0
  427. wandb/sdk/wandb_sweep.py +119 -0
  428. wandb/sdk/wandb_sync.py +75 -0
  429. wandb/sdk/wandb_watch.py +128 -0
  430. wandb/sklearn.py +35 -0
  431. wandb/sync/__init__.py +3 -0
  432. wandb/sync/sync.py +443 -0
  433. wandb/trigger.py +29 -0
  434. wandb/util.py +1949 -0
  435. wandb/vendor/__init__.py +0 -0
  436. wandb/vendor/gql-0.2.0/setup.py +40 -0
  437. wandb/vendor/gql-0.2.0/tests/__init__.py +0 -0
  438. wandb/vendor/gql-0.2.0/tests/starwars/__init__.py +0 -0
  439. wandb/vendor/gql-0.2.0/tests/starwars/fixtures.py +96 -0
  440. wandb/vendor/gql-0.2.0/tests/starwars/schema.py +146 -0
  441. wandb/vendor/gql-0.2.0/tests/starwars/test_dsl.py +293 -0
  442. wandb/vendor/gql-0.2.0/tests/starwars/test_query.py +355 -0
  443. wandb/vendor/gql-0.2.0/tests/starwars/test_validation.py +171 -0
  444. wandb/vendor/gql-0.2.0/tests/test_client.py +31 -0
  445. wandb/vendor/gql-0.2.0/tests/test_transport.py +89 -0
  446. wandb/vendor/gql-0.2.0/wandb_gql/__init__.py +4 -0
  447. wandb/vendor/gql-0.2.0/wandb_gql/client.py +75 -0
  448. wandb/vendor/gql-0.2.0/wandb_gql/dsl.py +152 -0
  449. wandb/vendor/gql-0.2.0/wandb_gql/gql.py +10 -0
  450. wandb/vendor/gql-0.2.0/wandb_gql/transport/__init__.py +0 -0
  451. wandb/vendor/gql-0.2.0/wandb_gql/transport/http.py +6 -0
  452. wandb/vendor/gql-0.2.0/wandb_gql/transport/local_schema.py +15 -0
  453. wandb/vendor/gql-0.2.0/wandb_gql/transport/requests.py +46 -0
  454. wandb/vendor/gql-0.2.0/wandb_gql/utils.py +21 -0
  455. wandb/vendor/graphql-core-1.1/setup.py +86 -0
  456. wandb/vendor/graphql-core-1.1/wandb_graphql/__init__.py +287 -0
  457. wandb/vendor/graphql-core-1.1/wandb_graphql/error/__init__.py +6 -0
  458. wandb/vendor/graphql-core-1.1/wandb_graphql/error/base.py +42 -0
  459. wandb/vendor/graphql-core-1.1/wandb_graphql/error/format_error.py +11 -0
  460. wandb/vendor/graphql-core-1.1/wandb_graphql/error/located_error.py +29 -0
  461. wandb/vendor/graphql-core-1.1/wandb_graphql/error/syntax_error.py +36 -0
  462. wandb/vendor/graphql-core-1.1/wandb_graphql/execution/__init__.py +26 -0
  463. wandb/vendor/graphql-core-1.1/wandb_graphql/execution/base.py +311 -0
  464. wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executor.py +398 -0
  465. wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/__init__.py +0 -0
  466. wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/asyncio.py +53 -0
  467. wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/gevent.py +22 -0
  468. wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/process.py +32 -0
  469. wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/sync.py +7 -0
  470. wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/thread.py +35 -0
  471. wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/utils.py +6 -0
  472. wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/__init__.py +0 -0
  473. wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/executor.py +66 -0
  474. wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/fragment.py +252 -0
  475. wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/resolver.py +151 -0
  476. wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/utils.py +7 -0
  477. wandb/vendor/graphql-core-1.1/wandb_graphql/execution/middleware.py +57 -0
  478. wandb/vendor/graphql-core-1.1/wandb_graphql/execution/values.py +145 -0
  479. wandb/vendor/graphql-core-1.1/wandb_graphql/graphql.py +60 -0
  480. wandb/vendor/graphql-core-1.1/wandb_graphql/language/__init__.py +0 -0
  481. wandb/vendor/graphql-core-1.1/wandb_graphql/language/ast.py +1349 -0
  482. wandb/vendor/graphql-core-1.1/wandb_graphql/language/base.py +19 -0
  483. wandb/vendor/graphql-core-1.1/wandb_graphql/language/lexer.py +435 -0
  484. wandb/vendor/graphql-core-1.1/wandb_graphql/language/location.py +30 -0
  485. wandb/vendor/graphql-core-1.1/wandb_graphql/language/parser.py +779 -0
  486. wandb/vendor/graphql-core-1.1/wandb_graphql/language/printer.py +193 -0
  487. wandb/vendor/graphql-core-1.1/wandb_graphql/language/source.py +18 -0
  488. wandb/vendor/graphql-core-1.1/wandb_graphql/language/visitor.py +222 -0
  489. wandb/vendor/graphql-core-1.1/wandb_graphql/language/visitor_meta.py +82 -0
  490. wandb/vendor/graphql-core-1.1/wandb_graphql/pyutils/__init__.py +0 -0
  491. wandb/vendor/graphql-core-1.1/wandb_graphql/pyutils/cached_property.py +17 -0
  492. wandb/vendor/graphql-core-1.1/wandb_graphql/pyutils/contain_subset.py +28 -0
  493. wandb/vendor/graphql-core-1.1/wandb_graphql/pyutils/default_ordered_dict.py +40 -0
  494. wandb/vendor/graphql-core-1.1/wandb_graphql/pyutils/ordereddict.py +8 -0
  495. wandb/vendor/graphql-core-1.1/wandb_graphql/pyutils/pair_set.py +43 -0
  496. wandb/vendor/graphql-core-1.1/wandb_graphql/pyutils/version.py +78 -0
  497. wandb/vendor/graphql-core-1.1/wandb_graphql/type/__init__.py +67 -0
  498. wandb/vendor/graphql-core-1.1/wandb_graphql/type/definition.py +619 -0
  499. wandb/vendor/graphql-core-1.1/wandb_graphql/type/directives.py +132 -0
  500. wandb/vendor/graphql-core-1.1/wandb_graphql/type/introspection.py +440 -0
  501. wandb/vendor/graphql-core-1.1/wandb_graphql/type/scalars.py +131 -0
  502. wandb/vendor/graphql-core-1.1/wandb_graphql/type/schema.py +100 -0
  503. wandb/vendor/graphql-core-1.1/wandb_graphql/type/typemap.py +145 -0
  504. wandb/vendor/graphql-core-1.1/wandb_graphql/utils/__init__.py +0 -0
  505. wandb/vendor/graphql-core-1.1/wandb_graphql/utils/assert_valid_name.py +9 -0
  506. wandb/vendor/graphql-core-1.1/wandb_graphql/utils/ast_from_value.py +65 -0
  507. wandb/vendor/graphql-core-1.1/wandb_graphql/utils/ast_to_code.py +49 -0
  508. wandb/vendor/graphql-core-1.1/wandb_graphql/utils/ast_to_dict.py +24 -0
  509. wandb/vendor/graphql-core-1.1/wandb_graphql/utils/base.py +75 -0
  510. wandb/vendor/graphql-core-1.1/wandb_graphql/utils/build_ast_schema.py +291 -0
  511. wandb/vendor/graphql-core-1.1/wandb_graphql/utils/build_client_schema.py +250 -0
  512. wandb/vendor/graphql-core-1.1/wandb_graphql/utils/concat_ast.py +9 -0
  513. wandb/vendor/graphql-core-1.1/wandb_graphql/utils/extend_schema.py +357 -0
  514. wandb/vendor/graphql-core-1.1/wandb_graphql/utils/get_field_def.py +27 -0
  515. wandb/vendor/graphql-core-1.1/wandb_graphql/utils/get_operation_ast.py +21 -0
  516. wandb/vendor/graphql-core-1.1/wandb_graphql/utils/introspection_query.py +90 -0
  517. wandb/vendor/graphql-core-1.1/wandb_graphql/utils/is_valid_literal_value.py +67 -0
  518. wandb/vendor/graphql-core-1.1/wandb_graphql/utils/is_valid_value.py +66 -0
  519. wandb/vendor/graphql-core-1.1/wandb_graphql/utils/quoted_or_list.py +21 -0
  520. wandb/vendor/graphql-core-1.1/wandb_graphql/utils/schema_printer.py +168 -0
  521. wandb/vendor/graphql-core-1.1/wandb_graphql/utils/suggestion_list.py +56 -0
  522. wandb/vendor/graphql-core-1.1/wandb_graphql/utils/type_comparators.py +69 -0
  523. wandb/vendor/graphql-core-1.1/wandb_graphql/utils/type_from_ast.py +21 -0
  524. wandb/vendor/graphql-core-1.1/wandb_graphql/utils/type_info.py +149 -0
  525. wandb/vendor/graphql-core-1.1/wandb_graphql/utils/value_from_ast.py +69 -0
  526. wandb/vendor/graphql-core-1.1/wandb_graphql/validation/__init__.py +4 -0
  527. wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/__init__.py +79 -0
  528. wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/arguments_of_correct_type.py +24 -0
  529. wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/base.py +8 -0
  530. wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/default_values_of_correct_type.py +44 -0
  531. wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/fields_on_correct_type.py +113 -0
  532. wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/fragments_on_composite_types.py +33 -0
  533. wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/known_argument_names.py +70 -0
  534. wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/known_directives.py +97 -0
  535. wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/known_fragment_names.py +19 -0
  536. wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/known_type_names.py +43 -0
  537. wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/lone_anonymous_operation.py +23 -0
  538. wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/no_fragment_cycles.py +59 -0
  539. wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/no_undefined_variables.py +36 -0
  540. wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/no_unused_fragments.py +38 -0
  541. wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/no_unused_variables.py +37 -0
  542. wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/overlapping_fields_can_be_merged.py +529 -0
  543. wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/possible_fragment_spreads.py +44 -0
  544. wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/provided_non_null_arguments.py +46 -0
  545. wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/scalar_leafs.py +33 -0
  546. wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/unique_argument_names.py +32 -0
  547. wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/unique_fragment_names.py +28 -0
  548. wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/unique_input_field_names.py +33 -0
  549. wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/unique_operation_names.py +31 -0
  550. wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/unique_variable_names.py +27 -0
  551. wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/variables_are_input_types.py +21 -0
  552. wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/variables_in_allowed_position.py +53 -0
  553. wandb/vendor/graphql-core-1.1/wandb_graphql/validation/validation.py +158 -0
  554. wandb/vendor/promise-2.3.0/conftest.py +30 -0
  555. wandb/vendor/promise-2.3.0/setup.py +64 -0
  556. wandb/vendor/promise-2.3.0/tests/__init__.py +0 -0
  557. wandb/vendor/promise-2.3.0/tests/conftest.py +8 -0
  558. wandb/vendor/promise-2.3.0/tests/test_awaitable.py +32 -0
  559. wandb/vendor/promise-2.3.0/tests/test_awaitable_35.py +47 -0
  560. wandb/vendor/promise-2.3.0/tests/test_benchmark.py +116 -0
  561. wandb/vendor/promise-2.3.0/tests/test_complex_threads.py +23 -0
  562. wandb/vendor/promise-2.3.0/tests/test_dataloader.py +452 -0
  563. wandb/vendor/promise-2.3.0/tests/test_dataloader_awaitable_35.py +99 -0
  564. wandb/vendor/promise-2.3.0/tests/test_dataloader_extra.py +65 -0
  565. wandb/vendor/promise-2.3.0/tests/test_extra.py +670 -0
  566. wandb/vendor/promise-2.3.0/tests/test_issues.py +132 -0
  567. wandb/vendor/promise-2.3.0/tests/test_promise_list.py +70 -0
  568. wandb/vendor/promise-2.3.0/tests/test_spec.py +584 -0
  569. wandb/vendor/promise-2.3.0/tests/test_thread_safety.py +115 -0
  570. wandb/vendor/promise-2.3.0/tests/utils.py +3 -0
  571. wandb/vendor/promise-2.3.0/wandb_promise/__init__.py +38 -0
  572. wandb/vendor/promise-2.3.0/wandb_promise/async_.py +135 -0
  573. wandb/vendor/promise-2.3.0/wandb_promise/compat.py +32 -0
  574. wandb/vendor/promise-2.3.0/wandb_promise/dataloader.py +326 -0
  575. wandb/vendor/promise-2.3.0/wandb_promise/iterate_promise.py +12 -0
  576. wandb/vendor/promise-2.3.0/wandb_promise/promise.py +848 -0
  577. wandb/vendor/promise-2.3.0/wandb_promise/promise_list.py +151 -0
  578. wandb/vendor/promise-2.3.0/wandb_promise/pyutils/__init__.py +0 -0
  579. wandb/vendor/promise-2.3.0/wandb_promise/pyutils/version.py +83 -0
  580. wandb/vendor/promise-2.3.0/wandb_promise/schedulers/__init__.py +0 -0
  581. wandb/vendor/promise-2.3.0/wandb_promise/schedulers/asyncio.py +22 -0
  582. wandb/vendor/promise-2.3.0/wandb_promise/schedulers/gevent.py +21 -0
  583. wandb/vendor/promise-2.3.0/wandb_promise/schedulers/immediate.py +27 -0
  584. wandb/vendor/promise-2.3.0/wandb_promise/schedulers/thread.py +18 -0
  585. wandb/vendor/promise-2.3.0/wandb_promise/utils.py +56 -0
  586. wandb/vendor/pygments/__init__.py +90 -0
  587. wandb/vendor/pygments/cmdline.py +568 -0
  588. wandb/vendor/pygments/console.py +74 -0
  589. wandb/vendor/pygments/filter.py +74 -0
  590. wandb/vendor/pygments/filters/__init__.py +350 -0
  591. wandb/vendor/pygments/formatter.py +95 -0
  592. wandb/vendor/pygments/formatters/__init__.py +153 -0
  593. wandb/vendor/pygments/formatters/_mapping.py +85 -0
  594. wandb/vendor/pygments/formatters/bbcode.py +109 -0
  595. wandb/vendor/pygments/formatters/html.py +851 -0
  596. wandb/vendor/pygments/formatters/img.py +600 -0
  597. wandb/vendor/pygments/formatters/irc.py +182 -0
  598. wandb/vendor/pygments/formatters/latex.py +482 -0
  599. wandb/vendor/pygments/formatters/other.py +160 -0
  600. wandb/vendor/pygments/formatters/rtf.py +147 -0
  601. wandb/vendor/pygments/formatters/svg.py +153 -0
  602. wandb/vendor/pygments/formatters/terminal.py +136 -0
  603. wandb/vendor/pygments/formatters/terminal256.py +309 -0
  604. wandb/vendor/pygments/lexer.py +871 -0
  605. wandb/vendor/pygments/lexers/__init__.py +329 -0
  606. wandb/vendor/pygments/lexers/_asy_builtins.py +1645 -0
  607. wandb/vendor/pygments/lexers/_cl_builtins.py +232 -0
  608. wandb/vendor/pygments/lexers/_cocoa_builtins.py +72 -0
  609. wandb/vendor/pygments/lexers/_csound_builtins.py +1346 -0
  610. wandb/vendor/pygments/lexers/_lasso_builtins.py +5327 -0
  611. wandb/vendor/pygments/lexers/_lua_builtins.py +295 -0
  612. wandb/vendor/pygments/lexers/_mapping.py +500 -0
  613. wandb/vendor/pygments/lexers/_mql_builtins.py +1172 -0
  614. wandb/vendor/pygments/lexers/_openedge_builtins.py +2547 -0
  615. wandb/vendor/pygments/lexers/_php_builtins.py +4756 -0
  616. wandb/vendor/pygments/lexers/_postgres_builtins.py +621 -0
  617. wandb/vendor/pygments/lexers/_scilab_builtins.py +3094 -0
  618. wandb/vendor/pygments/lexers/_sourcemod_builtins.py +1163 -0
  619. wandb/vendor/pygments/lexers/_stan_builtins.py +532 -0
  620. wandb/vendor/pygments/lexers/_stata_builtins.py +419 -0
  621. wandb/vendor/pygments/lexers/_tsql_builtins.py +1004 -0
  622. wandb/vendor/pygments/lexers/_vim_builtins.py +1939 -0
  623. wandb/vendor/pygments/lexers/actionscript.py +240 -0
  624. wandb/vendor/pygments/lexers/agile.py +24 -0
  625. wandb/vendor/pygments/lexers/algebra.py +221 -0
  626. wandb/vendor/pygments/lexers/ambient.py +76 -0
  627. wandb/vendor/pygments/lexers/ampl.py +87 -0
  628. wandb/vendor/pygments/lexers/apl.py +101 -0
  629. wandb/vendor/pygments/lexers/archetype.py +318 -0
  630. wandb/vendor/pygments/lexers/asm.py +641 -0
  631. wandb/vendor/pygments/lexers/automation.py +374 -0
  632. wandb/vendor/pygments/lexers/basic.py +500 -0
  633. wandb/vendor/pygments/lexers/bibtex.py +160 -0
  634. wandb/vendor/pygments/lexers/business.py +612 -0
  635. wandb/vendor/pygments/lexers/c_cpp.py +252 -0
  636. wandb/vendor/pygments/lexers/c_like.py +541 -0
  637. wandb/vendor/pygments/lexers/capnproto.py +78 -0
  638. wandb/vendor/pygments/lexers/chapel.py +102 -0
  639. wandb/vendor/pygments/lexers/clean.py +288 -0
  640. wandb/vendor/pygments/lexers/compiled.py +34 -0
  641. wandb/vendor/pygments/lexers/configs.py +833 -0
  642. wandb/vendor/pygments/lexers/console.py +114 -0
  643. wandb/vendor/pygments/lexers/crystal.py +393 -0
  644. wandb/vendor/pygments/lexers/csound.py +366 -0
  645. wandb/vendor/pygments/lexers/css.py +689 -0
  646. wandb/vendor/pygments/lexers/d.py +251 -0
  647. wandb/vendor/pygments/lexers/dalvik.py +125 -0
  648. wandb/vendor/pygments/lexers/data.py +555 -0
  649. wandb/vendor/pygments/lexers/diff.py +165 -0
  650. wandb/vendor/pygments/lexers/dotnet.py +691 -0
  651. wandb/vendor/pygments/lexers/dsls.py +878 -0
  652. wandb/vendor/pygments/lexers/dylan.py +289 -0
  653. wandb/vendor/pygments/lexers/ecl.py +125 -0
  654. wandb/vendor/pygments/lexers/eiffel.py +65 -0
  655. wandb/vendor/pygments/lexers/elm.py +121 -0
  656. wandb/vendor/pygments/lexers/erlang.py +533 -0
  657. wandb/vendor/pygments/lexers/esoteric.py +277 -0
  658. wandb/vendor/pygments/lexers/ezhil.py +69 -0
  659. wandb/vendor/pygments/lexers/factor.py +344 -0
  660. wandb/vendor/pygments/lexers/fantom.py +250 -0
  661. wandb/vendor/pygments/lexers/felix.py +273 -0
  662. wandb/vendor/pygments/lexers/forth.py +177 -0
  663. wandb/vendor/pygments/lexers/fortran.py +205 -0
  664. wandb/vendor/pygments/lexers/foxpro.py +428 -0
  665. wandb/vendor/pygments/lexers/functional.py +21 -0
  666. wandb/vendor/pygments/lexers/go.py +101 -0
  667. wandb/vendor/pygments/lexers/grammar_notation.py +213 -0
  668. wandb/vendor/pygments/lexers/graph.py +80 -0
  669. wandb/vendor/pygments/lexers/graphics.py +553 -0
  670. wandb/vendor/pygments/lexers/haskell.py +843 -0
  671. wandb/vendor/pygments/lexers/haxe.py +936 -0
  672. wandb/vendor/pygments/lexers/hdl.py +382 -0
  673. wandb/vendor/pygments/lexers/hexdump.py +103 -0
  674. wandb/vendor/pygments/lexers/html.py +602 -0
  675. wandb/vendor/pygments/lexers/idl.py +270 -0
  676. wandb/vendor/pygments/lexers/igor.py +288 -0
  677. wandb/vendor/pygments/lexers/inferno.py +96 -0
  678. wandb/vendor/pygments/lexers/installers.py +322 -0
  679. wandb/vendor/pygments/lexers/int_fiction.py +1343 -0
  680. wandb/vendor/pygments/lexers/iolang.py +63 -0
  681. wandb/vendor/pygments/lexers/j.py +146 -0
  682. wandb/vendor/pygments/lexers/javascript.py +1525 -0
  683. wandb/vendor/pygments/lexers/julia.py +333 -0
  684. wandb/vendor/pygments/lexers/jvm.py +1573 -0
  685. wandb/vendor/pygments/lexers/lisp.py +2621 -0
  686. wandb/vendor/pygments/lexers/make.py +202 -0
  687. wandb/vendor/pygments/lexers/markup.py +595 -0
  688. wandb/vendor/pygments/lexers/math.py +21 -0
  689. wandb/vendor/pygments/lexers/matlab.py +663 -0
  690. wandb/vendor/pygments/lexers/ml.py +769 -0
  691. wandb/vendor/pygments/lexers/modeling.py +358 -0
  692. wandb/vendor/pygments/lexers/modula2.py +1561 -0
  693. wandb/vendor/pygments/lexers/monte.py +204 -0
  694. wandb/vendor/pygments/lexers/ncl.py +894 -0
  695. wandb/vendor/pygments/lexers/nimrod.py +159 -0
  696. wandb/vendor/pygments/lexers/nit.py +64 -0
  697. wandb/vendor/pygments/lexers/nix.py +136 -0
  698. wandb/vendor/pygments/lexers/oberon.py +105 -0
  699. wandb/vendor/pygments/lexers/objective.py +504 -0
  700. wandb/vendor/pygments/lexers/ooc.py +85 -0
  701. wandb/vendor/pygments/lexers/other.py +41 -0
  702. wandb/vendor/pygments/lexers/parasail.py +79 -0
  703. wandb/vendor/pygments/lexers/parsers.py +835 -0
  704. wandb/vendor/pygments/lexers/pascal.py +644 -0
  705. wandb/vendor/pygments/lexers/pawn.py +199 -0
  706. wandb/vendor/pygments/lexers/perl.py +620 -0
  707. wandb/vendor/pygments/lexers/php.py +267 -0
  708. wandb/vendor/pygments/lexers/praat.py +294 -0
  709. wandb/vendor/pygments/lexers/prolog.py +306 -0
  710. wandb/vendor/pygments/lexers/python.py +939 -0
  711. wandb/vendor/pygments/lexers/qvt.py +152 -0
  712. wandb/vendor/pygments/lexers/r.py +453 -0
  713. wandb/vendor/pygments/lexers/rdf.py +270 -0
  714. wandb/vendor/pygments/lexers/rebol.py +431 -0
  715. wandb/vendor/pygments/lexers/resource.py +85 -0
  716. wandb/vendor/pygments/lexers/rnc.py +67 -0
  717. wandb/vendor/pygments/lexers/roboconf.py +82 -0
  718. wandb/vendor/pygments/lexers/robotframework.py +560 -0
  719. wandb/vendor/pygments/lexers/ruby.py +519 -0
  720. wandb/vendor/pygments/lexers/rust.py +220 -0
  721. wandb/vendor/pygments/lexers/sas.py +228 -0
  722. wandb/vendor/pygments/lexers/scripting.py +1222 -0
  723. wandb/vendor/pygments/lexers/shell.py +794 -0
  724. wandb/vendor/pygments/lexers/smalltalk.py +195 -0
  725. wandb/vendor/pygments/lexers/smv.py +79 -0
  726. wandb/vendor/pygments/lexers/snobol.py +83 -0
  727. wandb/vendor/pygments/lexers/special.py +103 -0
  728. wandb/vendor/pygments/lexers/sql.py +681 -0
  729. wandb/vendor/pygments/lexers/stata.py +108 -0
  730. wandb/vendor/pygments/lexers/supercollider.py +90 -0
  731. wandb/vendor/pygments/lexers/tcl.py +145 -0
  732. wandb/vendor/pygments/lexers/templates.py +2283 -0
  733. wandb/vendor/pygments/lexers/testing.py +207 -0
  734. wandb/vendor/pygments/lexers/text.py +25 -0
  735. wandb/vendor/pygments/lexers/textedit.py +169 -0
  736. wandb/vendor/pygments/lexers/textfmts.py +297 -0
  737. wandb/vendor/pygments/lexers/theorem.py +458 -0
  738. wandb/vendor/pygments/lexers/trafficscript.py +54 -0
  739. wandb/vendor/pygments/lexers/typoscript.py +226 -0
  740. wandb/vendor/pygments/lexers/urbi.py +133 -0
  741. wandb/vendor/pygments/lexers/varnish.py +190 -0
  742. wandb/vendor/pygments/lexers/verification.py +111 -0
  743. wandb/vendor/pygments/lexers/web.py +24 -0
  744. wandb/vendor/pygments/lexers/webmisc.py +988 -0
  745. wandb/vendor/pygments/lexers/whiley.py +116 -0
  746. wandb/vendor/pygments/lexers/x10.py +69 -0
  747. wandb/vendor/pygments/modeline.py +44 -0
  748. wandb/vendor/pygments/plugin.py +68 -0
  749. wandb/vendor/pygments/regexopt.py +92 -0
  750. wandb/vendor/pygments/scanner.py +105 -0
  751. wandb/vendor/pygments/sphinxext.py +158 -0
  752. wandb/vendor/pygments/style.py +155 -0
  753. wandb/vendor/pygments/styles/__init__.py +80 -0
  754. wandb/vendor/pygments/styles/abap.py +29 -0
  755. wandb/vendor/pygments/styles/algol.py +63 -0
  756. wandb/vendor/pygments/styles/algol_nu.py +63 -0
  757. wandb/vendor/pygments/styles/arduino.py +98 -0
  758. wandb/vendor/pygments/styles/autumn.py +65 -0
  759. wandb/vendor/pygments/styles/borland.py +51 -0
  760. wandb/vendor/pygments/styles/bw.py +49 -0
  761. wandb/vendor/pygments/styles/colorful.py +81 -0
  762. wandb/vendor/pygments/styles/default.py +73 -0
  763. wandb/vendor/pygments/styles/emacs.py +72 -0
  764. wandb/vendor/pygments/styles/friendly.py +72 -0
  765. wandb/vendor/pygments/styles/fruity.py +42 -0
  766. wandb/vendor/pygments/styles/igor.py +29 -0
  767. wandb/vendor/pygments/styles/lovelace.py +97 -0
  768. wandb/vendor/pygments/styles/manni.py +75 -0
  769. wandb/vendor/pygments/styles/monokai.py +106 -0
  770. wandb/vendor/pygments/styles/murphy.py +80 -0
  771. wandb/vendor/pygments/styles/native.py +65 -0
  772. wandb/vendor/pygments/styles/paraiso_dark.py +125 -0
  773. wandb/vendor/pygments/styles/paraiso_light.py +125 -0
  774. wandb/vendor/pygments/styles/pastie.py +75 -0
  775. wandb/vendor/pygments/styles/perldoc.py +69 -0
  776. wandb/vendor/pygments/styles/rainbow_dash.py +89 -0
  777. wandb/vendor/pygments/styles/rrt.py +33 -0
  778. wandb/vendor/pygments/styles/sas.py +44 -0
  779. wandb/vendor/pygments/styles/stata.py +40 -0
  780. wandb/vendor/pygments/styles/tango.py +141 -0
  781. wandb/vendor/pygments/styles/trac.py +63 -0
  782. wandb/vendor/pygments/styles/vim.py +63 -0
  783. wandb/vendor/pygments/styles/vs.py +38 -0
  784. wandb/vendor/pygments/styles/xcode.py +51 -0
  785. wandb/vendor/pygments/token.py +213 -0
  786. wandb/vendor/pygments/unistring.py +217 -0
  787. wandb/vendor/pygments/util.py +388 -0
  788. wandb/vendor/pynvml/__init__.py +0 -0
  789. wandb/vendor/pynvml/pynvml.py +4779 -0
  790. wandb/vendor/watchdog_0_9_0/wandb_watchdog/__init__.py +17 -0
  791. wandb/vendor/watchdog_0_9_0/wandb_watchdog/events.py +615 -0
  792. wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/__init__.py +98 -0
  793. wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/api.py +369 -0
  794. wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/fsevents.py +172 -0
  795. wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/fsevents2.py +239 -0
  796. wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify.py +218 -0
  797. wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_buffer.py +81 -0
  798. wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_c.py +575 -0
  799. wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py +730 -0
  800. wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/polling.py +145 -0
  801. wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/read_directory_changes.py +133 -0
  802. wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/winapi.py +348 -0
  803. wandb/vendor/watchdog_0_9_0/wandb_watchdog/patterns.py +265 -0
  804. wandb/vendor/watchdog_0_9_0/wandb_watchdog/tricks/__init__.py +174 -0
  805. wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/__init__.py +151 -0
  806. wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/bricks.py +249 -0
  807. wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/compat.py +29 -0
  808. wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/decorators.py +198 -0
  809. wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/delayed_queue.py +88 -0
  810. wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/dirsnapshot.py +293 -0
  811. wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/echo.py +157 -0
  812. wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/event_backport.py +41 -0
  813. wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/importlib2.py +40 -0
  814. wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/platform.py +57 -0
  815. wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/unicode_paths.py +64 -0
  816. wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/win32stat.py +123 -0
  817. wandb/vendor/watchdog_0_9_0/wandb_watchdog/version.py +28 -0
  818. wandb/vendor/watchdog_0_9_0/wandb_watchdog/watchmedo.py +577 -0
  819. wandb/wandb_agent.py +588 -0
  820. wandb/wandb_controller.py +721 -0
  821. wandb/wandb_run.py +9 -0
  822. wandb-0.18.1.dist-info/METADATA +212 -0
  823. wandb-0.18.1.dist-info/RECORD +826 -0
  824. wandb-0.18.1.dist-info/WHEEL +4 -0
  825. wandb-0.18.1.dist-info/entry_points.txt +3 -0
  826. wandb-0.18.1.dist-info/licenses/LICENSE +21 -0
wandb/__init__.pyi ADDED
@@ -0,0 +1,1084 @@
1
+ """Use wandb to track machine learning work.
2
+
3
+ Train and fine-tune models, manage models from experimentation to production.
4
+
5
+ For guides and examples, see https://docs.wandb.ai.
6
+
7
+ For scripts and interactive notebooks, see https://github.com/wandb/examples.
8
+
9
+ For reference documentation, see https://docs.wandb.com/ref/python.
10
+ """
11
+
12
+ __all__ = (
13
+ "__version__",
14
+ "init",
15
+ "finish",
16
+ "setup",
17
+ "login",
18
+ "save",
19
+ "sweep",
20
+ "controller",
21
+ "agent",
22
+ "config",
23
+ "log",
24
+ "summary",
25
+ "Api",
26
+ "Graph",
27
+ "Image",
28
+ "Plotly",
29
+ "Video",
30
+ "Audio",
31
+ "Table",
32
+ "Html",
33
+ "box3d",
34
+ "Object3D",
35
+ "Molecule",
36
+ "Histogram",
37
+ "ArtifactTTL",
38
+ "log_artifact",
39
+ "use_artifact",
40
+ "log_model",
41
+ "use_model",
42
+ "link_model",
43
+ "define_metric",
44
+ "Error",
45
+ "termsetup",
46
+ "termlog",
47
+ "termerror",
48
+ "termwarn",
49
+ "Artifact",
50
+ "Settings",
51
+ "teardown",
52
+ )
53
+
54
+ import os
55
+ from typing import Any, Callable, Dict, List, Literal, Optional, Sequence, Union
56
+
57
+ from wandb.analytics import Sentry as _Sentry
58
+ from wandb.apis import InternalApi, PublicApi
59
+ from wandb.data_types import (
60
+ Audio,
61
+ Graph,
62
+ Histogram,
63
+ Html,
64
+ Image,
65
+ Molecule,
66
+ Object3D,
67
+ Plotly,
68
+ Table,
69
+ Video,
70
+ box3d,
71
+ )
72
+ from wandb.errors import Error
73
+ from wandb.errors.term import termerror, termlog, termsetup, termwarn
74
+ from wandb.sdk import Artifact, Settings, wandb_config, wandb_metric, wandb_summary
75
+ from wandb.sdk.artifacts.artifact_ttl import ArtifactTTL
76
+ from wandb.sdk.interface.interface import PolicyName
77
+ from wandb.sdk.lib.paths import FilePathStr, StrPath
78
+ from wandb.sdk.wandb_run import Run
79
+ from wandb.sdk.wandb_setup import _WandbSetup
80
+ from wandb.wandb_controller import _WandbController
81
+
82
+ __version__: str = "0.18.1"
83
+
84
+ run: Optional[Run] = None
85
+ config = wandb_config.Config
86
+ summary = wandb_summary.Summary
87
+ Api = PublicApi
88
+ api = InternalApi()
89
+ _sentry = _Sentry()
90
+
91
+ # record of patched libraries
92
+ patched = {"tensorboard": [], "keras": [], "gym": []} # type: ignore
93
+
94
+ def setup(
95
+ settings: Optional[Settings] = None,
96
+ ) -> Optional[_WandbSetup]:
97
+ """Prepares W&B for use in the current process and its children.
98
+
99
+ You can usually ignore this as it is implicitly called by `wandb.init()`.
100
+
101
+ When using wandb in multiple processes, calling `wandb.setup()`
102
+ in the parent process before starting child processes may improve
103
+ performance and resource utilization.
104
+
105
+ Note that `wandb.setup()` modifies `os.environ`, and it is important
106
+ that child processes inherit the modified environment variables.
107
+
108
+ See also `wandb.teardown()`.
109
+
110
+ Args:
111
+ settings (Optional[Union[Dict[str, Any], wandb.Settings]]): Configuration settings
112
+ to apply globally. These can be overridden by subsequent `wandb.init()` calls.
113
+
114
+ Example:
115
+ ```python
116
+ import multiprocessing
117
+
118
+ import wandb
119
+
120
+
121
+ def run_experiment(params):
122
+ with wandb.init(config=params):
123
+ # Run experiment
124
+ pass
125
+
126
+
127
+ if __name__ == "__main__":
128
+ # Start backend and set global config
129
+ wandb.setup(settings={"project": "my_project"})
130
+
131
+ # Define experiment parameters
132
+ experiment_params = [
133
+ {"learning_rate": 0.01, "epochs": 10},
134
+ {"learning_rate": 0.001, "epochs": 20},
135
+ ]
136
+
137
+ # Start multiple processes, each running a separate experiment
138
+ processes = []
139
+ for params in experiment_params:
140
+ p = multiprocessing.Process(target=run_experiment, args=(params,))
141
+ p.start()
142
+ processes.append(p)
143
+
144
+ # Wait for all processes to complete
145
+ for p in processes:
146
+ p.join()
147
+
148
+ # Optional: Explicitly shut down the backend
149
+ wandb.teardown()
150
+ ```
151
+ """
152
+ ...
153
+
154
+ def teardown(exit_code: Optional[int] = None) -> None:
155
+ """Waits for wandb to finish and frees resources.
156
+
157
+ Completes any runs that were not explicitly finished
158
+ using `run.finish()` and waits for all data to be uploaded.
159
+
160
+ It is recommended to call this at the end of a session
161
+ that used `wandb.setup()`. It is invoked automatically
162
+ in an `atexit` hook, but this is not reliable in certain setups
163
+ such as when using Python's `multiprocessing` module.
164
+ """
165
+ ...
166
+
167
+ def init(
168
+ job_type: Optional[str] = None,
169
+ dir: Optional[StrPath] = None,
170
+ config: Union[Dict, str, None] = None,
171
+ project: Optional[str] = None,
172
+ entity: Optional[str] = None,
173
+ reinit: Optional[bool] = None,
174
+ tags: Optional[Sequence] = None,
175
+ group: Optional[str] = None,
176
+ name: Optional[str] = None,
177
+ notes: Optional[str] = None,
178
+ magic: Optional[Union[dict, str, bool]] = None,
179
+ config_exclude_keys: Optional[List[str]] = None,
180
+ config_include_keys: Optional[List[str]] = None,
181
+ anonymous: Optional[str] = None,
182
+ mode: Optional[str] = None,
183
+ allow_val_change: Optional[bool] = None,
184
+ resume: Optional[Union[bool, str]] = None,
185
+ force: Optional[bool] = None,
186
+ tensorboard: Optional[bool] = None, # alias for sync_tensorboard
187
+ sync_tensorboard: Optional[bool] = None,
188
+ monitor_gym: Optional[bool] = None,
189
+ save_code: Optional[bool] = None,
190
+ id: Optional[str] = None,
191
+ fork_from: Optional[str] = None,
192
+ resume_from: Optional[str] = None,
193
+ settings: Union[Settings, Dict[str, Any], None] = None,
194
+ ) -> Run:
195
+ r"""Start a new run to track and log to W&B.
196
+
197
+ In an ML training pipeline, you could add `wandb.init()`
198
+ to the beginning of your training script as well as your evaluation
199
+ script, and each piece would be tracked as a run in W&B.
200
+
201
+ `wandb.init()` spawns a new background process to log data to a run, and it
202
+ also syncs data to wandb.ai by default, so you can see live visualizations.
203
+
204
+ Call `wandb.init()` to start a run before logging data with `wandb.log()`:
205
+ <!--yeadoc-test:init-method-log-->
206
+ ```python
207
+ import wandb
208
+
209
+ wandb.init()
210
+ # ... calculate metrics, generate media
211
+ wandb.log({"accuracy": 0.9})
212
+ ```
213
+
214
+ `wandb.init()` returns a run object, and you can also access the run object
215
+ via `wandb.run`:
216
+ <!--yeadoc-test:init-and-assert-global-->
217
+ ```python
218
+ import wandb
219
+
220
+ run = wandb.init()
221
+
222
+ assert run is wandb.run
223
+ ```
224
+
225
+ At the end of your script, we will automatically call `wandb.finish` to
226
+ finalize and cleanup the run. However, if you call `wandb.init` from a
227
+ child process, you must explicitly call `wandb.finish` at the end of the
228
+ child process.
229
+
230
+ For more on using `wandb.init()`, including detailed examples, check out our
231
+ [guide and FAQs](https://docs.wandb.ai/guides/track/launch).
232
+
233
+ Arguments:
234
+ project: (str, optional) The name of the project where you're sending
235
+ the new run. If the project is not specified, we will try to infer
236
+ the project name from git root or the current program file. If we
237
+ can't infer the project name, we will default to `"uncategorized"`.
238
+ entity: (str, optional) An entity is a username or team name where
239
+ you're sending runs. This entity must exist before you can send runs
240
+ there, so make sure to create your account or team in the UI before
241
+ starting to log runs.
242
+ If you don't specify an entity, the run will be sent to your default
243
+ entity. Change your default entity
244
+ in [your settings](https://wandb.ai/settings) under "default location
245
+ to create new projects".
246
+ config: (dict, argparse, absl.flags, str, optional)
247
+ This sets `wandb.config`, a dictionary-like object for saving inputs
248
+ to your job, like hyperparameters for a model or settings for a data
249
+ preprocessing job. The config will show up in a table in the UI that
250
+ you can use to group, filter, and sort runs. Keys should not contain
251
+ `.` in their names, and values should be under 10 MB.
252
+ If dict, argparse or absl.flags: will load the key value pairs into
253
+ the `wandb.config` object.
254
+ If str: will look for a yaml file by that name, and load config from
255
+ that file into the `wandb.config` object.
256
+ save_code: (bool, optional) Turn this on to save the main script or
257
+ notebook to W&B. This is valuable for improving experiment
258
+ reproducibility and to diff code across experiments in the UI. By
259
+ default this is off, but you can flip the default behavior to on
260
+ in [your settings page](https://wandb.ai/settings).
261
+ group: (str, optional) Specify a group to organize individual runs into
262
+ a larger experiment. For example, you might be doing cross
263
+ validation, or you might have multiple jobs that train and evaluate
264
+ a model against different test sets. Group gives you a way to
265
+ organize runs together into a larger whole, and you can toggle this
266
+ on and off in the UI. For more details, see our
267
+ [guide to grouping runs](https://docs.wandb.com/guides/runs/grouping).
268
+ job_type: (str, optional) Specify the type of run, which is useful when
269
+ you're grouping runs together into larger experiments using group.
270
+ For example, you might have multiple jobs in a group, with job types
271
+ like train and eval. Setting this makes it easy to filter and group
272
+ similar runs together in the UI so you can compare apples to apples.
273
+ tags: (list, optional) A list of strings, which will populate the list
274
+ of tags on this run in the UI. Tags are useful for organizing runs
275
+ together, or applying temporary labels like "baseline" or
276
+ "production". It's easy to add and remove tags in the UI, or filter
277
+ down to just runs with a specific tag.
278
+ If you are resuming a run, its tags will be overwritten by the tags
279
+ you pass to `wandb.init()`. If you want to add tags to a resumed run
280
+ without overwriting its existing tags, use `run.tags += ["new_tag"]`
281
+ after `wandb.init()`.
282
+ name: (str, optional) A short display name for this run, which is how
283
+ you'll identify this run in the UI. By default, we generate a random
284
+ two-word name that lets you easily cross-reference runs from the
285
+ table to charts. Keeping these run names short makes the chart
286
+ legends and tables easier to read. If you're looking for a place to
287
+ save your hyperparameters, we recommend saving those in config.
288
+ notes: (str, optional) A longer description of the run, like a `-m` commit
289
+ message in git. This helps you remember what you were doing when you
290
+ ran this run.
291
+ dir: (str or pathlib.Path, optional) An absolute path to a directory where
292
+ metadata will be stored. When you call `download()` on an artifact,
293
+ this is the directory where downloaded files will be saved. By default,
294
+ this is the `./wandb` directory.
295
+ resume: (bool, str, optional) Sets the resuming behavior. Options:
296
+ `"allow"`, `"must"`, `"never"`, `"auto"` or `None`. Defaults to `None`.
297
+ Cases:
298
+ - `None` (default): If the new run has the same ID as a previous run,
299
+ this run overwrites that data.
300
+ - `"auto"` (or `True`): if the previous run on this machine crashed,
301
+ automatically resume it. Otherwise, start a new run.
302
+ - `"allow"`: if id is set with `init(id="UNIQUE_ID")` or
303
+ `WANDB_RUN_ID="UNIQUE_ID"` and it is identical to a previous run,
304
+ wandb will automatically resume the run with that id. Otherwise,
305
+ wandb will start a new run.
306
+ - `"never"`: if id is set with `init(id="UNIQUE_ID")` or
307
+ `WANDB_RUN_ID="UNIQUE_ID"` and it is identical to a previous run,
308
+ wandb will crash.
309
+ - `"must"`: if id is set with `init(id="UNIQUE_ID")` or
310
+ `WANDB_RUN_ID="UNIQUE_ID"` and it is identical to a previous run,
311
+ wandb will automatically resume the run with the id. Otherwise,
312
+ wandb will crash.
313
+ See [our guide to resuming runs](https://docs.wandb.com/guides/runs/resuming)
314
+ for more.
315
+ reinit: (bool, optional) Allow multiple `wandb.init()` calls in the same
316
+ process. (default: `False`)
317
+ magic: (bool, dict, or str, optional) The bool controls whether we try to
318
+ auto-instrument your script, capturing basic details of your run
319
+ without you having to add more wandb code. (default: `False`)
320
+ You can also pass a dict, json string, or yaml filename.
321
+ config_exclude_keys: (list, optional) string keys to exclude from
322
+ `wandb.config`.
323
+ config_include_keys: (list, optional) string keys to include in
324
+ `wandb.config`.
325
+ anonymous: (str, optional) Controls anonymous data logging. Options:
326
+ - `"never"` (default): requires you to link your W&B account before
327
+ tracking the run, so you don't accidentally create an anonymous
328
+ run.
329
+ - `"allow"`: lets a logged-in user track runs with their account, but
330
+ lets someone who is running the script without a W&B account see
331
+ the charts in the UI.
332
+ - `"must"`: sends the run to an anonymous account instead of to a
333
+ signed-up user account.
334
+ mode: (str, optional) Can be `"online"`, `"offline"` or `"disabled"`. Defaults to
335
+ online.
336
+ allow_val_change: (bool, optional) Whether to allow config values to
337
+ change after setting the keys once. By default, we throw an exception
338
+ if a config value is overwritten. If you want to track something
339
+ like a varying learning rate at multiple times during training, use
340
+ `wandb.log()` instead. (default: `False` in scripts, `True` in Jupyter)
341
+ force: (bool, optional) If `True`, this crashes the script if a user isn't
342
+ logged in to W&B. If `False`, this will let the script run in offline
343
+ mode if a user isn't logged in to W&B. (default: `False`)
344
+ sync_tensorboard: (bool, optional) Synchronize wandb logs from tensorboard or
345
+ tensorboardX and save the relevant events file. (default: `False`)
346
+ tensorboard: (bool, optional) Alias for `sync_tensorboard`, deprecated.
347
+ monitor_gym: (bool, optional) Automatically log videos of environment when
348
+ using OpenAI Gym. (default: `False`)
349
+ See [our guide to this integration](https://docs.wandb.com/guides/integrations/openai-gym).
350
+ id: (str, optional) A unique ID for this run, used for resuming. It must
351
+ be unique in the project, and if you delete a run you can't reuse
352
+ the ID. Use the `name` field for a short descriptive name, or `config`
353
+ for saving hyperparameters to compare across runs. The ID cannot
354
+ contain the following special characters: `/\#?%:`.
355
+ See [our guide to resuming runs](https://docs.wandb.com/guides/runs/resuming).
356
+ fork_from: (str, optional) A string with the format {run_id}?_step={step} describing
357
+ a moment in a previous run to fork a new run from. Creates a new run that picks up
358
+ logging history from the specified run at the specified moment. The target run must
359
+ be in the current project. Example: `fork_from="my-run-id?_step=1234"`.
360
+ resume_from: (str, optional) A string with the format {run_id}?_step={step} describing
361
+ a moment in a previous run to resume a run from. This allows users to truncate
362
+ the history logged to a run at an intermediate step and resume logging from that step.
363
+ It uses run forking under the hood. The target run must be in the
364
+ current project. Example: `resume_from="my-run-id?_step=1234"`.
365
+ settings: (dict, wandb.Settings, optional) Settings to use for this run. (default: None)
366
+
367
+ Examples:
368
+ ### Set where the run is logged
369
+
370
+ You can change where the run is logged, just like changing
371
+ the organization, repository, and branch in git:
372
+ ```python
373
+ import wandb
374
+
375
+ user = "geoff"
376
+ project = "capsules"
377
+ display_name = "experiment-2021-10-31"
378
+
379
+ wandb.init(entity=user, project=project, name=display_name)
380
+ ```
381
+
382
+ ### Add metadata about the run to the config
383
+
384
+ Pass a dictionary-style object as the `config` keyword argument to add
385
+ metadata, like hyperparameters, to your run.
386
+ <!--yeadoc-test:init-set-config-->
387
+ ```python
388
+ import wandb
389
+
390
+ config = {"lr": 3e-4, "batch_size": 32}
391
+ config.update({"architecture": "resnet", "depth": 34})
392
+ wandb.init(config=config)
393
+ ```
394
+
395
+ Raises:
396
+ Error: if some unknown or internal error happened during the run initialization.
397
+ AuthenticationError: if the user failed to provide valid credentials.
398
+ CommError: if there was a problem communicating with the WandB server.
399
+ UsageError: if the user provided invalid arguments.
400
+ KeyboardInterrupt: if user interrupts the run.
401
+
402
+ Returns:
403
+ A `Run` object.
404
+ """
405
+ ...
406
+
407
+ def finish(exit_code: Optional[int] = None, quiet: Optional[bool] = None) -> None:
408
+ """Mark a run as finished, and finish uploading all data.
409
+
410
+ This is used when creating multiple runs in the same process.
411
+ We automatically call this method when your script exits.
412
+
413
+ Arguments:
414
+ exit_code: Set to something other than 0 to mark a run as failed
415
+ quiet: Set to true to minimize log output
416
+ """
417
+ ...
418
+
419
+ def login(
420
+ anonymous: Optional[Literal["must", "allow", "never"]] = None,
421
+ key: Optional[str] = None,
422
+ relogin: Optional[bool] = None,
423
+ host: Optional[str] = None,
424
+ force: Optional[bool] = None,
425
+ timeout: Optional[int] = None,
426
+ verify: bool = False,
427
+ ) -> bool:
428
+ """Set up W&B login credentials.
429
+
430
+ By default, this will only store credentials locally without
431
+ verifying them with the W&B server. To verify credentials, pass
432
+ `verify=True`.
433
+
434
+ Arguments:
435
+ anonymous: (string, optional) Can be "must", "allow", or "never".
436
+ If set to "must", always log a user in anonymously. If set to
437
+ "allow", only create an anonymous user if the user
438
+ isn't already logged in. If set to "never", never log a
439
+ user anonymously. Default set to "never".
440
+ key: (string, optional) The API key to use.
441
+ relogin: (bool, optional) If true, will re-prompt for API key.
442
+ host: (string, optional) The host to connect to.
443
+ force: (bool, optional) If true, will force a relogin.
444
+ timeout: (int, optional) Number of seconds to wait for user input.
445
+ verify: (bool) Verify the credentials with the W&B server.
446
+
447
+ Returns:
448
+ bool: if key is configured
449
+
450
+ Raises:
451
+ AuthenticationError - if api_key fails verification with the server
452
+ UsageError - if api_key cannot be configured and no tty
453
+ """
454
+ ...
455
+
456
+ def log(
457
+ data: Dict[str, Any],
458
+ step: Optional[int] = None,
459
+ commit: Optional[bool] = None,
460
+ sync: Optional[bool] = None,
461
+ ) -> None:
462
+ """Upload run data.
463
+
464
+ Use `log` to log data from runs, such as scalars, images, video,
465
+ histograms, plots, and tables.
466
+
467
+ See our [guides to logging](https://docs.wandb.ai/guides/track/log) for
468
+ live examples, code snippets, best practices, and more.
469
+
470
+ The most basic usage is `run.log({"train-loss": 0.5, "accuracy": 0.9})`.
471
+ This will save the loss and accuracy to the run's history and update
472
+ the summary values for these metrics.
473
+
474
+ Visualize logged data in the workspace at [wandb.ai](https://wandb.ai),
475
+ or locally on a [self-hosted instance](https://docs.wandb.ai/guides/hosting)
476
+ of the W&B app, or export data to visualize and explore locally, e.g. in
477
+ Jupyter notebooks, with [our API](https://docs.wandb.ai/guides/track/public-api-guide).
478
+
479
+ Logged values don't have to be scalars. Logging any wandb object is supported.
480
+ For example `run.log({"example": wandb.Image("myimage.jpg")})` will log an
481
+ example image which will be displayed nicely in the W&B UI.
482
+ See the [reference documentation](https://docs.wandb.com/ref/python/data-types)
483
+ for all of the different supported types or check out our
484
+ [guides to logging](https://docs.wandb.ai/guides/track/log) for examples,
485
+ from 3D molecular structures and segmentation masks to PR curves and histograms.
486
+ You can use `wandb.Table` to log structured data. See our
487
+ [guide to logging tables](https://docs.wandb.ai/guides/data-vis/log-tables)
488
+ for details.
489
+
490
+ The W&B UI organizes metrics with a forward slash (`/`) in their name
491
+ into sections named using the text before the final slash. For example,
492
+ the following results in two sections named "train" and "validate":
493
+
494
+ ```
495
+ run.log({
496
+ "train/accuracy": 0.9,
497
+ "train/loss": 30,
498
+ "validate/accuracy": 0.8,
499
+ "validate/loss": 20,
500
+ })
501
+ ```
502
+
503
+ Only one level of nesting is supported; `run.log({"a/b/c": 1})`
504
+ produces a section named "a/b".
505
+
506
+ `run.log` is not intended to be called more than a few times per second.
507
+ For optimal performance, limit your logging to once every N iterations,
508
+ or collect data over multiple iterations and log it in a single step.
509
+
510
+ ### The W&B step
511
+
512
+ With basic usage, each call to `log` creates a new "step".
513
+ The step must always increase, and it is not possible to log
514
+ to a previous step.
515
+
516
+ Note that you can use any metric as the X axis in charts.
517
+ In many cases, it is better to treat the W&B step like
518
+ you'd treat a timestamp rather than a training step.
519
+
520
+ ```
521
+ # Example: log an "epoch" metric for use as an X axis.
522
+ run.log({"epoch": 40, "train-loss": 0.5})
523
+ ```
524
+
525
+ See also [define_metric](https://docs.wandb.ai/ref/python/run#define_metric).
526
+
527
+ It is possible to use multiple `log` invocations to log to
528
+ the same step with the `step` and `commit` parameters.
529
+ The following are all equivalent:
530
+
531
+ ```
532
+ # Normal usage:
533
+ run.log({"train-loss": 0.5, "accuracy": 0.8})
534
+ run.log({"train-loss": 0.4, "accuracy": 0.9})
535
+
536
+ # Implicit step without auto-incrementing:
537
+ run.log({"train-loss": 0.5}, commit=False)
538
+ run.log({"accuracy": 0.8})
539
+ run.log({"train-loss": 0.4}, commit=False)
540
+ run.log({"accuracy": 0.9})
541
+
542
+ # Explicit step:
543
+ run.log({"train-loss": 0.5}, step=current_step)
544
+ run.log({"accuracy": 0.8}, step=current_step)
545
+ current_step += 1
546
+ run.log({"train-loss": 0.4}, step=current_step)
547
+ run.log({"accuracy": 0.9}, step=current_step)
548
+ ```
549
+
550
+ Arguments:
551
+ data: A `dict` with `str` keys and values that are serializable
552
+ Python objects including: `int`, `float` and `string`;
553
+ any of the `wandb.data_types`; lists, tuples and NumPy arrays
554
+ of serializable Python objects; other `dict`s of this
555
+ structure.
556
+ step: The step number to log. If `None`, then an implicit
557
+ auto-incrementing step is used. See the notes in
558
+ the description.
559
+ commit: If true, finalize and upload the step. If false, then
560
+ accumulate data for the step. See the notes in the description.
561
+ If `step` is `None`, then the default is `commit=True`;
562
+ otherwise, the default is `commit=False`.
563
+ sync: This argument is deprecated and does nothing.
564
+
565
+ Examples:
566
+ For more and more detailed examples, see
567
+ [our guides to logging](https://docs.wandb.com/guides/track/log).
568
+
569
+ ### Basic usage
570
+ <!--yeadoc-test:init-and-log-basic-->
571
+ ```python
572
+ import wandb
573
+
574
+ run = wandb.init()
575
+ run.log({"accuracy": 0.9, "epoch": 5})
576
+ ```
577
+
578
+ ### Incremental logging
579
+ <!--yeadoc-test:init-and-log-incremental-->
580
+ ```python
581
+ import wandb
582
+
583
+ run = wandb.init()
584
+ run.log({"loss": 0.2}, commit=False)
585
+ # Somewhere else when I'm ready to report this step:
586
+ run.log({"accuracy": 0.8})
587
+ ```
588
+
589
+ ### Histogram
590
+ <!--yeadoc-test:init-and-log-histogram-->
591
+ ```python
592
+ import numpy as np
593
+ import wandb
594
+
595
+ # sample gradients at random from normal distribution
596
+ gradients = np.random.randn(100, 100)
597
+ run = wandb.init()
598
+ run.log({"gradients": wandb.Histogram(gradients)})
599
+ ```
600
+
601
+ ### Image from numpy
602
+ <!--yeadoc-test:init-and-log-image-numpy-->
603
+ ```python
604
+ import numpy as np
605
+ import wandb
606
+
607
+ run = wandb.init()
608
+ examples = []
609
+ for i in range(3):
610
+ pixels = np.random.randint(low=0, high=256, size=(100, 100, 3))
611
+ image = wandb.Image(pixels, caption=f"random field {i}")
612
+ examples.append(image)
613
+ run.log({"examples": examples})
614
+ ```
615
+
616
+ ### Image from PIL
617
+ <!--yeadoc-test:init-and-log-image-pillow-->
618
+ ```python
619
+ import numpy as np
620
+ from PIL import Image as PILImage
621
+ import wandb
622
+
623
+ run = wandb.init()
624
+ examples = []
625
+ for i in range(3):
626
+ pixels = np.random.randint(low=0, high=256, size=(100, 100, 3), dtype=np.uint8)
627
+ pil_image = PILImage.fromarray(pixels, mode="RGB")
628
+ image = wandb.Image(pil_image, caption=f"random field {i}")
629
+ examples.append(image)
630
+ run.log({"examples": examples})
631
+ ```
632
+
633
+ ### Video from numpy
634
+ <!--yeadoc-test:init-and-log-video-numpy-->
635
+ ```python
636
+ import numpy as np
637
+ import wandb
638
+
639
+ run = wandb.init()
640
+ # axes are (time, channel, height, width)
641
+ frames = np.random.randint(low=0, high=256, size=(10, 3, 100, 100), dtype=np.uint8)
642
+ run.log({"video": wandb.Video(frames, fps=4)})
643
+ ```
644
+
645
+ ### Matplotlib Plot
646
+ <!--yeadoc-test:init-and-log-matplotlib-->
647
+ ```python
648
+ from matplotlib import pyplot as plt
649
+ import numpy as np
650
+ import wandb
651
+
652
+ run = wandb.init()
653
+ fig, ax = plt.subplots()
654
+ x = np.linspace(0, 10)
655
+ y = x * x
656
+ ax.plot(x, y) # plot y = x^2
657
+ run.log({"chart": fig})
658
+ ```
659
+
660
+ ### PR Curve
661
+ ```python
662
+ import wandb
663
+
664
+ run = wandb.init()
665
+ run.log({"pr": wandb.plot.pr_curve(y_test, y_probas, labels)})
666
+ ```
667
+
668
+ ### 3D Object
669
+ ```python
670
+ import wandb
671
+
672
+ run = wandb.init()
673
+ run.log(
674
+ {
675
+ "generated_samples": [
676
+ wandb.Object3D(open("sample.obj")),
677
+ wandb.Object3D(open("sample.gltf")),
678
+ wandb.Object3D(open("sample.glb")),
679
+ ]
680
+ }
681
+ )
682
+ ```
683
+
684
+ Raises:
685
+ wandb.Error: if called before `wandb.init`
686
+ ValueError: if invalid data is passed
687
+ """
688
+ ...
689
+
690
+ def save(
691
+ glob_str: Optional[Union[str, os.PathLike]] = None,
692
+ base_path: Optional[Union[str, os.PathLike]] = None,
693
+ policy: PolicyName = "live",
694
+ ) -> Union[bool, List[str]]:
695
+ """Sync one or more files to W&B.
696
+
697
+ Relative paths are relative to the current working directory.
698
+
699
+ A Unix glob, such as "myfiles/*", is expanded at the time `save` is
700
+ called regardless of the `policy`. In particular, new files are not
701
+ picked up automatically.
702
+
703
+ A `base_path` may be provided to control the directory structure of
704
+ uploaded files. It should be a prefix of `glob_str`, and the directory
705
+ structure beneath it is preserved. It's best understood through
706
+ examples:
707
+
708
+ ```
709
+ wandb.save("these/are/myfiles/*")
710
+ # => Saves files in a "these/are/myfiles/" folder in the run.
711
+
712
+ wandb.save("these/are/myfiles/*", base_path="these")
713
+ # => Saves files in an "are/myfiles/" folder in the run.
714
+
715
+ wandb.save("/User/username/Documents/run123/*.txt")
716
+ # => Saves files in a "run123/" folder in the run. See note below.
717
+
718
+ wandb.save("/User/username/Documents/run123/*.txt", base_path="/User")
719
+ # => Saves files in a "username/Documents/run123/" folder in the run.
720
+
721
+ wandb.save("files/*/saveme.txt")
722
+ # => Saves each "saveme.txt" file in an appropriate subdirectory
723
+ # of "files/".
724
+ ```
725
+
726
+ Note: when given an absolute path or glob and no `base_path`, one
727
+ directory level is preserved as in the example above.
728
+
729
+ Arguments:
730
+ glob_str: A relative or absolute path or Unix glob.
731
+ base_path: A path to use to infer a directory structure; see examples.
732
+ policy: One of `live`, `now`, or `end`.
733
+ * live: upload the file as it changes, overwriting the previous version
734
+ * now: upload the file once now
735
+ * end: upload file when the run ends
736
+
737
+ Returns:
738
+ Paths to the symlinks created for the matched files.
739
+
740
+ For historical reasons, this may return a boolean in legacy code.
741
+ """
742
+ ...
743
+
744
+ def sweep(
745
+ sweep: Union[dict, Callable],
746
+ entity: Optional[str] = None,
747
+ project: Optional[str] = None,
748
+ prior_runs: Optional[List[str]] = None,
749
+ ) -> str:
750
+ """Initialize a hyperparameter sweep.
751
+
752
+ Search for hyperparameters that optimizes a cost function
753
+ of a machine learning model by testing various combinations.
754
+
755
+ Make note the unique identifier, `sweep_id`, that is returned.
756
+ At a later step provide the `sweep_id` to a sweep agent.
757
+
758
+ Args:
759
+ sweep: The configuration of a hyperparameter search.
760
+ (or configuration generator). See
761
+ [Sweep configuration structure](https://docs.wandb.ai/guides/sweeps/define-sweep-configuration)
762
+ for information on how to define your sweep.
763
+ If you provide a callable, ensure that the callable does
764
+ not take arguments and that it returns a dictionary that
765
+ conforms to the W&B sweep config spec.
766
+ entity: The username or team name where you want to send W&B
767
+ runs created by the sweep to. Ensure that the entity you
768
+ specify already exists. If you don't specify an entity,
769
+ the run will be sent to your default entity,
770
+ which is usually your username.
771
+ project: The name of the project where W&B runs created from
772
+ the sweep are sent to. If the project is not specified, the
773
+ run is sent to a project labeled 'Uncategorized'.
774
+ prior_runs: The run IDs of existing runs to add to this sweep.
775
+
776
+ Returns:
777
+ sweep_id: str. A unique identifier for the sweep.
778
+ """
779
+ ...
780
+
781
+ def controller(
782
+ sweep_id_or_config: Optional[Union[str, Dict]] = None,
783
+ entity: Optional[str] = None,
784
+ project: Optional[str] = None,
785
+ ) -> _WandbController:
786
+ """Public sweep controller constructor.
787
+
788
+ Usage:
789
+ ```python
790
+ import wandb
791
+
792
+ tuner = wandb.controller(...)
793
+ print(tuner.sweep_config)
794
+ print(tuner.sweep_id)
795
+ tuner.configure_search(...)
796
+ tuner.configure_stopping(...)
797
+ ```
798
+ """
799
+ ...
800
+
801
+ def agent(
802
+ sweep_id: str,
803
+ function: Optional[Callable] = None,
804
+ entity: Optional[str] = None,
805
+ project: Optional[str] = None,
806
+ count: Optional[int] = None,
807
+ ) -> None:
808
+ """Start one or more sweep agents.
809
+
810
+ The sweep agent uses the `sweep_id` to know which sweep it
811
+ is a part of, what function to execute, and (optionally) how
812
+ many agents to run.
813
+
814
+ Arguments:
815
+ sweep_id: The unique identifier for a sweep. A sweep ID
816
+ is generated by W&B CLI or Python SDK.
817
+ function: A function to call instead of the "program"
818
+ specified in the sweep config.
819
+ entity: The username or team name where you want to send W&B
820
+ runs created by the sweep to. Ensure that the entity you
821
+ specify already exists. If you don't specify an entity,
822
+ the run will be sent to your default entity,
823
+ which is usually your username.
824
+ project: The name of the project where W&B runs created from
825
+ the sweep are sent to. If the project is not specified, the
826
+ run is sent to a project labeled "Uncategorized".
827
+ count: The number of sweep config trials to try.
828
+ """
829
+ ...
830
+
831
+ def define_metric(
832
+ name: str,
833
+ step_metric: Union[str, wandb_metric.Metric, None] = None,
834
+ step_sync: Optional[bool] = None,
835
+ hidden: Optional[bool] = None,
836
+ summary: Optional[str] = None,
837
+ goal: Optional[str] = None,
838
+ overwrite: Optional[bool] = None,
839
+ ) -> wandb_metric.Metric:
840
+ """Customize metrics logged with `wandb.log()`.
841
+
842
+ Arguments:
843
+ name: The name of the metric to customize.
844
+ step_metric: The name of another metric to serve as the X-axis
845
+ for this metric in automatically generated charts.
846
+ step_sync: Automatically insert the last value of step_metric into
847
+ `run.log()` if it is not provided explicitly. Defaults to True
848
+ if step_metric is specified.
849
+ hidden: Hide this metric from automatic plots.
850
+ summary: Specify aggregate metrics added to summary.
851
+ Supported aggregations include "min", "max", "mean", "last",
852
+ "best", "copy" and "none". "best" is used together with the
853
+ goal parameter. "none" prevents a summary from being generated.
854
+ "copy" is deprecated and should not be used.
855
+ goal: Specify how to interpret the "best" summary type.
856
+ Supported options are "minimize" and "maximize".
857
+ overwrite: If false, then this call is merged with previous
858
+ `define_metric` calls for the same metric by using their
859
+ values for any unspecified parameters. If true, then
860
+ unspecified parameters overwrite values specified by
861
+ previous calls.
862
+
863
+ Returns:
864
+ An object that represents this call but can otherwise be discarded.
865
+ """
866
+ ...
867
+
868
+ def log_artifact(
869
+ artifact_or_path: Union[Artifact, StrPath],
870
+ name: Optional[str] = None,
871
+ type: Optional[str] = None,
872
+ aliases: Optional[List[str]] = None,
873
+ tags: Optional[List[str]] = None,
874
+ ) -> Artifact:
875
+ """Declare an artifact as an output of a run.
876
+
877
+ Arguments:
878
+ artifact_or_path: (str or Artifact) A path to the contents of this artifact,
879
+ can be in the following forms:
880
+ - `/local/directory`
881
+ - `/local/directory/file.txt`
882
+ - `s3://bucket/path`
883
+ You can also pass an Artifact object created by calling
884
+ `wandb.Artifact`.
885
+ name: (str, optional) An artifact name. Valid names can be in the following forms:
886
+ - name:version
887
+ - name:alias
888
+ - digest
889
+ This will default to the basename of the path prepended with the current
890
+ run id if not specified.
891
+ type: (str) The type of artifact to log, examples include `dataset`, `model`
892
+ aliases: (list, optional) Aliases to apply to this artifact,
893
+ defaults to `["latest"]`
894
+ tags: (list, optional) Tags to apply to this artifact, if any.
895
+
896
+ Returns:
897
+ An `Artifact` object.
898
+ """
899
+ ...
900
+
901
+ def use_artifact(
902
+ artifact_or_name: Union[str, Artifact],
903
+ type: Optional[str] = None,
904
+ aliases: Optional[List[str]] = None,
905
+ use_as: Optional[str] = None,
906
+ ) -> Artifact:
907
+ """Declare an artifact as an input to a run.
908
+
909
+ Call `download` or `file` on the returned object to get the contents locally.
910
+
911
+ Arguments:
912
+ artifact_or_name: (str or Artifact) An artifact name.
913
+ May be prefixed with entity/project/. Valid names
914
+ can be in the following forms:
915
+ - name:version
916
+ - name:alias
917
+ You can also pass an Artifact object created by calling `wandb.Artifact`
918
+ type: (str, optional) The type of artifact to use.
919
+ aliases: (list, optional) Aliases to apply to this artifact
920
+ use_as: (string, optional) Optional string indicating what purpose the artifact was used with.
921
+ Will be shown in UI.
922
+
923
+ Returns:
924
+ An `Artifact` object.
925
+ """
926
+ ...
927
+
928
+ def log_model(
929
+ path: StrPath,
930
+ name: Optional[str] = None,
931
+ aliases: Optional[List[str]] = None,
932
+ ) -> None:
933
+ """Logs a model artifact containing the contents inside the 'path' to a run and marks it as an output to this run.
934
+
935
+ Arguments:
936
+ path: (str) A path to the contents of this model,
937
+ can be in the following forms:
938
+ - `/local/directory`
939
+ - `/local/directory/file.txt`
940
+ - `s3://bucket/path`
941
+ name: (str, optional) A name to assign to the model artifact that the file contents will be added to.
942
+ The string must contain only the following alphanumeric characters: dashes, underscores, and dots.
943
+ This will default to the basename of the path prepended with the current
944
+ run id if not specified.
945
+ aliases: (list, optional) Aliases to apply to the created model artifact,
946
+ defaults to `["latest"]`
947
+
948
+ Examples:
949
+ ```python
950
+ run.log_model(
951
+ path="/local/directory",
952
+ name="my_model_artifact",
953
+ aliases=["production"],
954
+ )
955
+ ```
956
+
957
+ Invalid usage
958
+ ```python
959
+ run.log_model(
960
+ path="/local/directory",
961
+ name="my_entity/my_project/my_model_artifact",
962
+ aliases=["production"],
963
+ )
964
+ ```
965
+
966
+ Raises:
967
+ ValueError: if name has invalid special characters
968
+
969
+ Returns:
970
+ None
971
+ """
972
+ ...
973
+
974
+ def use_model(name: str) -> FilePathStr:
975
+ """Download the files logged in a model artifact 'name'.
976
+
977
+ Arguments:
978
+ name: (str) A model artifact name. 'name' must match the name of an existing logged
979
+ model artifact.
980
+ May be prefixed with entity/project/. Valid names
981
+ can be in the following forms:
982
+ - model_artifact_name:version
983
+ - model_artifact_name:alias
984
+
985
+ Examples:
986
+ ```python
987
+ run.use_model(
988
+ name="my_model_artifact:latest",
989
+ )
990
+
991
+ run.use_model(
992
+ name="my_project/my_model_artifact:v0",
993
+ )
994
+
995
+ run.use_model(
996
+ name="my_entity/my_project/my_model_artifact:<digest>",
997
+ )
998
+ ```
999
+
1000
+ Invalid usage
1001
+ ```python
1002
+ run.use_model(
1003
+ name="my_entity/my_project/my_model_artifact",
1004
+ )
1005
+ ```
1006
+
1007
+ Raises:
1008
+ AssertionError: if model artifact 'name' is of a type that does not contain the substring 'model'.
1009
+
1010
+ Returns:
1011
+ path: (str) path to downloaded model artifact file(s).
1012
+ """
1013
+ ...
1014
+
1015
+ def link_model(
1016
+ path: StrPath,
1017
+ registered_model_name: str,
1018
+ name: Optional[str] = None,
1019
+ aliases: Optional[List[str]] = None,
1020
+ ) -> None:
1021
+ """Log a model artifact version and link it to a registered model in the model registry.
1022
+
1023
+ The linked model version will be visible in the UI for the specified registered model.
1024
+
1025
+ Steps:
1026
+ - Check if 'name' model artifact has been logged. If so, use the artifact version that matches the files
1027
+ located at 'path' or log a new version. Otherwise log files under 'path' as a new model artifact, 'name'
1028
+ of type 'model'.
1029
+ - Check if registered model with name 'registered_model_name' exists in the 'model-registry' project.
1030
+ If not, create a new registered model with name 'registered_model_name'.
1031
+ - Link version of model artifact 'name' to registered model, 'registered_model_name'.
1032
+ - Attach aliases from 'aliases' list to the newly linked model artifact version.
1033
+
1034
+ Arguments:
1035
+ path: (str) A path to the contents of this model,
1036
+ can be in the following forms:
1037
+ - `/local/directory`
1038
+ - `/local/directory/file.txt`
1039
+ - `s3://bucket/path`
1040
+ registered_model_name: (str) - the name of the registered model that the model is to be linked to.
1041
+ A registered model is a collection of model versions linked to the model registry, typically representing a
1042
+ team's specific ML Task. The entity that this registered model belongs to will be derived from the run
1043
+ name: (str, optional) - the name of the model artifact that files in 'path' will be logged to. This will
1044
+ default to the basename of the path prepended with the current run id if not specified.
1045
+ aliases: (List[str], optional) - alias(es) that will only be applied on this linked artifact
1046
+ inside the registered model.
1047
+ The alias "latest" will always be applied to the latest version of an artifact that is linked.
1048
+
1049
+ Examples:
1050
+ ```python
1051
+ run.link_model(
1052
+ path="/local/directory",
1053
+ registered_model_name="my_reg_model",
1054
+ name="my_model_artifact",
1055
+ aliases=["production"],
1056
+ )
1057
+ ```
1058
+
1059
+ Invalid usage
1060
+ ```python
1061
+ run.link_model(
1062
+ path="/local/directory",
1063
+ registered_model_name="my_entity/my_project/my_reg_model",
1064
+ name="my_model_artifact",
1065
+ aliases=["production"],
1066
+ )
1067
+
1068
+ run.link_model(
1069
+ path="/local/directory",
1070
+ registered_model_name="my_reg_model",
1071
+ name="my_entity/my_project/my_model_artifact",
1072
+ aliases=["production"],
1073
+ )
1074
+ ```
1075
+
1076
+ Raises:
1077
+ AssertionError: if registered_model_name is a path or
1078
+ if model artifact 'name' is of a type that does not contain the substring 'model'
1079
+ ValueError: if name has invalid special characters
1080
+
1081
+ Returns:
1082
+ None
1083
+ """
1084
+ ...