declare-lab / flan-alpaca-xl-lora

huggingface.co
Total runs: 0
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: June 09 2023

Introduction of flan-alpaca-xl-lora

Model Details of flan-alpaca-xl-lora

🍮 🦙 Flan-Alpaca: Instruction Tuning from Humans and Machines

📣 Curious to know the performance of 🍮 🦙 Flan-Alpaca on large-scale LLM evaluation benchmark, InstructEval ? Read our paper https://arxiv.org/pdf/2306.04757.pdf . We evaluated more than 10 open-source instruction-tuned LLMs belonging to various LLM families including Pythia, LLaMA, T5, UL2, OPT, and Mosaic. Codes and datasets: https://github.com/declare-lab/instruct-eval

Our repository contains code for extending the Stanford Alpaca synthetic instruction tuning to existing instruction-tuned models such as Flan-T5 . The pretrained models and demos are available on HuggingFace 🤗 :

Model Parameters Training GPUs
Flan-Alpaca-Base 220M 1x A6000
Flan-Alpaca-Large 770M 1x A6000
Flan-Alpaca-XL 3B 1x A6000
Flan-Alpaca-XXL 11B 4x A6000 (FSDP)
Why?

Alpaca represents an exciting new direction to approximate the performance of large language models (LLMs) like ChatGPT cheaply and easily. Concretely, they leverage an LLM such as GPT-3 to generate instructions as synthetic training data. The synthetic data which covers more than 50k tasks can then be used to finetune a smaller model. However, the original implementation is less accessible due to licensing constraints of the underlying LLaMA model. Furthermore, users have noted potential noise in the synthetic dataset. Hence, it may be better to explore a fully accessible model that is already trained on high-quality (but less diverse) instructions such as Flan-T5 .

Usage

This uses Huggingface PEFT library for Parameter Efficient Fine Tuning

import torch
from peft import PeftModel
from transformers import GenerationConfig


from transformers import AutoTokenizer, AutoModelForSeq2SeqLM


BASE_MODEL = "google/flan-t5-xl"
LORA_WEIGHTS = "declare-lab/flan-alpaca-xl-lora"
TEMPERATURE = 1.0
TOP_P = 0.75
TOP_K = 40
NUM_BEAMS = 4
MAX_NEW_TOKENS = 128

if torch.cuda.is_available():
    device = "cuda"
else:
    device = "cpu"


if device == "cuda":
    model = AutoModelForSeq2SeqLM.from_pretrained(
        BASE_MODEL,
        device_map="auto",
    )
    model = PeftModel.from_pretrained(model, LORA_WEIGHTS, force_download=True)
else:
    model = AutoModelForSeq2SeqLM.from_pretrained(
        BASE_MODEL, device_map={"": device}, low_cpu_mem_usage=True
    )
    model = PeftModel.from_pretrained(
        model,
        LORA_WEIGHTS,
        device_map={"": device},
    )


prompt = "Write a short email to show that 42 is the optimal seed for training neural networks"

tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
input_ids = tokenizer(prompt, return_tensors="pt").input_ids
input_ids = input_ids.to(device)

generation_config = GenerationConfig(
    temperature=TEMPERATURE,
    top_p=TOP_P,
    top_k=TOP_K,
    num_beams=NUM_BEAMS,
)
generation_output = model.generate(
    input_ids=input_ids,
    generation_config=generation_config,
    return_dict_in_generate=True,
    output_scores=True,
    max_new_tokens=MAX_NEW_TOKENS,
)
print(tokenizer.batch_decode(generation_output.sequences)[0])

Runs of declare-lab flan-alpaca-xl-lora on huggingface.co

0
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About flan-alpaca-xl-lora huggingface.co Model

More flan-alpaca-xl-lora license Visit here:

https://choosealicense.com/licenses/apache-2.0

flan-alpaca-xl-lora huggingface.co

flan-alpaca-xl-lora huggingface.co is an AI model on huggingface.co that provides flan-alpaca-xl-lora's model effect (), which can be used instantly with this declare-lab flan-alpaca-xl-lora model. huggingface.co supports a free trial of the flan-alpaca-xl-lora model, and also provides paid use of the flan-alpaca-xl-lora. Support call flan-alpaca-xl-lora model through api, including Node.js, Python, http.

flan-alpaca-xl-lora huggingface.co Url

https://huggingface.co/declare-lab/flan-alpaca-xl-lora

declare-lab flan-alpaca-xl-lora online free

flan-alpaca-xl-lora huggingface.co is an online trial and call api platform, which integrates flan-alpaca-xl-lora's modeling effects, including api services, and provides a free online trial of flan-alpaca-xl-lora, you can try flan-alpaca-xl-lora online for free by clicking the link below.

declare-lab flan-alpaca-xl-lora online free url in huggingface.co:

https://huggingface.co/declare-lab/flan-alpaca-xl-lora

flan-alpaca-xl-lora install

flan-alpaca-xl-lora is an open source model from GitHub that offers a free installation service, and any user can find flan-alpaca-xl-lora on GitHub to install. At the same time, huggingface.co provides the effect of flan-alpaca-xl-lora install, users can directly use flan-alpaca-xl-lora installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

flan-alpaca-xl-lora install url in huggingface.co:

https://huggingface.co/declare-lab/flan-alpaca-xl-lora

Url of flan-alpaca-xl-lora

flan-alpaca-xl-lora huggingface.co Url

Provider of flan-alpaca-xl-lora huggingface.co

declare-lab
ORGANIZATIONS

Other API from declare-lab

huggingface.co

Total runs: 4.1K
Run Growth: 2.7K
Growth Rate: 64.99%
Updated:December 17 2023
huggingface.co

Total runs: 234
Run Growth: -323
Growth Rate: -138.03%
Updated:August 28 2025
huggingface.co

Total runs: 181
Run Growth: -194
Growth Rate: -107.18%
Updated:August 28 2025
huggingface.co

Total runs: 102
Run Growth: 47
Growth Rate: 46.08%
Updated:January 28 2025
huggingface.co

Total runs: 89
Run Growth: 27
Growth Rate: 30.34%
Updated:January 18 2026
huggingface.co

Total runs: 87
Run Growth: -13
Growth Rate: -14.94%
Updated:August 01 2025
huggingface.co

Total runs: 54
Run Growth: -4
Growth Rate: -7.41%
Updated:January 18 2026
huggingface.co

Total runs: 49
Run Growth: 0
Growth Rate: 0.00%
Updated:December 11 2025
huggingface.co

Total runs: 17
Run Growth: 2
Growth Rate: 11.76%
Updated:October 24 2022