Revert transformers to 4.57.1 (#14801)
This commit is contained in:
@@ -69,7 +69,7 @@ dependencies = [
|
|||||||
"torchvision",
|
"torchvision",
|
||||||
"torchao==0.9.0",
|
"torchao==0.9.0",
|
||||||
"tqdm",
|
"tqdm",
|
||||||
"transformers==5.0.0rc0",
|
"transformers==4.57.1",
|
||||||
"uvicorn",
|
"uvicorn",
|
||||||
"uvloop",
|
"uvloop",
|
||||||
"xgrammar==0.1.27",
|
"xgrammar==0.1.27",
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ dependencies = [
|
|||||||
"timm==1.0.16",
|
"timm==1.0.16",
|
||||||
"torchao==0.9.0",
|
"torchao==0.9.0",
|
||||||
"tqdm",
|
"tqdm",
|
||||||
"transformers==5.0.0rc0",
|
"transformers==4.57.1",
|
||||||
"uvicorn",
|
"uvicorn",
|
||||||
"uvloop",
|
"uvloop",
|
||||||
"xgrammar==0.1.27",
|
"xgrammar==0.1.27",
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ runtime_common = [
|
|||||||
"timm==1.0.16",
|
"timm==1.0.16",
|
||||||
"torchao==0.9.0",
|
"torchao==0.9.0",
|
||||||
"tqdm",
|
"tqdm",
|
||||||
"transformers==5.0.0rc0",
|
"transformers==4.57.1",
|
||||||
"uvicorn",
|
"uvicorn",
|
||||||
"uvloop",
|
"uvloop",
|
||||||
"xgrammar==0.1.27",
|
"xgrammar==0.1.27",
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ dependencies = [
|
|||||||
"timm==1.0.16",
|
"timm==1.0.16",
|
||||||
"torchao==0.9.0",
|
"torchao==0.9.0",
|
||||||
"tqdm",
|
"tqdm",
|
||||||
"transformers==5.0.0rc0",
|
"transformers==4.57.1",
|
||||||
"uvicorn",
|
"uvicorn",
|
||||||
"uvloop",
|
"uvloop",
|
||||||
# "xgrammar==0.1.24", , xgrammar depends on CUDA PyTorch and Triton only
|
# "xgrammar==0.1.24", , xgrammar depends on CUDA PyTorch and Triton only
|
||||||
|
|||||||
@@ -80,16 +80,6 @@ def get_nsa_index_n_heads(config: PretrainedConfig) -> int:
|
|||||||
return config.index_n_heads
|
return config.index_n_heads
|
||||||
|
|
||||||
|
|
||||||
def handle_rope_parameters(config: PretrainedConfig):
|
|
||||||
if hasattr(config, "rope_scaling"):
|
|
||||||
rope_scaling = config.rope_scaling
|
|
||||||
if isinstance(rope_scaling, dict):
|
|
||||||
for k, v in rope_scaling.items():
|
|
||||||
if not hasattr(config, k):
|
|
||||||
setattr(config, k, v)
|
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
class ModelConfig:
|
class ModelConfig:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
@@ -137,8 +127,6 @@ class ModelConfig:
|
|||||||
**kwargs,
|
**kwargs,
|
||||||
)
|
)
|
||||||
self.hf_text_config = get_hf_text_config(self.hf_config)
|
self.hf_text_config = get_hf_text_config(self.hf_config)
|
||||||
handle_rope_parameters(self.hf_text_config)
|
|
||||||
handle_rope_parameters(self.hf_config)
|
|
||||||
self.hf_generation_config = get_generation_config(
|
self.hf_generation_config = get_generation_config(
|
||||||
self.model_path,
|
self.model_path,
|
||||||
trust_remote_code=trust_remote_code,
|
trust_remote_code=trust_remote_code,
|
||||||
@@ -370,8 +358,7 @@ class ModelConfig:
|
|||||||
mscale_all_dim = self.hf_config.rope_scaling.get(
|
mscale_all_dim = self.hf_config.rope_scaling.get(
|
||||||
"mscale_all_dim", False
|
"mscale_all_dim", False
|
||||||
)
|
)
|
||||||
scaling_factor = self.hf_config.rope_scaling.get("factor")
|
scaling_factor = self.hf_config.rope_scaling["factor"]
|
||||||
if scaling_factor is not None:
|
|
||||||
mscale = yarn_get_mscale(scaling_factor, float(mscale_all_dim))
|
mscale = yarn_get_mscale(scaling_factor, float(mscale_all_dim))
|
||||||
self.scaling = self.scaling * mscale * mscale
|
self.scaling = self.scaling * mscale * mscale
|
||||||
|
|
||||||
|
|||||||
@@ -2704,12 +2704,6 @@ class DeepseekV2DecoderLayer(nn.Module):
|
|||||||
self.config = config
|
self.config = config
|
||||||
rope_theta = getattr(config, "rope_theta", 10000)
|
rope_theta = getattr(config, "rope_theta", 10000)
|
||||||
rope_scaling = getattr(config, "rope_scaling", None)
|
rope_scaling = getattr(config, "rope_scaling", None)
|
||||||
if rope_scaling is not None:
|
|
||||||
# In transformers 5.0.0rc0+, rope_theta and rope_type are also included in rope_scaling.
|
|
||||||
# Therefore, if rope_scaling contains only these two keys,
|
|
||||||
# it effectively means there are no special rope_scaling parameters.
|
|
||||||
if set(rope_scaling.keys()) <= {"rope_theta", "rope_type"}:
|
|
||||||
rope_scaling = None
|
|
||||||
max_position_embeddings = getattr(config, "max_position_embeddings", 8192)
|
max_position_embeddings = getattr(config, "max_position_embeddings", 8192)
|
||||||
self.speculative_algorithm = SpeculativeAlgorithm.from_string(
|
self.speculative_algorithm = SpeculativeAlgorithm.from_string(
|
||||||
get_global_server_args().speculative_algorithm
|
get_global_server_args().speculative_algorithm
|
||||||
|
|||||||
@@ -319,6 +319,9 @@ class TestFixedBugs(unittest.TestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@unittest.skipIf(
|
||||||
|
is_in_ci(), "Skipping GLM41V PP accuracy test before it gets more stable"
|
||||||
|
)
|
||||||
class TestGLM41VPPAccuracy(unittest.TestCase):
|
class TestGLM41VPPAccuracy(unittest.TestCase):
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
|
|||||||
Reference in New Issue
Block a user