nbeerbower / llama-3-gutenberg-8B

huggingface.co
Total runs: 34
24-hour runs: 0
7-day runs: 4
30-day runs: 12
Model's Last Updated: January 01 2025
text-generation

Introduction of llama-3-gutenberg-8B

Model Details of llama-3-gutenberg-8B

llama-3-gutenberg-8B

This model is based on Llama-3-8b, and is governed by META LLAMA 3 COMMUNITY LICENSE AGREEMENT

nbeerbower/llama-3-bophades-v3-8B finetuned on jondurbin/gutenberg-dpo-v0.1 .

Method

Finetuned using an A100 on Google Colab.

Fine-Tune Your Own Llama 2 Model in a Colab Notebook

Configuration

Dataset preparation, system prompt:

def chatml_format(example):

    # Format instruction
    prompt = "<|im_start|>user\n" + example['prompt'] + "<|im_end|>\n<|im_start|>assistant\n"

    # Format chosen answer
    chosen = example['chosen'] + "<|im_end|>\n"

    # Format rejected answer
    rejected = example['rejected'] + "<|im_end|>\n"

    return {
        "prompt": prompt,
        "chosen": chosen,
        "rejected": rejected,
    }

dataset = load_dataset("jondurbin/gutenberg-dpo-v0.1")['train']

# Save columns
original_columns = dataset.column_names

# Tokenizer
tokenizer = AutoTokenizer.from_pretrained(model_name)
tokenizer.pad_token = tokenizer.eos_token
tokenizer.padding_side = "left"

# Format dataset
dataset = dataset.map(
    chatml_format,
    remove_columns=original_columns
)

LoRA, model, and training settings:

# LoRA configuration
peft_config = LoraConfig(
    r=16,
    lora_alpha=16,
    lora_dropout=0.05,
    bias="none",
    task_type="CAUSAL_LM",
    target_modules=['k_proj', 'gate_proj', 'v_proj', 'up_proj', 'q_proj', 'o_proj', 'down_proj']
)

# Model to fine-tune
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype=torch.bfloat16,
    load_in_4bit=True
)
model.config.use_cache = False

# Reference model
ref_model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype=torch.bfloat16,
    load_in_4bit=True
)

# Training arguments
training_args = TrainingArguments(
    per_device_train_batch_size=2,
    gradient_accumulation_steps=2,
    gradient_checkpointing=True,
    learning_rate=2e-5,
    lr_scheduler_type="cosine",
    max_steps=1000,
    save_strategy="no",
    logging_steps=1,
    output_dir=new_model,
    optim="paged_adamw_32bit",
    warmup_steps=100,
    bf16=True,
    report_to="wandb",
)

# Create DPO trainer
dpo_trainer = DPOTrainer(
    model,
    ref_model,
    args=training_args,
    train_dataset=dataset,
    tokenizer=tokenizer,
    peft_config=peft_config,
    beta=0.1,
    max_prompt_length=1024,
    max_length=1536,
    force_use_ref_model=True
)

Runs of nbeerbower llama-3-gutenberg-8B on huggingface.co

34
Total runs
0
24-hour runs
4
3-day runs
4
7-day runs
12
30-day runs

More Information About llama-3-gutenberg-8B huggingface.co Model

More llama-3-gutenberg-8B license Visit here:

https://choosealicense.com/licenses/llama3

llama-3-gutenberg-8B huggingface.co

llama-3-gutenberg-8B huggingface.co is an AI model on huggingface.co that provides llama-3-gutenberg-8B's model effect (), which can be used instantly with this nbeerbower llama-3-gutenberg-8B model. huggingface.co supports a free trial of the llama-3-gutenberg-8B model, and also provides paid use of the llama-3-gutenberg-8B. Support call llama-3-gutenberg-8B model through api, including Node.js, Python, http.

llama-3-gutenberg-8B huggingface.co Url

https://huggingface.co/nbeerbower/llama-3-gutenberg-8B

nbeerbower llama-3-gutenberg-8B online free

llama-3-gutenberg-8B huggingface.co is an online trial and call api platform, which integrates llama-3-gutenberg-8B's modeling effects, including api services, and provides a free online trial of llama-3-gutenberg-8B, you can try llama-3-gutenberg-8B online for free by clicking the link below.

nbeerbower llama-3-gutenberg-8B online free url in huggingface.co:

https://huggingface.co/nbeerbower/llama-3-gutenberg-8B

llama-3-gutenberg-8B install

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

llama-3-gutenberg-8B install url in huggingface.co:

https://huggingface.co/nbeerbower/llama-3-gutenberg-8B

Url of llama-3-gutenberg-8B

llama-3-gutenberg-8B huggingface.co Url

Provider of llama-3-gutenberg-8B huggingface.co

nbeerbower
ORGANIZATIONS

Other API from nbeerbower

huggingface.co

Total runs: 87
Run Growth: 23
Growth Rate: 26.44%
Updated:February 05 2024