@@ -164,6 +164,7 @@ def _from_pretrained(
164
164
from_onnx : bool = False ,
165
165
local_files_only : bool = False ,
166
166
load_in_8bit : bool = False ,
167
+ load_in_4bit : bool = False ,
167
168
** kwargs ,
168
169
):
169
170
"""
@@ -193,8 +194,11 @@ def _from_pretrained(
193
194
Whether or not to only look at local files (i.e., do not try to download the model).
194
195
load_in_8bit (`bool`, *optional*, defaults to `False`):
195
196
Whether or not to apply 8-bit weight quantization.
197
+ load_in_4bit (`bool`, *optional*, defaults to `False`):
198
+ Whether or not to apply 4-bit weight quantization.
196
199
"""
197
-
200
+ if load_in_4bit :
201
+ raise ValueError ("load_in_4bit is available for OVModelForCausalLM only." )
198
202
model_path = Path (model_id )
199
203
default_file_name = ONNX_WEIGHTS_NAME if from_onnx else OV_XML_FILE_NAME
200
204
file_name = file_name or default_file_name
@@ -262,6 +266,7 @@ def _from_transformers(
262
266
task : Optional [str ] = None ,
263
267
trust_remote_code : bool = False ,
264
268
load_in_8bit : Optional [bool ] = None ,
269
+ load_in_4bit : Optional [bool ] = None ,
265
270
** kwargs ,
266
271
):
267
272
"""
0 commit comments