Unverified Commit e489ad7a authored by Russell Bryant's avatar Russell Bryant Committed by GitHub
Browse files

[Misc] Add SPDX-License-Identifier headers to python source files (#12628)

- **Add SPDX license headers to python source files**
- **Check for SPDX headers using pre-commit**

commit 9d7ef44c3cfb72ca4c32e1c677d99259d10d4745
Author: Russell Bryant <rbryant@redhat.com>
Date:   Fri Jan 31 14:18:24 2025 -0500

    Add SPDX license headers to python source files
    
This commit adds SPDX license headers to python source files as
recommended to
the project by the Linux Foundation. These headers provide a concise way
that is
both human and machine readable for communicating license information
for each
source file. It helps avoid any ambiguity about the license of the code
and can
    also be easily used by tools to help manage license compliance.
    
The Linux Foundation runs license scans against the codebase to help
ensure
    we are in compliance with the licenses of the code we use, including
dependencies. Having these headers in place helps that tool do its job.
    
    More information can be found on the SPDX site:
    
    - https://spdx.dev/learn/handling-license-info/

Signed-off-by: default avatarRussell Bryant <rbryant@redhat.com>

commit 5a1cf1cb3b80759131c73f6a9dddebccac039dea
Author: Russell Bryant <rbryant@redhat.com>
Date:   Fri Jan 31 14:36:32 2025 -0500

    Check for SPDX headers using pre-commit
Signed-off-by: default avatarRussell Bryant <rbryant@redhat.com>

---------
Signed-off-by: default avatarRussell Bryant <rbryant@redhat.com>
parent f256ebe4
# SPDX-License-Identifier: Apache-2.0
from functools import cached_property from functools import cached_property
from importlib.util import find_spec from importlib.util import find_spec
from typing import Dict, Optional, Tuple from typing import Dict, Optional, Tuple
......
# SPDX-License-Identifier: Apache-2.0
# Adapted from # Adapted from
# https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/llama/modeling_llama.py # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/llama/modeling_llama.py
# https://huggingface.co/Qwen/Qwen-7B/blob/main/modeling_qwen.py # https://huggingface.co/Qwen/Qwen-7B/blob/main/modeling_qwen.py
......
# SPDX-License-Identifier: Apache-2.0
# Adapted from # Adapted from
# https://github.com/huggingface/transformers/blob/v4.33.2/src/transformers/models/llama/modeling_llama.py # https://github.com/huggingface/transformers/blob/v4.33.2/src/transformers/models/llama/modeling_llama.py
# Copyright 2023 The vLLM team. # Copyright 2023 The vLLM team.
......
# SPDX-License-Identifier: Apache-2.0
"""A layer that samples the next tokens from the model's outputs.""" """A layer that samples the next tokens from the model's outputs."""
import itertools import itertools
import warnings import warnings
......
# SPDX-License-Identifier: Apache-2.0
from abc import abstractmethod from abc import abstractmethod
from typing import Dict, Optional, Union from typing import Dict, Optional, Union
......
# SPDX-License-Identifier: Apache-2.0
import torch import torch
import torch.jit import torch.jit
......
# SPDX-License-Identifier: Apache-2.0
"""Utility methods for model layers.""" """Utility methods for model layers."""
from typing import Tuple from typing import Tuple
......
# SPDX-License-Identifier: Apache-2.0
from dataclasses import dataclass from dataclasses import dataclass
from typing import List, Optional, Sequence, Tuple from typing import List, Optional, Sequence, Tuple
......
# SPDX-License-Identifier: Apache-2.0
from torch import nn from torch import nn
from vllm.config import VllmConfig from vllm.config import VllmConfig
......
# SPDX-License-Identifier: Apache-2.0
# ruff: noqa: SIM117 # ruff: noqa: SIM117
import collections import collections
import copy import copy
......
# SPDX-License-Identifier: Apache-2.0
"""Utilities for selecting and loading neuron models.""" """Utilities for selecting and loading neuron models."""
import copy import copy
import importlib import importlib
......
# SPDX-License-Identifier: Apache-2.0
# ruff: noqa: SIM117 # ruff: noqa: SIM117
from pathlib import Path from pathlib import Path
from typing import List, Optional, Tuple from typing import List, Optional, Tuple
......
# SPDX-License-Identifier: Apache-2.0
import argparse import argparse
import dataclasses import dataclasses
import io import io
......
# SPDX-License-Identifier: Apache-2.0
"""Utilities for selecting and loading models.""" """Utilities for selecting and loading models."""
import contextlib import contextlib
from dataclasses import dataclass, field from dataclasses import dataclass, field
......
# SPDX-License-Identifier: Apache-2.0
"""Utilities for downloading and initializing model weights.""" """Utilities for downloading and initializing model weights."""
import fnmatch import fnmatch
import glob import glob
......
# SPDX-License-Identifier: Apache-2.0
from .interfaces import (HasInnerState, SupportsLoRA, SupportsMultiModal, from .interfaces import (HasInnerState, SupportsLoRA, SupportsMultiModal,
SupportsPP, has_inner_state, supports_lora, SupportsPP, has_inner_state, supports_lora,
supports_multimodal, supports_pp) supports_multimodal, supports_pp)
......
# SPDX-License-Identifier: Apache-2.0
from collections.abc import Iterable from collections.abc import Iterable
from typing import TYPE_CHECKING, Any, Optional, TypeVar from typing import TYPE_CHECKING, Any, Optional, TypeVar
......
# SPDX-License-Identifier: Apache-2.0
"""Inference-only Snowflake Arctic model.""" """Inference-only Snowflake Arctic model."""
from typing import Iterable, List, Optional, Set, Tuple, Union from typing import Iterable, List, Optional, Set, Tuple, Union
......
# SPDX-License-Identifier: Apache-2.0
from typing import (Iterable, List, Mapping, Optional, Set, Tuple, TypedDict, from typing import (Iterable, List, Mapping, Optional, Set, Tuple, TypedDict,
Union) Union)
......
# SPDX-License-Identifier: Apache-2.0
# Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved. # Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved.
# #
# This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX # This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment