File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
python/llm/src/ipex_llm/transformers/models Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change 36
36
import torch .nn .functional as F
37
37
38
38
from typing import List , Optional
39
+ from ipex_llm .utils .common .log4Error import invalidInputError
39
40
40
41
41
42
def extract_key_value (self , hidden , state = None ):
@@ -265,6 +266,8 @@ def rwkv_model_forward(
265
266
output_hidden_states : Optional [bool ] = None ,
266
267
return_dict : Optional [bool ] = None ,
267
268
):
269
+ invalidInputError (self .embeddings .weight .dtype == torch .float ,
270
+ "Only fp32 is supported for now, fp16 and bf16 are not supported" )
268
271
use_cache = use_cache if use_cache is not None else self .config .use_cache
269
272
# change `state` layout and put `num_hidden_layers` to the highest dim
270
273
if input_ids .device .type == "xpu" and use_cache and state is None :
You can’t perform that action at this time.
0 commit comments