You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RuntimeError: Unsloth: microsoft/Phi-3-mini-128k-instruct is not a base model or a PEFT model. #727
!pipinstall"unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
!pipinstall--no-depsxformers"trl<0.9.0"peftacceleratebitsandbytesfromunslothimportFastLanguageModelimporttorchmax_seq_length=2048# Choose any! We auto support RoPE Scaling internally!dtype=None# None for auto detection. Float16 for Tesla T4, V100, Bfloat16 for Ampere+load_in_4bit=True# Use 4bit quantization to reduce memory usage. Can be False.model, tokenizer=FastLanguageModel.from_pretrained(
model_name="microsoft/Phi-3-mini-128k-instruct", # Choose ANY! eg teknium/OpenHermes-2.5-Mistral-7Bmax_seq_length=max_seq_length,
dtype=dtype,
load_in_4bit=load_in_4bit,
# token = "hf_...", # use one if using gated models like meta-llama/Llama-2-7b-hf
)
This is even when installing the most-current transformers version manually (pip install -U git+https://github.com/huggingface/transformers.git); loading with AutoModelForCausalLM.from_pretrained("microsoft/Phi-3-mini-128k-instruct", trust_remote_code=True, device_map="auto") works.
I have the same problem for my code:
from unsloth import FastLanguageModel
max_seq_length = 2500 # Choose any! We auto support RoPE Scaling internally!
dtype = None # None for auto detection. Float16 for Tesla T4, V100, Bfloat16 for Ampere+
load_in_4bit = True # Use 4bit quantization to reduce memory usage. Can be False.
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "", # YOUR MODEL YOU USED FOR TRAINING
max_seq_length = max_seq_length,
dtype = dtype,
load_in_4bit = load_in_4bit,
)
FastLanguageModel.for_inference(model)
For 128K - Phi is not supported yet.
If you're referring to the Gemma issue - it seems like @Ad1ture is having Windows issues? Sadly we don't normally test on Windows
This should be fixed now - sorry on the delay - please update with uv pip install --upgrade unsloth unsloth_zoo --force-reinstall --no-cache-dir - if it's not fixed yet, it'll be in the next pip / PyPI release - if it's still not working after that, please open another issue - appreciate it again!
Phi-3-mini-128k now loads via the transformers-native path with LongRoPE, so the 'not a base model' error no longer fires.
Activity
danielhanchen commentedon Jul 6, 2024
Oh yep sadly RoPE embeddings for the long context one are a bit hard to support - I'll recheck this and get back to you!
Ad1ture commentedon Jul 7, 2024
Facing the same issue with Gemma2 local. But fine with Llama3 local. Anything new find out?
danielhanchen commentedon Jul 7, 2024
@Ad1ture Could you try updating and reinstalling Unsloth on your local device?
Ad1ture commentedon Jul 8, 2024
Thanks. I'll try. Considering lots of issues of installing unsloth on my windows before, I'll create a new venv and try this.
gulsumbudakoglu commentedon Jul 16, 2024
I have the same problem for my code:
from unsloth import FastLanguageModel
Are there any update about the error??
danielhanchen commentedon Jul 18, 2024
For 128K - Phi is not supported yet.
If you're referring to the Gemma issue - it seems like @Ad1ture is having Windows issues? Sadly we don't normally test on Windows
Re-trigger CI now that unsloth-zoo unslothai#727 is merged (Core pull…
Studio: stop leaking internal exceptions to API clients; harden sandb…
danielhanchen commentedon Jul 14, 2026
This should be fixed now - sorry on the delay - please update with
uv pip install --upgrade unsloth unsloth_zoo --force-reinstall --no-cache-dir- if it's not fixed yet, it'll be in the next pip / PyPI release - if it's still not working after that, please open another issue - appreciate it again!Phi-3-mini-128k now loads via the transformers-native path with LongRoPE, so the 'not a base model' error no longer fires.