[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: Russell 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: Russell Bryant <rbryant@redhat.com>

---------

Signed-off-by: Russell Bryant <rbryant@redhat.com>
This commit is contained in:
Russell Bryant
2025-02-02 11:58:18 -08:00
committed by GitHub
parent f256ebe4df
commit e489ad7a21
1012 changed files with 1884 additions and 2 deletions
+2
View File
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
from vllm.envs import VLLM_USE_MODELSCOPE
if VLLM_USE_MODELSCOPE:
+2
View File
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
import enum
import json
import os
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
from vllm.transformers_utils.configs.chatglm import ChatGLMConfig
from vllm.transformers_utils.configs.cohere2 import Cohere2Config
from vllm.transformers_utils.configs.dbrx import DbrxConfig
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# yapf: disable
# ruff: noqa: E501
# coding=utf-8
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# Adapted from
# https://github.com/THUDM/ChatGLM2-6B
from transformers import PretrainedConfig
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# ruff: noqa
# Adapted from
+2
View File
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# yapf: disable
# ruff: noqa: E501
# coding=utf-8
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# adapted from https://github.com/deepseek-ai/DeepSeek-VL2/blob/faf18023f24b962b32d9f0a2d89e402a8d383a78/deepseek_vl2/models/modeling_deepseek_vl_v2.py#L115-L268
from typing import Tuple
+2
View File
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
import os
from typing import Optional, Union
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# Copied from
# https://huggingface.co/LGAI-EXAONE/EXAONE-3.0-7.8B-Instruct/blob/main/configuration_exaone.py
# Copyright 2021 The LG AI Research EXAONE Lab. All rights reserved.
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# Adapted from
# https://huggingface.co/tiiuae/falcon-7b/blob/main/configuration_RW.py
# Copyright 2023 The vLLM team.
+2
View File
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# Adapted from
# https://huggingface.co/h2oai/h2ovl-mississippi-2b/blob/main/configuration_h2ovl_chat.py
# --------------------------------------------------------
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# Adapted from
# https://huggingface.co/OpenGVLab/InternVL2-1B/blob/main/configuration_internvl_chat.py
# --------------------------------------------------------
+2
View File
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2023 The OpenAI Team Authors and HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
# Copyright 2023 Cerebras Systems.
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
import os
from typing import Optional, Union
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
from transformers.models.mllama import configuration_mllama as mllama_hf_config
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
from typing import List, Optional
from transformers import PretrainedConfig
+2
View File
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# Copied from
# https://huggingface.co/mosaicml/mpt-7b/blob/main/configuration_mpt.py
"""A HuggingFace-style model configuration."""
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2024 HuggingFace Inc. team. All rights reserved.
# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved.
#
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# Adapted from
# https://huggingface.co/nvidia/NVLM-D-72B/blob/main/configuration_nvlm_d.py
# --------------------------------------------------------
+2
View File
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# yapf: disable
# ruff: noqa: E501
# coding=utf-8
+2
View File
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# 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
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# adapted from https://www.modelscope.cn/models/TeleAI/TeleChat2-3B/resolve/master/configuration_telechat2.py
""" Telechat configuration compatible with LlamaConfig. """
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# Adapted from https://github.com/fixie-ai/ultravox/blob/ecd58c4041030bae2ad15aa6bcf04ab43199ea02/ultravox/model/ultravox_config.py
from typing import Any, Dict, Optional
+2
View File
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
from typing import Dict, List, Optional
from vllm.sequence import (VLLM_INVALID_TOKEN_ID, Logprob, SamplingParams,
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
from typing import List, Optional, Tuple
from .tokenizer import AnyTokenizer
+2
View File
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
from functools import lru_cache
from typing import Any, cast
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
from vllm.transformers_utils.processors.deepseek_vl2 import (
DeepseekVLV2Processor)
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# yapf: disable
# ruff: noqa: E501
# coding=utf-8
+2
View File
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
import fnmatch
import os
import shutil
+2
View File
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
import contextlib
import os
import warnings
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
from typing import Optional, Type
from vllm.config import (LoRAConfig, ModelConfig, ParallelConfig,
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
from abc import ABC, abstractmethod
from typing import List, Optional
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
import asyncio
import os
from typing import List, Optional
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
from typing import List, Optional
from vllm.config import TokenizerPoolConfig
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
from .mistral import MistralTokenizer, maybe_serialize_tool_calls
__all__ = ["MistralTokenizer", "maybe_serialize_tool_calls"]
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
import os
import re
from dataclasses import dataclass
+2
View File
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
from os import PathLike
from pathlib import Path
from typing import Union