python - Does unsloth support cache directory for models? - Stack Overflow

I want to download a model from hugging face to be used with unsloth for trainig:from unsloth import F

I want to download a model from hugging face to be used with unsloth for trainig:

from unsloth import FastLanguageModel,

max_seq_length = 16384
model, tokenizer = FastLanguageModel.from_pretrained(
    model_name="unsloth/Llama-3.2-1B-Instruct",
    max_seq_length=max_seq_length,
    load_in_4bit=False,
)

However, this method doesn't seem to allow any sort of local caching, it downloads the whole model from hugging face every time.

My question: How can I load unsloth model from local hard drive?

I want to download a model from hugging face to be used with unsloth for trainig:

from unsloth import FastLanguageModel,

max_seq_length = 16384
model, tokenizer = FastLanguageModel.from_pretrained(
    model_name="unsloth/Llama-3.2-1B-Instruct",
    max_seq_length=max_seq_length,
    load_in_4bit=False,
)

However, this method doesn't seem to allow any sort of local caching, it downloads the whole model from hugging face every time.

My question: How can I load unsloth model from local hard drive?

Share Improve this question asked Nov 18, 2024 at 20:33 MattMatt 256 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Turns out it is actually really simple, you load the model like this:

from unsloth import FastLanguageModel,

model, tokenizer = FastLanguageModel.from_pretrained(
    "/content/model"
)

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745595849a4635108.html

相关推荐

  • python - Does unsloth support cache directory for models? - Stack Overflow

    I want to download a model from hugging face to be used with unsloth for trainig:from unsloth import F

    11小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信