Skip to content

Commit

Permalink
hasattr check for Wandb 0.17.6 (#3531)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvpatel2000 authored Aug 8, 2024
1 parent a15b18c commit 4a9756f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/daily.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,10 @@ jobs:
pytest-command: ${{ matrix.pytest_command }}
pytest-markers: ${{ matrix.markers }}
composer_package_name: ${{ matrix.composer_package_name }}
pytest-wandb-entity: "mosaicml-public-integration-tests"
pytest-wandb-project: "integration-tests-${{ github.sha }}"
safe_directory: composer
secrets:
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
wandb-api-key: ${{ secrets.WANDB_API_KEY }}
code-eval-device: ${{ secrets.CODE_EVAL_DEVICE }}
code-eval-url: ${{ secrets.CODE_EVAL_URL }}
code-eval-apikey: ${{ secrets.CODE_EVAL_APIKEY }}
Expand Down
6 changes: 5 additions & 1 deletion composer/loggers/wandb_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,11 @@ def init(self, state: State, logger: Logger) -> None:
if self._enabled:
wandb.init(**self._init_kwargs)
assert wandb.run is not None, 'The wandb run is set after init'
entity_and_project = [str(wandb.run.entity), str(wandb.run.project)]
if hasattr(wandb.run, 'entity') and hasattr(wandb.run, 'project'):
entity_and_project = [str(wandb.run.entity), str(wandb.run.project)]
else:
# Run does not have attribtues if wandb is in disabled mode, so we must mock it
entity_and_project = ['disabled', 'disabled']
self.run_dir = wandb.run.dir
self.run_url = wandb.run.get_url()
atexit.register(self._set_is_in_atexit)
Expand Down

0 comments on commit 4a9756f

Please sign in to comment.