Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
gaotongxiao committed Oct 18, 2023
1 parent 0f0f8ca commit ae8c426
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
from typing import Dict, List, Optional, Union

from mmcv.transforms.base import BaseTransform

from mmocr.registry import TRANSFORMS
from projects.LayoutLMv3.utils.bio_label_utils import \
find_other_label_name_of_biolabel
from transformers import LayoutLMv3ImageProcessor, LayoutXLMTokenizerFast
from transformers.file_utils import PaddingStrategy
from transformers.image_processing_utils import BatchFeature
from transformers.image_utils import ChannelDimension
from transformers.tokenization_utils_base import (BatchEncoding,
TruncationStrategy)

from mmocr.registry import TRANSFORMS
from projects.LayoutLMv3.utils.bio_label_utils import \
find_other_label_name_of_biolabel


@TRANSFORMS.register_module()
class LoadProcessorFromPretrainedModel(BaseTransform):
Expand Down
4 changes: 2 additions & 2 deletions projects/LayoutLMv3/models/hf_layoutlmv3_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

import torch
from mmengine.model import BaseModel
from transformers import LayoutLMv3ForTokenClassification
from transformers.modeling_outputs import TokenClassifierOutput

from mmocr.registry import MODELS
from projects.LayoutLMv3.utils.typing_utils import (OptSERSampleList,
SERSampleList)
from transformers import LayoutLMv3ForTokenClassification
from transformers.modeling_outputs import TokenClassifierOutput

ForwardResults = Union[Dict[str, torch.Tensor], SERSampleList,
Tuple[torch.Tensor], torch.Tensor]
Expand Down
3 changes: 2 additions & 1 deletion projects/LayoutLMv3/models/loss_processor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from mmocr.registry import MODELS
from transformers.trainer_pt_utils import LabelSmoother

from mmocr.registry import MODELS


@MODELS.register_module()
class ComputeLossAfterLabelSmooth(LabelSmoother):
Expand Down

0 comments on commit ae8c426

Please sign in to comment.