Skip to content

How load Loar from Hugging Face ? #596

@a442509097

Description

@a442509097

My Colab has very limited runtime, So I used Kaggle to train Lora and uploaded it to Huggingface, then Colab load Lora form Huggingface

model.save_pretrained("/kaggle/working/outputs")  # Local saving
tokenizer.save_pretrained("/kaggle/working/outputs")

But when i use Colab prompt "Should have a model_type key in its config. json" , so i add "model_type": "llama" to config.json. then prompt "Your session crashed after using all available ROM." What step did I do wrong?

from transformers import AutoModel, AutoTokenizer

model_name = "temp123/lora_model"  
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModel.from_pretrained(model_name)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions