Skip to content

Commit

Permalink
fromat
Browse files Browse the repository at this point in the history
  • Loading branch information
echarlaix committed Oct 16, 2023
1 parent 7a08831 commit 906b3a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion optimum/intel/neural_compressor/modeling_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ def _from_pretrained(
msg = f"Quantized model was obtained with torch version {inc_config.torch_version} but {_torch_version} was found."
logger.warning(f"{msg}")
except EnvironmentError:
msg = f"Please check if torch quantization the model was obtained with is compatible with {_torch_version}."
msg = (
f"Please check if torch quantization the model was obtained with is compatible with {_torch_version}."
)

if getattr(config, "backend", None) == "ipex" or getattr(config, "torchscript", False):
# NOTE: Will improve to use load function when Intel Neural Compressor next 2.1 release.
Expand Down
3 changes: 2 additions & 1 deletion optimum/intel/utils/import_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import sys
from collections import OrderedDict
from typing import Union

from packaging.version import Version, parse


Expand Down Expand Up @@ -205,7 +206,7 @@ def is_torch_version(operation: str, version: str):
if not _torch_available:
return False

import torch
import torch

return compare_versions(parse(parse(torch.__version__).base_version), operation, version)

Expand Down

0 comments on commit 906b3a3

Please sign in to comment.