Skip to content

some issues by pre-commit-toolkit #90

@kkscilife

Description

@kkscilife

We found some issues by pre-commit-toolkit

For example:

  1. imported but unused
...
dingo/model/rule/utils/detect_lang.py:8:1: F401 'huggingface_hub.hf_hub_download' imported but unused
examples/register/sdk_register_rule.py:2:1: F401 'typing.List' imported but unused
...
  1. spell error
...
README.md:46: architeture ==> architecture
dingo/run/cli.py:75: bellow ==> below
...
  1. no-name-in-module
dingo/model/prompt/prompt_text_quality_multilan.py:3:0: E0611: No name 'prompt_text_quality_v2' in module 'dingo.model.prompt' (no-name-in-module)
origin code:
from dingo.model.prompt.prompt_text_quality_v2 import \
  TEXT_QUALITY_WITHOUT_ROLE_V2

dir tree:

dingo/model/prompt
├── base.py
├── __init__.py
├── prompt_classify_qr.py
├── prompt_classify_topic.py
├── prompt_common.py
├── prompt_dataman_assessment.py
├── prompt_html_abstract.py
├── prompt_image_relevant.py
├── prompt_politics.py
├── prompt_prohibition.py
├── prompt_text_3h.py
├── prompt_text_language.py
├── prompt_text_quality_kaoti.py
├── prompt_text_quality_multilan.py
└── prompt_text_quality.py

  1. Unexpected keyword argument
dingo/data/dataset/huggingface.py:168:17: E1123: Unexpected keyword argument 'path' in constructor call (unexpected-keyword-arg)
dingo/data/dataset/huggingface.py:168:17: E1123: Unexpected keyword argument 'split' in constructor call (unexpected-keyword-arg)
dingo/data/dataset/huggingface.py:178:11: E1123: Unexpected keyword argument 'targets' in constructor call (unexpected-keyword-arg)

origin code:
...
    if path is not None:
        source = HuggingFaceSource(
            path=path,
            data_dir=data_dir,
            data_files=data_files,
            split=split,
            revision=revision,
            trust_remote_code=trust_remote_code,
        )
    else:
        raise RuntimeError('You must specify a path to Hugging Face dataset.')

...


@DataSource.register()
class HuggingFaceSource(DataSource):
    """Represents the source of a Hugging Face dataset used in Dingo Tracking."""

    def __init__(
            self,
            input_args: InputArgs = None,
            config_name: Optional[str] = None,
            data_dir: Optional[str] = None,
            data_files: Optional[
                Union[str, Sequence[str], Mapping[str, Union[str, Sequence[str]]]]
            ] = None,
            revision: Optional[Union[str, datasets.Version]] = None,
            trust_remote_code: Optional[bool] = None,
    ):
...


Suggest adding more rules from reference

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions