Skip to content

Commit

Permalink
pyright
Browse files Browse the repository at this point in the history
  • Loading branch information
wenfeiy-db committed Nov 10, 2023
1 parent f3ee2ae commit 5e0d31b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
5 changes: 3 additions & 2 deletions llmfoundry/utils/builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def build_icl_data_and_gauntlet(
return icl_evaluators, logger_keys, eval_gauntlet_cb


def build_callback(name: str, kwargs: Dict[str, Any]) -> Callback:
def build_callback(name: str, kwargs: Union[DictConfig, Dict[str,
Any]]) -> Callback:
if name == 'lr_monitor':
return LRMonitor()
elif name == 'memory_monitor':
Expand Down Expand Up @@ -118,7 +119,7 @@ def build_callback(name: str, kwargs: Dict[str, Any]) -> Callback:
return EarlyStopper(**kwargs)
elif name == 'hf_checkpointer':
if isinstance(kwargs, DictConfig):
kwargs = om.to_object(kwargs)
kwargs = om.to_object(kwargs) # pyright: ignore
return HuggingFaceCheckpointer(**kwargs)
else:
raise ValueError(f'Not sure how to build callback: {name}')
Expand Down
1 change: 0 additions & 1 deletion tests/test_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import pytest
from composer.callbacks import Generate
from omegaconf import DictConfig
from omegaconf import OmegaConf as om
from transformers import PreTrainedTokenizerBase

Expand Down
2 changes: 1 addition & 1 deletion tests/test_hf_conversion_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os
import pathlib
import sys
from unittest.mock import ANY, MagicMock, patch
from unittest.mock import MagicMock, patch

from composer import Trainer
from composer.loggers import MLFlowLogger
Expand Down

0 comments on commit 5e0d31b

Please sign in to comment.