mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-05 08:37:06 +08:00
[BugFix] fix ce bugs (#3641)
* [BugFix] fix tp8 client refuse * fix engine port bug * Update utils.py
This commit is contained in:
@@ -77,7 +77,7 @@ class EngineClient:
|
|||||||
self.max_model_len = max_model_len
|
self.max_model_len = max_model_len
|
||||||
max_chips_per_node = 16 if current_platform.is_iluvatar() else 8
|
max_chips_per_node = 16 if current_platform.is_iluvatar() else 8
|
||||||
|
|
||||||
if tensor_parallel_size < max_chips_per_node:
|
if tensor_parallel_size <= max_chips_per_node:
|
||||||
self.is_master = True
|
self.is_master = True
|
||||||
else:
|
else:
|
||||||
self.is_master = False
|
self.is_master = False
|
||||||
|
@@ -409,13 +409,24 @@ class FlexibleArgumentParser(argparse.ArgumentParser):
|
|||||||
config = loaded_config
|
config = loaded_config
|
||||||
|
|
||||||
# Get declared parameters
|
# Get declared parameters
|
||||||
defined_dests = {action.dest for action in self._actions}
|
defined_actions = {action.dest: action for action in self._actions}
|
||||||
filtered_config = {k: v for k, v in config.items() if k in defined_dests}
|
filtered_config = {k: v for k, v in config.items() if k in defined_actions}
|
||||||
|
|
||||||
# Set parameters
|
# Set parameters
|
||||||
if namespace is None:
|
if namespace is None:
|
||||||
namespace = argparse.Namespace()
|
namespace = argparse.Namespace()
|
||||||
for key, value in filtered_config.items():
|
for key, value in filtered_config.items():
|
||||||
|
action = defined_actions[key]
|
||||||
|
if action.type is not None and isinstance(value, (str, int, float)):
|
||||||
|
try:
|
||||||
|
str_value = str(value).strip()
|
||||||
|
if str_value == "":
|
||||||
|
converted = None
|
||||||
|
else:
|
||||||
|
converted = action.type(str_value)
|
||||||
|
value = converted
|
||||||
|
except Exception as e:
|
||||||
|
llm_logger.error(f"Error converting '{key}' with value '{value}': {e}")
|
||||||
setattr(namespace, key, value)
|
setattr(namespace, key, value)
|
||||||
args = super().parse_args(args=remaining_args, namespace=namespace)
|
args = super().parse_args(args=remaining_args, namespace=namespace)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user