Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/scripts/check_copyright_header.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

import re
from pathlib import Path
Expand All @@ -8,7 +8,7 @@
PATTERN = "(Meta Platforms, Inc. and affiliates)|(Facebook, Inc(\.|,)? and its affiliates)|([0-9]{4}-present(\.|,)? Facebook)|([0-9]{4}(\.|,)? Facebook)"

HEADER = """# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.\n\n"""
# This software may be used and distributed according to the terms of the Llama Community License Agreement.\n\n"""

#Files in black list must be relative to main repo folder
BLACKLIST = ["tools/benchmarks/llm_eval_harness/open_llm_leaderboard/hellaswag_utils.py"]
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/spellcheck.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.
# Source: https://github.com/pytorch/torchx/blob/main/scripts/spellcheck.sh
set -ex
sudo apt-get install aspell
Expand Down
2 changes: 1 addition & 1 deletion 3p-integrations/tgi/merge_lora_weights.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

import fire
import torch
Expand Down
2 changes: 1 addition & 1 deletion 3p-integrations/vllm/inference.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 3 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

import uuid
import asyncio
Expand Down
2 changes: 1 addition & 1 deletion end-to-end-use-cases/RAFT-Chatbot/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 3 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

import yaml

Expand Down
2 changes: 1 addition & 1 deletion end-to-end-use-cases/RAFT-Chatbot/raft_eval.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 3 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.
import logging
import evaluate
import argparse
Expand Down
2 changes: 1 addition & 1 deletion end-to-end-use-cases/RAFT-Chatbot/raft_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 3 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

import os
import logging
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 3 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

import csv
import json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

import csv
import json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 3 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

import csv
import json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 3 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

import csv
import json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 3 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

import argparse
import errno
Expand Down
2 changes: 1 addition & 1 deletion end-to-end-use-cases/coding/text2sql/csv2db.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 3 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

import sqlite3
import csv
Expand Down
2 changes: 1 addition & 1 deletion end-to-end-use-cases/coding/text2sql/txt2csv.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 3 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

import csv

Expand Down
2 changes: 1 addition & 1 deletion getting-started/finetuning/datasets/custom_dataset.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 3 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

# For dataset details visit: https://huggingface.co/datasets/samsum

Expand Down
2 changes: 1 addition & 1 deletion getting-started/finetuning/datasets/ocrvqa_dataset.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 3 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.


import copy
Expand Down
2 changes: 1 addition & 1 deletion getting-started/finetuning/datasets/raft_dataset.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 3 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.


import copy
Expand Down
2 changes: 1 addition & 1 deletion getting-started/finetuning/finetuning.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 3 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

