Qihoo360 / 360zhinao

360zhinao
Apache License 2.0
278 stars 22 forks source link

when run rerank model demo error... #18

Closed hegang1-tal closed 3 months ago

hegang1-tal commented 3 months ago

when run test_rerank.py error occurs as below:

File "/root/.cache/huggingface/modules/transformers_modules/360Zhinao-1-8B-Reranking/modeling_zhinao.py", line 711, in forward layer_outputs = decoder_layer( ^^^^^^^^^^^^^^ File "/mnt/pfs/jinfeng_team/APP/kangningfei/miniconda/envs/langchain/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl return self._call_impl(*args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/pfs/jinfeng_team/APP/kangningfei/miniconda/envs/langchain/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl return forward_call(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.cache/huggingface/modules/transformers_modules/360Zhinao-1-8B-Reranking/modeling_zhinao.py", line 513, in forward hidden_states, self_attn_weights, present_key_value = self.self_attn( ^^^^^^^^^^^^^^^ File "/mnt/miniconda/envs/langchain/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl return self._call_impl(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/miniconda/envs/langchain/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl return forward_call(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.cache/huggingface/modules/transformers_modules/360Zhinao-1-8B-Reranking/modeling_zhinao.py", line 416, in forward attn_output = self.flash_attention(query_states, key_states, value_states, attention_mask) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.cache/huggingface/modules/transformers_modules/360Zhinao-1-8B-Reranking/modeling_zhinao.py", line 345, in flash_attention query_states, key_states, value_states, indices_q, cu_seq_lens, max_seq_lens = self._upad_input( ^^^^^^^^^^^^^^^^^ File "/root/.cache/huggingface/modules/transformers_modules/360Zhinao-1-8B-Reranking/modeling_zhinao.py", line 442, in _upad_input key_layer = index_first_axis(key_layer.reshape(batch_size kv_seq_len, num_heads, head_dim), indices_k) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: 'NoneType' object is not callable