forked from huggingface/optimum-intel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__init__.py
107 lines (89 loc) · 3.18 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# Copyright 2022 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import logging
import warnings
from ..utils.import_utils import (
is_accelerate_available,
is_diffusers_available,
is_nncf_available,
is_sentence_transformers_available,
)
from .utils import (
OV_DECODER_NAME,
OV_DECODER_WITH_PAST_NAME,
OV_DETOKENIZER_NAME,
OV_ENCODER_NAME,
OV_TOKENIZER_NAME,
OV_XML_FILE_NAME,
)
warnings.simplefilter(action="ignore", category=FutureWarning)
if is_nncf_available():
logging.disable(logging.INFO)
import nncf
logging.disable(logging.NOTSET)
# Suppress version mismatch logging
nncf.set_log_level(logging.ERROR)
from nncf.torch import patch_torch_operators
nncf.set_log_level(logging.INFO)
patch_torch_operators()
from .quantization import OVQuantizer
from .training_args import OVTrainingArguments
if is_accelerate_available():
from .trainer import OVTrainer
from .configuration import OVConfig, OVDynamicQuantizationConfig, OVQuantizationConfig, OVWeightQuantizationConfig
from .modeling import (
OVModelForAudioClassification,
OVModelForAudioFrameClassification,
OVModelForAudioXVector,
OVModelForCTC,
OVModelForCustomTasks,
OVModelForFeatureExtraction,
OVModelForImageClassification,
OVModelForMaskedLM,
OVModelForQuestionAnswering,
OVModelForSequenceClassification,
OVModelForTokenClassification,
)
from .modeling_decoder import OVModelForCausalLM
from .modeling_open_clip import (
OVModelOpenCLIPForZeroShotImageClassification,
OVModelOpenCLIPText,
OVModelOpenCLIPVisual,
)
from .modeling_seq2seq import OVModelForPix2Struct, OVModelForSeq2SeqLM, OVModelForSpeechSeq2Seq, OVModelForVision2Seq
from .modeling_visual_language import OVModelForVisualCausalLM
if is_diffusers_available():
from .modeling_diffusion import (
OVDiffusionPipeline,
OVFluxFillPipeline,
OVFluxImg2ImgPipeline,
OVFluxInpaintPipeline,
OVFluxPipeline,
OVLatentConsistencyModelImg2ImgPipeline,
OVLatentConsistencyModelPipeline,
OVPipelineForImage2Image,
OVPipelineForInpainting,
OVPipelineForText2Image,
OVStableDiffusion3Img2ImgPipeline,
OVStableDiffusion3InpaintPipeline,
OVStableDiffusion3Pipeline,
OVStableDiffusionImg2ImgPipeline,
OVStableDiffusionInpaintPipeline,
OVStableDiffusionPipeline,
OVStableDiffusionXLImg2ImgPipeline,
OVStableDiffusionXLInpaintPipeline,
OVStableDiffusionXLPipeline,
)
if is_sentence_transformers_available():
from .modeling_sentence_transformers import OVSentenceTransformer