fix(model): Fix vllm inference error (#2025)

This commit is contained in:
Weng Zecheng 2024-09-27 18:19:04 +08:00 committed by GitHub
parent 0bfe67289d
commit f5de05b263
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -637,7 +637,11 @@ def _build_parameter_class(desc: List[ParameterDescription]) -> Type:
annotations[d.param_name] = _type_str_to_python_type(
d.param_type # type: ignore
) # Set type annotation
fields_dict[d.param_name] = field(default=d.default_value, metadata=metadata)
# fields_dict[d.param_name] = field(default=d.default_value, metadata=metadata)
if d.param_name == 'ignore_patterns':
fields_dict[d.param_name] = field(default=None, metadata=metadata)
else:
fields_dict[d.param_name] = field(default=d.default_value, metadata=metadata)
# Create the new class. Note the setting of __annotations__ for type hints
new_class = type(