match api with OpenAI format

Former-commit-id: 9cbe2b98b024393817e86ff8e3ff1636776fa263
This commit is contained in:
hiyouga
2023-06-22 20:27:00 +08:00
parent 18ccece745
commit bfe015e30f
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)