"configs/git@developer.sourcefind.cn:wangsen/paddle_dbnet.git" did not exist on "97111112703358f70c38fddf0187d3399dff2257"
Unverified Commit c26b2a29 authored by Arthur's avatar Arthur Committed by GitHub
Browse files

[`Nougat`] from transformers import * (#26562)



* remove unprotected import to PIL

* cleanup

---------
Co-authored-by: default avatarLysandre <lysandre@huggingface.co>
parent 2aef9a96
...@@ -39,9 +39,6 @@ try: ...@@ -39,9 +39,6 @@ try:
from xformers import ops as xops from xformers import ops as xops
except ImportError: except ImportError:
xops = None xops = None
logger.warning(
"Xformers is not installed correctly. If you want to use memory_efficient_attention to accelerate training use the following command to install Xformers\npip install xformers."
)
_CONFIG_FOR_DOC = "OpenLlamaConfig" _CONFIG_FOR_DOC = "OpenLlamaConfig"
......
...@@ -18,7 +18,6 @@ Processor class for Nougat. ...@@ -18,7 +18,6 @@ Processor class for Nougat.
from typing import Dict, List, Optional, Union from typing import Dict, List, Optional, Union
from transformers.image_utils import ChannelDimension, PILImageResampling
from transformers.tokenization_utils_base import PreTokenizedInput, TextInput, TruncationStrategy from transformers.tokenization_utils_base import PreTokenizedInput, TextInput, TruncationStrategy
from ...processing_utils import ProcessorMixin from ...processing_utils import ProcessorMixin
...@@ -53,7 +52,7 @@ class NougatProcessor(ProcessorMixin): ...@@ -53,7 +52,7 @@ class NougatProcessor(ProcessorMixin):
do_crop_margin: bool = None, do_crop_margin: bool = None,
do_resize: bool = None, do_resize: bool = None,
size: Dict[str, int] = None, size: Dict[str, int] = None,
resample: PILImageResampling = None, resample: "PILImageResampling" = None, # noqa: F821
do_thumbnail: bool = None, do_thumbnail: bool = None,
do_align_long_axis: bool = None, do_align_long_axis: bool = None,
do_pad: bool = None, do_pad: bool = None,
...@@ -62,8 +61,8 @@ class NougatProcessor(ProcessorMixin): ...@@ -62,8 +61,8 @@ class NougatProcessor(ProcessorMixin):
do_normalize: bool = None, do_normalize: bool = None,
image_mean: Optional[Union[float, List[float]]] = None, image_mean: Optional[Union[float, List[float]]] = None,
image_std: Optional[Union[float, List[float]]] = None, image_std: Optional[Union[float, List[float]]] = None,
data_format: Optional[ChannelDimension] = ChannelDimension.FIRST, data_format: Optional["ChannelDimension"] = "ChannelDimension.FIRST", # noqa: F821
input_data_format: Optional[Union[str, ChannelDimension]] = None, input_data_format: Optional[Union[str, "ChannelDimension"]] = None, # noqa: F821
text_pair: Optional[Union[TextInput, PreTokenizedInput, List[TextInput], List[PreTokenizedInput]]] = None, text_pair: Optional[Union[TextInput, PreTokenizedInput, List[TextInput], List[PreTokenizedInput]]] = None,
text_target: Union[TextInput, PreTokenizedInput, List[TextInput], List[PreTokenizedInput]] = None, text_target: Union[TextInput, PreTokenizedInput, List[TextInput], List[PreTokenizedInput]] = None,
text_pair_target: Optional[ text_pair_target: Optional[
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment