Retrieval_Head icon indicating copy to clipboard operation
Retrieval_Head copied to clipboard

Errors with Phi3 models and how to run the code with the model Yi-6B-200K?

Open HayeonLee opened this issue 1 year ago • 1 comments

Hi, thank you for the awsome code!

When I run python retrieval_head_detection.py --model_path microsoft/Phi-3-mini-128k-instruct --s 0 --e 50000, I got the following errors: image

Could you share the tips to fix this error or the transformer version you used?

Thank you!

HayeonLee avatar Aug 03 '24 00:08 HayeonLee

Hey @HayeonLee , I faced the similar issue. I solved it by using the following code: https://huggingface.co/microsoft/Phi-3.5-mini-instruct/blob/main/modeling_phi3.py

You need to add Phi3LongRoPEScaledRotaryEmbedding class from the above code into modeling_phi3.py file. Also add type longrope here and call the Phi3LongRoPEScaledRotaryEmbedding class. You can check the above code for reference.

shaswatpatel123 avatar Mar 14 '25 22:03 shaswatpatel123