import fire
from llama_cookbook.finetuning import main
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"metadata": {},
"source": [
"Copyright (c) Meta Platforms, Inc. and affiliates.\n",
"This software may be used and distributed according to the terms of the Llama 3 Community License Agreement.\n",
"This software may be used and distributed according to the terms of the Llama Community License Agreement.\n",
"\n",
"<a href=\"https://colab.research.google.com/github/meta-llama/llama-cookbook/blob/main/getting-started/finetuning/quickstart_peft_finetuning.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 3 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

# from accelerate import init_empty_weights, load_checkpoint_and_dispatch

Expand Down
2 changes: 1 addition & 1 deletion getting-started/inference/local_inference/inference.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 3 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

import os
import sys
Expand Down
2 changes: 1 addition & 1 deletion src/llama_cookbook/configs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

from llama_cookbook.configs.peft import lora_config, llama_adapter_config, prefix_config
from llama_cookbook.configs.fsdp import fsdp_config
Expand Down
2 changes: 1 addition & 1 deletion src/llama_cookbook/configs/datasets.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

from dataclasses import dataclass

Expand Down
2 changes: 1 addition & 1 deletion src/llama_cookbook/configs/fsdp.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

from dataclasses import dataclass

Expand Down
2 changes: 1 addition & 1 deletion src/llama_cookbook/configs/peft.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

from dataclasses import dataclass, field
from typing import List
Expand Down
2 changes: 1 addition & 1 deletion src/llama_cookbook/configs/quantization.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

from dataclasses import dataclass
from typing import Optional
Expand Down
2 changes: 1 addition & 1 deletion src/llama_cookbook/configs/training.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

from dataclasses import dataclass

Expand Down
2 changes: 1 addition & 1 deletion src/llama_cookbook/configs/wandb.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

from typing import List, Optional
from dataclasses import dataclass, field
Expand Down
2 changes: 1 addition & 1 deletion src/llama_cookbook/data/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.
2 changes: 1 addition & 1 deletion src/llama_cookbook/data/concatenator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

from tqdm import tqdm
from itertools import chain
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

from finetuning_data_formatter import TrainingExample, Guidelines, Category, LlamaGuardPromptConfigs, LlamaGuardGenerationConfigs, ExplanationPosition, AugmentationConfigs, FormatterConfigs, create_formatted_finetuning_examples

Expand Down
2 changes: 1 addition & 1 deletion src/llama_cookbook/data/sampler.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

import random
from itertools import islice
Expand Down
2 changes: 1 addition & 1 deletion src/llama_cookbook/datasets/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

from functools import partial

Expand Down
2 changes: 1 addition & 1 deletion src/llama_cookbook/datasets/alpaca_dataset.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

# For dataset details visit: https://crfm.stanford.edu/2023/03/13/alpaca.html

Expand Down
2 changes: 1 addition & 1 deletion src/llama_cookbook/datasets/grammar_dataset/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

# For dataset details visit: https://huggingface.co/datasets/jfleg
# For download and preparation see: recipes/ft_datasets/grammar_dataset/grammar_dataset_process.ipynb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"metadata": {},
"source": [
"Copyright (c) Meta Platforms, Inc. and affiliates.\n",
"This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.\n",
"This software may be used and distributed according to the terms of the Llama Community License Agreement.\n",
"\n",
"Use this notebook to pull in datasets and apply pre-processing. Most grammar datasets unfortunately require preprocessing before being usable in training. (example - jfleg has 4 targets per input, so we have to rematch as 1:1 pairings) "
]
Expand Down
2 changes: 1 addition & 1 deletion src/llama_cookbook/datasets/samsum_dataset.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

# For dataset details visit: https://huggingface.co/datasets/samsum

Expand Down
2 changes: 1 addition & 1 deletion src/llama_cookbook/finetuning.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

import dataclasses
import os
Expand Down
2 changes: 1 addition & 1 deletion src/llama_cookbook/inference/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.
2 changes: 1 addition & 1 deletion src/llama_cookbook/inference/chat_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

import json

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

# from accelerate import init_empty_weights, load_checkpoint_and_dispatch

Expand Down
2 changes: 1 addition & 1 deletion src/llama_cookbook/inference/prompt_format_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

from dataclasses import dataclass
from string import Template
Expand Down
2 changes: 1 addition & 1 deletion src/llama_cookbook/inference/safety_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

import os
import torch
Expand Down
2 changes: 1 addition & 1 deletion src/llama_cookbook/model_checkpointing/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

from llama_cookbook.model_checkpointing.checkpoint_handler import (
load_model_checkpoint,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

from pathlib import Path
from datetime import datetime
Expand Down
2 changes: 1 addition & 1 deletion src/llama_cookbook/policies/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

from llama_cookbook.policies.mixed_precision import *
from llama_cookbook.policies.wrapping import *
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

from functools import partial

Expand Down
2 changes: 1 addition & 1 deletion src/llama_cookbook/policies/anyprecision_optimizer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

# AnyPrecisionAdamW: a flexible precision AdamW optimizer
# with optional Kahan summation for high precision weight updates.
Expand Down
2 changes: 1 addition & 1 deletion src/llama_cookbook/policies/mixed_precision.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

import torch

Expand Down
2 changes: 1 addition & 1 deletion src/llama_cookbook/policies/wrapping.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

import functools

Expand Down
2 changes: 1 addition & 1 deletion src/llama_cookbook/tools/compare_llama_weights.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

import gc
import glob
Expand Down
2 changes: 1 addition & 1 deletion src/llama_cookbook/tools/convert_hf_weights_to_llama.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

import json
import os
Expand Down
2 changes: 1 addition & 1 deletion src/llama_cookbook/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

from llama_cookbook.utils.memory_utils import MemoryTrace
from llama_cookbook.utils.dataset_utils import *
Expand Down
2 changes: 1 addition & 1 deletion src/llama_cookbook/utils/config_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# This software may be used and distributed according to the terms of the Llama Community License Agreement.

import inspect
from dataclasses import asdict
Expand Down
Loading