Unverified Commit 21063c11 authored by Aaron Pham's avatar Aaron Pham Committed by GitHub
Browse files

[CI/Build] drop support for Python 3.8 EOL (#8464)


Signed-off-by: default avatarAaron Pham <contact@aarnphm.xyz>
parent 4be3a451
# coding=utf-8
# Copyright 2024 the HuggingFace Inc. team. All rights reserved. # Copyright 2024 the HuggingFace Inc. team. All rights reserved.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
......
...@@ -37,7 +37,7 @@ class MLPSpeculatorLayerNorm(nn.Module): ...@@ -37,7 +37,7 @@ class MLPSpeculatorLayerNorm(nn.Module):
eps=1e-06, eps=1e-06,
elementwise_scale_and_shift=True, elementwise_scale_and_shift=True,
): ):
super(MLPSpeculatorLayerNorm, self).__init__() super().__init__()
self.elementwise_scale_and_shift = elementwise_scale_and_shift self.elementwise_scale_and_shift = elementwise_scale_and_shift
if self.elementwise_scale_and_shift: if self.elementwise_scale_and_shift:
self.weight = nn.Parameter(torch.empty(normalized_shape)) self.weight = nn.Parameter(torch.empty(normalized_shape))
......
...@@ -1121,9 +1121,9 @@ class MolmoForCausalLM(nn.Module, SupportsMultiModal, SupportsPP): ...@@ -1121,9 +1121,9 @@ class MolmoForCausalLM(nn.Module, SupportsMultiModal, SupportsPP):
batch_size * num_image * num_patch, -1).contiguous() batch_size * num_image * num_patch, -1).contiguous()
image_input_idx = image_input_idx * valid.to(image_input_idx.dtype) image_input_idx = image_input_idx * valid.to(image_input_idx.dtype)
offset = torch.cat( offset = torch.cat([seq_len.new_zeros(1),
[seq_len.new_zeros( seq_len.cumsum(dim=0)[:-1]],
(1)), seq_len.cumsum(dim=0)[:-1]], dim=0)[:, None] dim=0)[:, None]
image_input_idx = image_input_idx + offset.to(image_input_idx.dtype) image_input_idx = image_input_idx + offset.to(image_input_idx.dtype)
image_input_idx = image_input_idx.flatten()[:, None] image_input_idx = image_input_idx.flatten()[:, None]
mat = image_input_idx == torch.arange( mat = image_input_idx == torch.arange(
......
# coding=utf-8
# Adapted from https://huggingface.co/mosaicml/mpt-7b/tree/main # Adapted from https://huggingface.co/mosaicml/mpt-7b/tree/main
import math import math
from typing import Iterable, List, Optional, Tuple, Union from typing import Iterable, List, Optional, Tuple, Union
......
# coding=utf-8
# 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
# Copyright 2023 The vLLM team. # Copyright 2023 The vLLM team.
......
# coding=utf-8
# Adapted from # Adapted from
# https://github.com/huggingface/transformers/blob/v4.40.1/src/transformers/models/olmo/modeling_olmo.py # https://github.com/huggingface/transformers/blob/v4.40.1/src/transformers/models/olmo/modeling_olmo.py
# Copyright 2024 The vLLM team. # Copyright 2024 The vLLM team.
......
# coding=utf-8
# Adapted from # Adapted from
# https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/opt/modeling_opt.py # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/opt/modeling_opt.py
# Copyright 2023 The vLLM team. # Copyright 2023 The vLLM team.
......
# coding=utf-8
# Adapted from # Adapted from
# https://huggingface.co/OrionStarAI/Orion-14B-Base/blob/main/modeling_orion.py # https://huggingface.co/OrionStarAI/Orion-14B-Base/blob/main/modeling_orion.py
# Copyright (c) OrionStar Inc. # Copyright (c) OrionStar Inc.
......
# coding=utf-8
# adapted from https://github.com/huggingface/transformers/blob/v4.39.3/src/transformers/models/persimmon/modeling_persimmon.py # adapted from https://github.com/huggingface/transformers/blob/v4.39.3/src/transformers/models/persimmon/modeling_persimmon.py
# Copyright 2023 The vLLM team. # Copyright 2023 The vLLM team.
# Copyright 2023 EleutherAI and the HuggingFace Inc. team. All rights reserved. # Copyright 2023 EleutherAI and the HuggingFace Inc. team. All rights reserved.
......
# coding=utf-8
# Adapted from # Adapted from
# https://huggingface.co/microsoft/phi-1_5/blob/main/modeling_phi.py # https://huggingface.co/microsoft/phi-1_5/blob/main/modeling_phi.py
# Copyright 2023 The vLLM team. # Copyright 2023 The vLLM team.
......
# coding=utf-8
# Adapted from llama.py # Adapted from llama.py
"""Inference-only Phi3 model code inherit from Llama.py""" """Inference-only Phi3 model code inherit from Llama.py"""
......
# coding=utf-8
# Copyright 2024 The vLLM team. # Copyright 2024 The vLLM team.
# Copyright 2024 Microsoft and the HuggingFace Inc. team. All rights reserved. # Copyright 2024 Microsoft and the HuggingFace Inc. team. All rights reserved.
# #
......
# coding=utf-8
# 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
# Copyright 2023 The vLLM team. # Copyright 2023 The vLLM team.
......
...@@ -136,11 +136,11 @@ def input_processor_for_pixtral(ctx: InputContext, inputs: DecoderOnlyInputs): ...@@ -136,11 +136,11 @@ def input_processor_for_pixtral(ctx: InputContext, inputs: DecoderOnlyInputs):
if image_token_id not in inputs['prompt_token_ids']: if image_token_id not in inputs['prompt_token_ids']:
raise ValueError( raise ValueError(
(f"You've passed {inputs=} without {image_token_id=}" f"You've passed {inputs=} without {image_token_id=}"
" Make sure to process your input via mistral_common's" " Make sure to process your input via mistral_common's"
" tokenizer or pass a chat completion request. For more" " tokenizer or pass a chat completion request. For more"
" For more info, see: " " For more info, see: "
"https://github.com/vllm-project/vllm/issues/8411.")) "https://github.com/vllm-project/vllm/issues/8411.")
return inputs return inputs
......
# coding=utf-8
# Adapted from # Adapted from
# https://huggingface.co/Qwen/Qwen-7B/blob/main/modeling_qwen.py # https://huggingface.co/Qwen/Qwen-7B/blob/main/modeling_qwen.py
# Copyright (c) Alibaba Cloud. # Copyright (c) Alibaba Cloud.
......
# coding=utf-8
# Adapted from # Adapted from
# https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/qwen2/modeling_qwen2.py # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/qwen2/modeling_qwen2.py
# Copyright 2024 The Qwen team. # Copyright 2024 The Qwen team.
...@@ -417,9 +416,9 @@ class Qwen2ForCausalLM(nn.Module, SupportsLoRA, SupportsPP): ...@@ -417,9 +416,9 @@ class Qwen2ForCausalLM(nn.Module, SupportsLoRA, SupportsPP):
and hasattr(config, "max_window_layers")): and hasattr(config, "max_window_layers")):
raise ValueError("Sliding window for some but all layers is not " raise ValueError("Sliding window for some but all layers is not "
"supported. This model uses sliding window " "supported. This model uses sliding window "
"but `max_window_layers` = %s is less than " "but `max_window_layers` = {} is less than "
"`num_hidden_layers` = %s. Please open an issue " "`num_hidden_layers` = {}. Please open an issue "
"to discuss this feature." % ( "to discuss this feature.".format(
config.max_window_layers, config.max_window_layers,
config.num_hidden_layers, config.num_hidden_layers,
)) ))
......
# coding=utf-8
# Copyright 2024 The Qwen team. # Copyright 2024 The Qwen team.
# Copyright 2023 The vLLM team. # Copyright 2023 The vLLM team.
# Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved. # Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved.
......
# coding=utf-8
# Adapted from # Adapted from
# https://huggingface.co/Qwen/Qwen2.5-Math-RM-72B/blob/main/modeling_qwen2_rm.py # https://huggingface.co/Qwen/Qwen2.5-Math-RM-72B/blob/main/modeling_qwen2_rm.py
# Copyright 2024 Kakao Corp. (Kanana-X Team) # Copyright 2024 Kakao Corp. (Kanana-X Team)
...@@ -60,9 +59,9 @@ class Qwen2ForSequenceClassification(nn.Module): ...@@ -60,9 +59,9 @@ class Qwen2ForSequenceClassification(nn.Module):
and hasattr(config, "max_window_layers")): and hasattr(config, "max_window_layers")):
raise ValueError("Sliding window for some but all layers is not " raise ValueError("Sliding window for some but all layers is not "
"supported. This model uses sliding window " "supported. This model uses sliding window "
"but `max_window_layers` = %s is less than " "but `max_window_layers` = {} is less than "
"`num_hidden_layers` = %s. Please open an issue " "`num_hidden_layers` = {}. Please open an issue "
"to discuss this feature." % ( "to discuss this feature.".format(
config.max_window_layers, config.max_window_layers,
config.num_hidden_layers, config.num_hidden_layers,
)) ))
......
# coding=utf-8
# Adapted from # Adapted from
# https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/qwen2_moe/modeling_qwen2_moe.py # https://github.com/huggingface/transformers/blob/v4.28.0/src/transformers/models/qwen2_moe/modeling_qwen2_moe.py
# Copyright 2024 The Qwen team. # Copyright 2024 The Qwen team.
......
# coding=utf-8
# Adapted from # Adapted from
# https://huggingface.co/Qwen/Qwen2.5-Math-RM-72B/blob/main/modeling_qwen2_rm.py # https://huggingface.co/Qwen/Qwen2.5-Math-RM-72B/blob/main/modeling_qwen2_rm.py
# Copyright 2024 The Qwen team. # Copyright 2024 The Qwen team.
...@@ -71,9 +70,9 @@ class Qwen2ForRewardModel(nn.Module, SupportsPP): ...@@ -71,9 +70,9 @@ class Qwen2ForRewardModel(nn.Module, SupportsPP):
and hasattr(config, "max_window_layers")): and hasattr(config, "max_window_layers")):
raise ValueError("Sliding window for some but all layers is not " raise ValueError("Sliding window for some but all layers is not "
"supported. This model uses sliding window " "supported. This model uses sliding window "
"but `max_window_layers` = %s is less than " "but `max_window_layers` = {} is less than "
"`num_hidden_layers` = %s. Please open an issue " "`num_hidden_layers` = {}. Please open an issue "
"to discuss this feature." % ( "to discuss this feature.".format(
config.max_window_layers, config.max_window_layers,
config.num_hidden_layers, config.num_hidden_layers,
)) ))
......
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