|
20 | 20 |
|
21 | 21 | import openvino
|
22 | 22 | from huggingface_hub import hf_hub_download
|
| 23 | +from huggingface_hub.constants import HUGGINGFACE_HUB_CACHE |
23 | 24 | from openvino import Core, convert_model
|
24 | 25 | from openvino._offline_transformations import apply_moc_transformations, compress_model_transformation
|
25 | 26 | from transformers import GenerationConfig, PretrainedConfig
|
@@ -171,7 +172,7 @@ def _from_pretrained(
|
171 | 172 | use_auth_token: Optional[Union[bool, str, None]] = None,
|
172 | 173 | revision: Optional[Union[str, None]] = None,
|
173 | 174 | force_download: bool = False,
|
174 |
| - cache_dir: Optional[str] = None, |
| 175 | + cache_dir: str = HUGGINGFACE_HUB_CACHE, |
175 | 176 | file_name: Optional[str] = None,
|
176 | 177 | subfolder: str = "",
|
177 | 178 | from_onnx: bool = False,
|
@@ -300,7 +301,7 @@ def _from_transformers(
|
300 | 301 | use_auth_token: Optional[Union[bool, str]] = None,
|
301 | 302 | revision: Optional[str] = None,
|
302 | 303 | force_download: bool = False,
|
303 |
| - cache_dir: Optional[str] = None, |
| 304 | + cache_dir: str = HUGGINGFACE_HUB_CACHE, |
304 | 305 | subfolder: str = "",
|
305 | 306 | local_files_only: bool = False,
|
306 | 307 | task: Optional[str] = None,
|
@@ -368,7 +369,7 @@ def _to_load(
|
368 | 369 | use_auth_token: Optional[Union[bool, str]] = None,
|
369 | 370 | revision: Optional[str] = None,
|
370 | 371 | force_download: bool = False,
|
371 |
| - cache_dir: Optional[str] = None, |
| 372 | + cache_dir: str = HUGGINGFACE_HUB_CACHE, |
372 | 373 | local_files_only: bool = False,
|
373 | 374 | stateful: bool = False,
|
374 | 375 | **kwargs,
|
|
0 commit comments