{"language": "Python", "id": 120, "repo_owner": "wandb", "repo_name": "wandb", "head_branch": "update/diffusers", "workflow_name": "pre-commit", "workflow_filename": "pre-commit.yml", "workflow_path": ".github/workflows/pre-commit.yml", "contributor": "wandb", "sha_fail": "1e48195d38e0d8de001e0f55bfbc830abf2e3f41", "sha_success": "5c24819003ab2cf1fdaa07e78a120fbf53875392", "workflow": "name: pre-commit\n\non:\n pull_request:\n push:\n branches: [main]\n\njobs:\n pre-commit:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v3\n - uses: actions/setup-go@v4\n with:\n go-version: '1.21'\n - uses: actions/setup-python@v3\n - name: setup env\n run: |\n ./core/scripts/code-checks.sh update\n - uses: pre-commit/[email protected]\n with:\n extra_args: --hook-stage pre-push --all-files\n env:\n SKIP: go-generate-graphql\n", "logs": [{"step_name": "pre-commit/6_Run [email protected]", "log": "##[group]Run pre-commit/[email protected]\nwith:\n extra_args: --hook-stage pre-push --all-files\nenv:\n pythonLocation: /opt/hostedtoolcache/Python/3.12.1/x64\n LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.1/x64/lib\n SKIP: go-generate-graphql\n##[endgroup]\n##[group]Run python -m pip install pre-commit\n\u001b[36;1mpython -m pip install pre-commit\u001b[0m\nshell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}\nenv:\n pythonLocation: /opt/hostedtoolcache/Python/3.12.1/x64\n LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.1/x64/lib\n SKIP: go-generate-graphql\n##[endgroup]\nCollecting pre-commit\n Downloading pre_commit-3.6.0-py2.py3-none-any.whl.metadata (1.3 kB)\nCollecting cfgv>=2.0.0 (from pre-commit)\n Downloading cfgv-3.4.0-py2.py3-none-any.whl.metadata (8.5 kB)\nCollecting identify>=1.0.0 (from pre-commit)\n Downloading identify-2.5.33-py2.py3-none-any.whl.metadata (4.4 kB)\nCollecting nodeenv>=0.11.1 (from pre-commit)\n Downloading nodeenv-1.8.0-py2.py3-none-any.whl.metadata (21 kB)\nCollecting pyyaml>=5.1 (from pre-commit)\n Downloading PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (2.1 kB)\nCollecting virtualenv>=20.10.0 (from pre-commit)\n Downloading virtualenv-20.25.0-py3-none-any.whl.metadata (4.5 kB)\nCollecting setuptools (from nodeenv>=0.11.1->pre-commit)\n Downloading setuptools-69.0.3-py3-none-any.whl.metadata (6.3 kB)\nCollecting distlib<1,>=0.3.7 (from virtualenv>=20.10.0->pre-commit)\n Downloading distlib-0.3.8-py2.py3-none-any.whl.metadata (5.1 kB)\nCollecting filelock<4,>=3.12.2 (from virtualenv>=20.10.0->pre-commit)\n Downloading filelock-3.13.1-py3-none-any.whl.metadata (2.8 kB)\nCollecting platformdirs<5,>=3.9.1 (from virtualenv>=20.10.0->pre-commit)\n Downloading platformdirs-4.1.0-py3-none-any.whl.metadata (11 kB)\nDownloading pre_commit-3.6.0-py2.py3-none-any.whl (204 kB)\n \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501 204.0/204.0 kB 31.8 MB/s eta 0:00:00\nDownloading cfgv-3.4.0-py2.py3-none-any.whl (7.2 kB)\nDownloading identify-2.5.33-py2.py3-none-any.whl (98 kB)\n \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501 98.9/98.9 kB 31.0 MB/s eta 0:00:00\nDownloading nodeenv-1.8.0-py2.py3-none-any.whl (22 kB)\nDownloading PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (724 kB)\n \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501 725.0/725.0 kB 87.6 MB/s eta 0:00:00\nDownloading virtualenv-20.25.0-py3-none-any.whl (3.8 MB)\n \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501 3.8/3.8 MB 116.8 MB/s eta 0:00:00\nDownloading distlib-0.3.8-py2.py3-none-any.whl (468 kB)\n \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501 468.9/468.9 kB 49.6 MB/s eta 0:00:00\nDownloading filelock-3.13.1-py3-none-any.whl (11 kB)\nDownloading platformdirs-4.1.0-py3-none-any.whl (17 kB)\nDownloading setuptools-69.0.3-py3-none-any.whl (819 kB)\n \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501 819.5/819.5 kB 92.1 MB/s eta 0:00:00\nInstalling collected packages: distlib, setuptools, pyyaml, platformdirs, identify, filelock, cfgv, virtualenv, nodeenv, pre-commit\nSuccessfully installed cfgv-3.4.0 distlib-0.3.8 filelock-3.13.1 identify-2.5.33 nodeenv-1.8.0 platformdirs-4.1.0 pre-commit-3.6.0 pyyaml-6.0.1 setuptools-69.0.3 virtualenv-20.25.0\n##[group]Run python -m pip freeze --local\n\u001b[36;1mpython -m pip freeze --local\u001b[0m\nshell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}\nenv:\n pythonLocation: /opt/hostedtoolcache/Python/3.12.1/x64\n LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.1/x64/lib\n SKIP: go-generate-graphql\n##[endgroup]\ncfgv==3.4.0\ndistlib==0.3.8\nfilelock==3.13.1\nidentify==2.5.33\nnodeenv==1.8.0\nplatformdirs==4.1.0\npre-commit==3.6.0\nPyYAML==6.0.1\nsetuptools==69.0.3\nvirtualenv==20.25.0\n##[group]Run actions/cache@v3\nwith:\n path: ~/.cache/pre-commit\n key: pre-commit-3|/opt/hostedtoolcache/Python/3.12.1/x64|a333fd88224707918ef5e53726a9b083fdaa934e65d17db828a35f3ab158770e\n enableCrossOsArchive: false\n fail-on-cache-miss: false\n lookup-only: false\nenv:\n pythonLocation: /opt/hostedtoolcache/Python/3.12.1/x64\n LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.1/x64/lib\n SKIP: go-generate-graphql\n##[endgroup]\nReceived 0 of 48931996 (0.0%), 0.0 MBs/sec\nCache Size: ~47 MB (48931996 B)\n[command]/usr/bin/tar -xf /home/runner/work/_temp/2e6b382b-db1b-4411-add2-ddbcf402d5ce/cache.tzst -P -C /home/runner/work/wandb/wandb --use-compress-program unzstd\nReceived 48931996 of 48931996 (100.0%), 23.3 MBs/sec\nCache restored successfully\nCache restored from key: pre-commit-3|/opt/hostedtoolcache/Python/3.12.1/x64|a333fd88224707918ef5e53726a9b083fdaa934e65d17db828a35f3ab158770e\n##[group]Run pre-commit run --show-diff-on-failure --color=always --hook-stage pre-push --all-files\n\u001b[36;1mpre-commit run --show-diff-on-failure --color=always --hook-stage pre-push --all-files\u001b[0m\nshell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}\nenv:\n pythonLocation: /opt/hostedtoolcache/Python/3.12.1/x64\n LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.1/x64/lib\n SKIP: go-generate-graphql\n##[endgroup]\nclippy...................................................................\u001b[42mPassed\u001b[m\nruff.....................................................................\u001b[42mPassed\u001b[m\nblack-jupyter............................................................\u001b[41mFailed\u001b[m\n\u001b[2m- hook id: black-jupyter\u001b[m\n\u001b[2m- files were modified by this hook\u001b[m\n\n\u001b[1mreformatted wandb/integration/diffusers/autologger.py\u001b[0m\n\n\u001b[1mAll done! \u2728 \ud83c\udf70 \u2728\u001b[0m\n\u001b[34m\u001b[1m1 file \u001b[0m\u001b[1mreformatted\u001b[0m, \u001b[34m887 files \u001b[0mleft unchanged.\n\nblacken-docs.............................................................\u001b[42mPassed\u001b[m\nclang-format.............................................................\u001b[42mPassed\u001b[m\ncheck for merge conflicts................................................\u001b[42mPassed\u001b[m\ntrailing-whitespace......................................................\u001b[42mPassed\u001b[m\nend-of-file-fixer........................................................\u001b[42mPassed\u001b[m\ncheck-yaml...............................................................\u001b[42mPassed\u001b[m\ncheck-added-large-files..................................................\u001b[42mPassed\u001b[m\ncheck-shebang-scripts-are-executable.....................................\u001b[42mPassed\u001b[m\ncheck-executables-have-shebangs..........................................\u001b[42mPassed\u001b[m\ncheck-symlinks.......................................(no files to check)\u001b[46;30mSkipped\u001b[m\ncheck-toml...............................................................\u001b[42mPassed\u001b[m\ndebug-statements.........................................................\u001b[42mPassed\u001b[m\nforbid-submodules....................................(no files to check)\u001b[46;30mSkipped\u001b[m\nblack....................................................................\u001b[42mPassed\u001b[m\ngo-generate-proto........................................................\u001b[42mPassed\u001b[m\ngo-generate-graphql.....................................................\u001b[43;30mSkipped\u001b[m\ngo-fmt...................................................................\u001b[42mPassed\u001b[m\ngo-imports...............................................................\u001b[42mPassed\u001b[m\ngo-unit-tests............................................................\u001b[42mPassed\u001b[m\ngo-vet...................................................................\u001b[42mPassed\u001b[m\ngolangci-lint............................................................\u001b[42mPassed\u001b[m\ngo-critic................................................................\u001b[42mPassed\u001b[m\ngo-cyclo.................................................................\u001b[42mPassed\u001b[m\ngo-mod-tidy..............................................................\u001b[42mPassed\u001b[m\ngo-build.................................................................\u001b[42mPassed\u001b[m\npre-commit hook(s) made changes.\nIf you are seeing this message in CI, reproduce locally with: `pre-commit run --all-files`.\nTo run `pre-commit` as part of git workflow, use `pre-commit install`.\nAll changes made by hooks:\n\u001b[1mdiff --git a/wandb/integration/diffusers/autologger.py b/wandb/integration/diffusers/autologger.py\u001b[m\n\u001b[1mindex ab88d9c..e10ee15 100644\u001b[m\n\u001b[1m--- a/wandb/integration/diffusers/autologger.py\u001b[m\n\u001b[1m+++ b/wandb/integration/diffusers/autologger.py\u001b[m\n\u001b[36m@@ -65,7 +65,7 @@\u001b[m \u001b[mautolog = AutologAPI(\u001b[m\n \"TextToVideoSDPipeline.__call__\",\u001b[m\n \"TextToVideoZeroPipeline.__call__\",\u001b[m\n \"StableVideoDiffusionPipeline.__call__\",\u001b[m\n\u001b[31m- \"AmusedPipeline.__call__\"\u001b[m\n\u001b[32m+\u001b[m\u001b[32m \"AmusedPipeline.__call__\",\u001b[m\n ),\u001b[m\n resolver=DiffusersPipelineResolver(),\u001b[m\n telemetry_feature=\"diffusers_autolog\",\u001b[m\n##[error]Process completed with exit code 1.\n"}], "diff": "diff --git a/wandb/integration/diffusers/autologger.py b/wandb/integration/diffusers/autologger.py\nindex ab88d9c7d..e10ee1549 100644\n--- a/wandb/integration/diffusers/autologger.py\n+++ b/wandb/integration/diffusers/autologger.py\n@@ -65,7 +65,7 @@ autolog = AutologAPI(\n \"TextToVideoSDPipeline.__call__\",\n \"TextToVideoZeroPipeline.__call__\",\n \"StableVideoDiffusionPipeline.__call__\",\n- \"AmusedPipeline.__call__\"\n+ \"AmusedPipeline.__call__\",\n ),\n resolver=DiffusersPipelineResolver(),\n telemetry_feature=\"diffusers_autolog\",\ndiff --git a/wandb/integration/diffusers/pipeline_resolver.py b/wandb/integration/diffusers/pipeline_resolver.py\nindex 37cf75fd7..9d3736d2d 100644\n--- a/wandb/integration/diffusers/pipeline_resolver.py\n+++ b/wandb/integration/diffusers/pipeline_resolver.py\n@@ -18,6 +18,7 @@ class DiffusersPipelineResolver:\n \n def __init__(self) -> None:\n self.wandb_table = None\n+ self.pipeline_call_count = 1\n \n def __call__(\n self,\n@@ -43,7 +44,10 @@ class DiffusersPipelineResolver:\n pipeline_name = args[0].__class__.__name__\n resolver = None\n if pipeline_name in SUPPORTED_MULTIMODAL_PIPELINES:\n- resolver = DiffusersMultiModalPipelineResolver(pipeline_name)\n+ resolver = DiffusersMultiModalPipelineResolver(\n+ pipeline_name, self.pipeline_call_count\n+ )\n+ self.pipeline_call_count += 1\n elif pipeline_name in SUPPORTED_SDXL_PIPELINES:\n resolver = SDXLResolver(pipeline_name)\n loggable_dict = resolver(args, kwargs, response, start_time, time_elapsed)\ndiff --git a/wandb/integration/diffusers/resolvers/multimodal.py b/wandb/integration/diffusers/resolvers/multimodal.py\nindex 2948778f9..021efcf2c 100644\n--- a/wandb/integration/diffusers/resolvers/multimodal.py\n+++ b/wandb/integration/diffusers/resolvers/multimodal.py\n@@ -502,8 +502,9 @@ class DiffusersMultiModalPipelineResolver:\n pipeline_name: (str) The name of the Diffusion Pipeline.\n \"\"\"\n \n- def __init__(self, pipeline_name: str) -> None:\n+ def __init__(self, pipeline_name: str, pipeline_call_count: int) -> None:\n self.pipeline_name = pipeline_name\n+ self.pipeline_call_count = pipeline_call_count\n columns = []\n if pipeline_name in SUPPORTED_MULTIMODAL_PIPELINES:\n columns += SUPPORTED_MULTIMODAL_PIPELINES[pipeline_name][\"table-schema\"]\n@@ -543,9 +544,30 @@ class DiffusersMultiModalPipelineResolver:\n pipeline_configs = dict(pipeline.config)\n pipeline_configs[\"pipeline-name\"] = self.pipeline_name\n \n- wandb.config.update(\n- {\"workflow\": {\"pipeline\": pipeline_configs, \"params\": kwargs}}\n- )\n+ if \"workflow\" not in wandb.config:\n+ wandb.config.update(\n+ {\n+ \"workflow\": [\n+ {\n+ \"pipeline\": pipeline_configs,\n+ \"params\": kwargs,\n+ \"stage\": f\"Pipeline-Call-{self.pipeline_call_count}\",\n+ }\n+ ]\n+ }\n+ )\n+ else:\n+ existing_workflow = wandb.config.workflow\n+ updated_workflow = existing_workflow + [\n+ {\n+ \"pipeline\": pipeline_configs,\n+ \"params\": kwargs,\n+ \"stage\": f\"Pipeline-Call-{self.pipeline_call_count}\",\n+ }\n+ ]\n+ wandb.config.update(\n+ {\"workflow\": updated_workflow}, allow_val_change=True\n+ )\n \n # Return the WandB loggable dict\n loggable_dict = self.prepare_loggable_dict(response, kwargs)\n@@ -596,7 +618,13 @@ class DiffusersMultiModalPipelineResolver:\n caption = loggable_kwarg_chunks[prompt_index][idx]\n except ValueError:\n caption = None\n- wandb.log({\"Generated-Image\": wandb.Image(image, caption=caption)})\n+ wandb.log(\n+ {\n+ f\"Generated-Image/Pipeline-Call-{self.pipeline_call_count}\": wandb.Image(\n+ image, caption=caption\n+ )\n+ }\n+ )\n else:\n if (\n SUPPORTED_MULTIMODAL_PIPELINES[self.pipeline_name][\"output-type\"]\n@@ -611,7 +639,7 @@ class DiffusersMultiModalPipelineResolver:\n caption = None\n wandb.log(\n {\n- \"Generated-Video\": wandb.Video(\n+ f\"Generated-Video/Pipeline-Call-{self.pipeline_call_count}\": wandb.Video(\n postprocess_pils_to_np(image), fps=4, caption=caption\n )\n }\n@@ -629,7 +657,7 @@ class DiffusersMultiModalPipelineResolver:\n caption = None\n wandb.log(\n {\n- \"Generated-Audio\": wandb.Audio(\n+ f\"Generated-Audio/Pipeline-Call-{self.pipeline_call_count}\": wandb.Audio(\n image, sample_rate=16000, caption=caption\n )\n }\n@@ -696,7 +724,11 @@ class DiffusersMultiModalPipelineResolver:\n images, normalize=self.pipeline_name == \"TextToVideoZeroPipeline\"\n )\n wandb.log(\n- {\"Generated-Video\": wandb.Video(video, fps=4, caption=kwargs[\"prompt\"])}\n+ {\n+ f\"Generated-Video/Pipeline-Call-{self.pipeline_call_count}\": wandb.Video(\n+ video, fps=4, caption=kwargs[\"prompt\"]\n+ )\n+ }\n )\n loggable_kwarg_ids = SUPPORTED_MULTIMODAL_PIPELINES[self.pipeline_name][\n \"kwarg-logging\"\n@@ -727,5 +759,6 @@ class DiffusersMultiModalPipelineResolver:\n self.log_media(image, loggable_kwarg_chunks, idx)\n # Populate the row of the wandb_table\n self.add_data_to_table(image, loggable_kwarg_chunks, idx)\n-\n- return {\"Result-Table\": self.wandb_table}\n+ return {\n+ f\"Result-Table/Pipeline-Call-{self.pipeline_call_count}\": self.wandb_table\n+ }\n", "difficulty": 0, "changed_files": ["wandb/integration/diffusers/autologger.py", "wandb/integration/diffusers/pipeline_resolver.py", "wandb/integration/diffusers/resolvers/multimodal.py"], "commit_link": "https://github.com/wandb/wandb/tree/1e48195d38e0d8de001e0f55bfbc830abf2e3f41"} |