Skip to content

Commit

Permalink
falke8
Browse files Browse the repository at this point in the history
  • Loading branch information
fschlatt committed Nov 15, 2024
1 parent 6f0c984 commit 4a02a30
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lightning_ir/base/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from dataclasses import dataclass
from functools import partial, wraps
from pathlib import Path
from typing import Any, Callable, Literal, Mapping, Protocol, Sequence, Type, TypeVar
from typing import Any, Literal, Mapping, Protocol, Sequence, Type, TypeVar

import torch
from transformers import MODEL_MAPPING, BatchEncoding, BertModel
Expand Down
5 changes: 3 additions & 2 deletions lightning_ir/bi_encoder/tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ def __init__(
:param attend_to_doc_expanded_tokens: Whether to let non-expanded document tokens be able to attend to
mask expanded document tokens, defaults to False
:type attend_to_doc_expanded_tokens: bool, optional
:param add_marker_tokens: Whether to add marker tokens to the query and document input sequences, defaults to True
:param add_marker_tokens: Whether to add marker tokens to the query and document input sequences,
defaults to True
:type add_marker_tokens: bool, optional
:raises ValueError: If add_marker_tokens is True and a non-supported tokenizer is used
"""
Expand Down Expand Up @@ -127,7 +128,7 @@ def doc_token_id(self) -> int | None:
return None

def __call__(self, *args, warn: bool = True, **kwargs) -> BatchEncoding:
"""Overrides the PretrainedTokenizer.__call___ method to warn the user to use :meth:`.tokenize_query` and
"""Overrides the PretrainedTokenizer.__call___ method to warn the user to use :meth:`.tokenize_query` and
:meth:`.tokenize_doc` methods instead.
.. PretrainedTokenizer.__call__: \
Expand Down
8 changes: 5 additions & 3 deletions lightning_ir/lightning_utils/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import itertools
from dataclasses import is_dataclass
from pathlib import Path
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Sequence, Tuple, TypeVar
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Literal, Sequence, Tuple, TypeVar

import pandas as pd
import torch
Expand Down Expand Up @@ -372,9 +372,11 @@ def __init__(
:param dataset_id: Dataset id
:type dataset_id: str
:param docs: Path to documents file or valid ir_datasets id from which documents should be taken, defaults to None
:param docs: Path to documents file or valid ir_datasets id from which documents should be taken,
defaults to None
:type docs: str | None, optional
:param queries: Path to queries file or valid ir_datastes id from which queries should be taken, defaults to None
:param queries: Path to queries file or valid ir_datastes id from which queries should be taken,
defaults to None
:type queries: str | None, optional
:param qrels: Path to qrels file or valid ir_datasets id from which qrels will be taken, defaults to None
:type qrels: str | None, optional
Expand Down

0 comments on commit 4a02a30

Please sign in to comment.