feat: update model_specific_adjustment (#5344)
Co-authored-by: hebiao064 <hebiaobuaa@gmail.com>
This commit is contained in:
@@ -569,7 +569,7 @@ def encode_video(video_path, frame_count_limit=None):
|
||||
|
||||
|
||||
def load_image(
|
||||
image_file: Union[Image.Image, str, bytes]
|
||||
image_file: Union[Image.Image, str, bytes],
|
||||
) -> tuple[Image.Image, tuple[int, int]]:
|
||||
image = image_size = None
|
||||
if isinstance(image_file, Image.Image):
|
||||
@@ -1905,3 +1905,28 @@ def get_local_ip_by_remote() -> str:
|
||||
return s.getsockname()[0]
|
||||
except Exception:
|
||||
raise ValueError(f"Can not get local ip")
|
||||
|
||||
|
||||
def is_page_size_one(server_args):
|
||||
return server_args.page_size == 1
|
||||
|
||||
|
||||
def is_no_spec_infer_or_topk_one(server_args):
|
||||
return server_args.speculative_eagle_topk is None or (
|
||||
server_args.speculative_eagle_topk is not None
|
||||
and server_args.speculative_eagle_topk == 1
|
||||
and is_page_size_one(server_args)
|
||||
)
|
||||
|
||||
|
||||
def is_fa3_default_architecture(hf_config):
|
||||
architectures = getattr(hf_config, "architectures", None)
|
||||
if not isinstance(architectures, list) or not architectures:
|
||||
return False
|
||||
default_archs = {
|
||||
"Qwen2ForCausalLM",
|
||||
"Llama4ForConditionalGeneration",
|
||||
"LlamaForCausalLM",
|
||||
"MistralForCausalLM",
|
||||
}
|
||||
return architectures[0] in default_archs
|
||||
|
||||
Reference in New Issue
Block a user