Update generating_args.py

This commit is contained in:
hoshi-hiyouga 2024-05-07 00:27:56 +08:00 committed by GitHub
parent 80645751bc
commit 7ae7ae64f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 5 deletions

View File

@ -1,5 +1,5 @@
from dataclasses import asdict, dataclass, field
from typing import Any, Dict, Union, Optional, List
from typing import Any, Dict
@dataclass
@ -46,10 +46,6 @@ class GeneratingArguments:
default=1.0,
metadata={"help": "Exponential penalty to the length that is used with beam-based generation."},
)
stop: Union[Optional[str], List[str]] = field(
default=None,
metadata={"help": "List of strings or string that stop the generation when they are generated. The returned output will not contain the stop strings."},
)
def to_dict(self) -> Dict[str, Any]:
args = asdict(self)
if args.get("max_new_tokens", -1) > 0: