File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 28
28
from transformers import AutoTokenizer , CLIPTokenizer , PreTrainedTokenizer , PreTrainedTokenizerFast
29
29
from transformers .onnx .utils import ParameterFormat , compute_serialized_parameters_size
30
30
31
+ from optimum .intel .utils .import_utils import is_torch_version
32
+
31
33
32
34
logger = logging .getLogger (__name__ )
33
35
74
76
"i8" : torch .int8 ,
75
77
"u8" : torch .uint8 ,
76
78
"i16" : torch .int16 ,
77
- "u16" : torch .uint16 ,
78
79
"i32" : torch .int32 ,
79
- "u32" : torch .uint32 ,
80
80
"i64" : torch .int64 ,
81
- "u64" : torch .uint64 ,
82
81
"f16" : torch .float16 ,
83
82
"f32" : torch .float32 ,
84
83
"f64" : torch .float64 ,
85
84
}
86
85
86
+ if is_torch_version (">=" , "2.4.0" ):
87
+ OV_TO_PT_TYPE .update ({"u16" : torch .uint16 , "u32" : torch .uint32 , "u64" : torch .uint64 })
88
+
87
89
88
90
STR_TO_OV_TYPE = {
89
91
"boolean" : OVType .boolean ,
You can’t perform that action at this time.
0 commit comments