Skip to content

Commit

Permalink
fix import
Browse files Browse the repository at this point in the history
  • Loading branch information
echarlaix committed Jun 26, 2024
1 parent c1ee8ac commit c109250
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions optimum/exporters/openvino/model_patcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -1181,10 +1181,9 @@ def _phi3_self_attn_sdpa_forward(
use_cache=use_cache,
)

# TO DO: remove llama imports when transformers with phi3 support will be released
try:
from transformers.models.phi3.modelling_phi3 import apply_rotary_pos_emb, repeat_kv
except ImportError:
if is_transformers_version(">=", "4.41.0"):
from transformers.models.phi3.modeling_phi3 import apply_rotary_pos_emb, repeat_kv
else:
from transformers.models.llama.modeling_llama import apply_rotary_pos_emb, repeat_kv

bsz, q_len, _ = hidden_states.size()
Expand Down

0 comments on commit c109250

Please sign in to comment.