Skip to content

Commit 1de7f31

Browse files
authored
Fix typos (#1284)
1 parent 3ea4c3b commit 1de7f31

File tree

11 files changed

+25
-25
lines changed

11 files changed

+25
-25
lines changed

.github/workflows/quality.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
run: |
3030
pip install --upgrade pip
3131
# .[quality] installs too many dependencies
32-
# TODO: we should remove the the version pinning at some point
32+
# TODO: we should remove the version pinning at some point
3333
pip install "black~=23.1" "ruff==0.4.4"
3434
3535
- name: Check style with black

docs/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ This command will generate the HTML files that will be rendered as the
2929
documentation on the [Hugging Face
3030
website](https://huggingface.co/docs/optimum/index). You can inspect them in
3131
your favorite browser. You can also adapt the `BUILD_DIR` argument to any
32-
temporary folder that you prefer. By default, the comamnd builds a Docker container
32+
temporary folder that you prefer. By default, the command builds a Docker container
3333
with the latest files from the main branch. To build documentation for a different
3434
commit or a fork, use the `DEFAULT_CLONE_URL` and `COMMIT_SHA_SUBPACKAGE`
3535
environment variables.
@@ -262,7 +262,7 @@ includes an example of how to transcribe speech to text in the [docstring of its
262262
forward
263263
function](https://huggingface.co/docs/transformers/model_doc/wav2vec2#transformers.Wav2Vec2ForCTC.forward).
264264

265-
## Writing documenation examples
265+
## Writing documentation examples
266266

267267
The syntax for Example docstrings can look as follows:
268268

optimum/exporters/openvino/model_configs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ def add_past_key_values(self, inputs_or_outputs: Dict[str, Dict[int, str]], dire
478478
decoder_sequence_name = "past_sequence_length"
479479
name = "past_key_values"
480480
else:
481-
decoder_sequence_name = "past_sequence_length + present_lenght"
481+
decoder_sequence_name = "past_sequence_length + present_length"
482482
name = "present"
483483

484484
is_v4 = hasattr(self._normalized_config, "rope_ratio")

optimum/intel/openvino/modeling_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def to(self, device: str):
177177
"""
178178
if self._compile_only and isinstance(device, str):
179179
raise ValueError(
180-
"`to()` is not supported with `compile_only` mode, please intialize model without this option"
180+
"`to()` is not supported with `compile_only` mode, please initialize model without this option"
181181
)
182182

183183
if isinstance(device, str):
@@ -739,7 +739,7 @@ def reshape(self, batch_size: int, sequence_length: int, height: int = None, wid
739739
"""
740740
if self._compile_only:
741741
raise ValueError(
742-
"`reshape()` is not supported with `compile_only` mode, please intialize model without this option"
742+
"`reshape()` is not supported with `compile_only` mode, please initialize model without this option"
743743
)
744744

745745
self.is_dynamic = True if batch_size == -1 and sequence_length == -1 else False

optimum/intel/openvino/modeling_base_seq2seq.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ def reshape(self, batch_size: int, sequence_length: int):
475475
"""
476476
if self._compile_only:
477477
raise ValueError(
478-
"`reshape()` is not supported with `compile_only` mode, please intialize model without this option"
478+
"`reshape()` is not supported with `compile_only` mode, please initialize model without this option"
479479
)
480480
logger.warning("Some part of the model's decoder do not support static shapes and will be kept dynamic.")
481481
self.is_dynamic = True if batch_size == -1 and sequence_length == -1 else False
@@ -490,7 +490,7 @@ def half(self):
490490
"""
491491
if self._compile_only:
492492
raise ValueError(
493-
"`half()` is not supported with `compile_only` mode, please intialize model without this option"
493+
"`half()` is not supported with `compile_only` mode, please initialize model without this option"
494494
)
495495
for submodel in self.ov_submodels.values():
496496
apply_moc_transformations(submodel, cf=False)

optimum/intel/openvino/modeling_decoder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ def _save_pretrained(self, save_directory: Union[str, Path]):
249249

250250
if self._compile_only:
251251
raise ValueError(
252-
"`save_pretrained()` is not supported with `compile_only` mode, please intialize model without this option"
252+
"`save_pretrained()` is not supported with `compile_only` mode, please initialize model without this option"
253253
)
254254
model_to_save = (
255255
self.model
@@ -368,7 +368,7 @@ def _reshape(
368368
):
369369
if self._compile_only:
370370
raise ValueError(
371-
"`reshape()` is not supported with `compile_only` mode, please intialize model without this option"
371+
"`reshape()` is not supported with `compile_only` mode, please initialize model without this option"
372372
)
373373

374374
if height is not None:
@@ -895,7 +895,7 @@ def _from_pretrained(
895895

896896
if compile_only:
897897
raise ValueError(
898-
"quantization is not supported with `compile_only` mode, please intialize model without this option"
898+
"quantization is not supported with `compile_only` mode, please initialize model without this option"
899899
)
900900

901901
from optimum.intel.openvino.quantization import OVQuantizer

optimum/intel/openvino/modeling_diffusion.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ def _save_pretrained(self, save_directory: Union[str, Path]):
306306
"""
307307
if self._compile_only:
308308
raise ValueError(
309-
"`save_pretrained()` is not supported with `compile_only` mode, please intialize model without this option"
309+
"`save_pretrained()` is not supported with `compile_only` mode, please initialize model without this option"
310310
)
311311

312312
save_directory = Path(save_directory)
@@ -888,7 +888,7 @@ def _reshape_vae_decoder(
888888
def reshape(self, batch_size: int, height: int, width: int, num_images_per_prompt: int = -1, num_frames: int = -1):
889889
if self._compile_only:
890890
raise ValueError(
891-
"`reshape()` is not supported with `compile_only` mode, please intialize model without this option"
891+
"`reshape()` is not supported with `compile_only` mode, please initialize model without this option"
892892
)
893893

894894
self.is_dynamic = -1 in {batch_size, height, width, num_images_per_prompt}
@@ -958,7 +958,7 @@ def half(self):
958958
"""
959959
if self._compile_only:
960960
raise ValueError(
961-
"`half()` is not supported with `compile_only` mode, please intialize model without this option"
961+
"`half()` is not supported with `compile_only` mode, please initialize model without this option"
962962
)
963963

964964
for submodel in self.ov_submodels.values():
@@ -971,7 +971,7 @@ def half(self):
971971
def clear_requests(self):
972972
if self._compile_only:
973973
raise ValueError(
974-
"`clear_requests()` is not supported with `compile_only` mode, please intialize model without this option"
974+
"`clear_requests()` is not supported with `compile_only` mode, please initialize model without this option"
975975
)
976976

977977
for component in [
@@ -1031,7 +1031,7 @@ def __call__(self, *args, **kwargs):
10311031

10321032
height, width = None, None
10331033
height_idx, width_idx = None, None
1034-
shapes_overriden = False
1034+
shapes_overridden = False
10351035
sig = inspect.signature(self.auto_model_class.__call__)
10361036
sig_height_idx = list(sig.parameters).index("height") if "height" in sig.parameters else len(sig.parameters)
10371037
sig_width_idx = list(sig.parameters).index("width") if "width" in sig.parameters else len(sig.parameters)
@@ -1059,7 +1059,7 @@ def __call__(self, *args, **kwargs):
10591059
else:
10601060
kwargs["height"] = height
10611061

1062-
shapes_overriden = True
1062+
shapes_overridden = True
10631063

10641064
if self.width != -1:
10651065
if width is not None and width != self.width:
@@ -1072,11 +1072,11 @@ def __call__(self, *args, **kwargs):
10721072
args[width_idx] = width
10731073
else:
10741074
kwargs["width"] = width
1075-
shapes_overriden = True
1075+
shapes_overridden = True
10761076

10771077
# Sana generates images in specific resolution grid size and then resize to requested size by default, it may contradict with pipeline height / width
10781078
# Disable this behavior for static shape pipeline
1079-
if self.auto_model_class.__name__.startswith("Sana") and shapes_overriden:
1079+
if self.auto_model_class.__name__.startswith("Sana") and shapes_overridden:
10801080
sig_resolution_bining_idx = (
10811081
list(sig.parameters).index("use_resolution_binning")
10821082
if "use_resolution_binning" in sig.parameters

optimum/intel/openvino/modeling_sam.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def reshape(self, batch_size: int = -1, point_batch_size: int = -1, num_points_p
301301
"""
302302
if self._compile_only:
303303
raise ValueError(
304-
"`reshape()` is not supported with `compile_only` mode, please intialize model without this option"
304+
"`reshape()` is not supported with `compile_only` mode, please initialize model without this option"
305305
)
306306
vision_encoder_shapes = {}
307307
for inputs in self.vision_encoder_model.inputs:

optimum/intel/openvino/modeling_seq2seq.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ def reshape(self, batch_size: int, sequence_length: int):
436436
"""
437437
if self._compile_only:
438438
raise ValueError(
439-
"`reshape()` is not supported with `compile_only` mode, please intialize model without this option"
439+
"`reshape()` is not supported with `compile_only` mode, please initialize model without this option"
440440
)
441441
super().reshape(batch_size, sequence_length)
442442
self.clear_requests()
@@ -453,7 +453,7 @@ def half(self):
453453
def clear_requests(self):
454454
if self._compile_only:
455455
raise ValueError(
456-
"`clear_requests()` is not supported with `compile_only` mode, please intialize model without this option"
456+
"`clear_requests()` is not supported with `compile_only` mode, please initialize model without this option"
457457
)
458458
self.encoder.request = None
459459
self.decoder.request = None

optimum/intel/openvino/modeling_text2speech.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def __init__(
235235
def clear_requests(self):
236236
if self._compile_only:
237237
raise ValueError(
238-
"`clear_requests()` is not supported with `compile_only` mode, please intialize model without this option"
238+
"`clear_requests()` is not supported with `compile_only` mode, please initialize model without this option"
239239
)
240240

241241
for _, component in self.components.items():

0 commit comments

Comments
 (0)