match api with OpenAI format

This commit is contained in:
hiyouga
2023-06-22 20:27:00 +08:00
parent 9324940b76
commit 76ecb8c222
4 changed files with 144 additions and 135 deletions

View File

@@ -285,6 +285,10 @@ class GeneratingArguments:
default=1.0,
metadata={"help": "The parameter for repetition penalty. 1.0 means no penalty."}
)
length_penalty: Optional[float] = field(
default=1.0,
metadata={"help": "Exponential penalty to the length that is used with beam-based generation."}
)
def to_dict(self) -> Dict[str, Any]:
return asdict(self)