[misc] reduce weird rope_scaling_factor warning (#7176)
This commit is contained in:
@@ -148,11 +148,14 @@ class InternLM2Config(PretrainedConfig):
|
|||||||
if (
|
if (
|
||||||
rope_scaling_factor is None
|
rope_scaling_factor is None
|
||||||
or not isinstance(rope_scaling_factor, float)
|
or not isinstance(rope_scaling_factor, float)
|
||||||
|
or not isinstance(rope_scaling_factor, int)
|
||||||
or rope_scaling_factor < 1.0
|
or rope_scaling_factor < 1.0
|
||||||
):
|
):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"`rope_scaling`'s factor field must be a float >= 1, got {rope_scaling_factor}"
|
f"`rope_scaling`'s factor field must be a float|int >= 1, got {rope_scaling_factor}"
|
||||||
)
|
)
|
||||||
|
if isinstance(rope_scaling_factor, int):
|
||||||
|
rope_scaling_factor = float(rope_scaling_factor)
|
||||||
|
|
||||||
|
|
||||||
class InternVisionConfig(PretrainedConfig):
|
class InternVisionConfig(PretrainedConfig):
|
||||||
|
|||||||
Reference in New Issue
Block a user