[AMD] Fix AttributeError in GeneratedSharedPrefixDataset.from_args for in-process callers (#27580)
This commit is contained in:
@@ -55,8 +55,8 @@ class GeneratedSharedPrefixDataset(BaseDataset):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def from_args(cls, args: Namespace) -> "GeneratedSharedPrefixDataset":
|
def from_args(cls, args: Namespace) -> "GeneratedSharedPrefixDataset":
|
||||||
assert not getattr(args, "tokenize_prompt", False)
|
assert not getattr(args, "tokenize_prompt", False)
|
||||||
group_distribution = args.gsp_group_distribution
|
group_distribution = getattr(args, "gsp_group_distribution", "uniform")
|
||||||
zipf_alpha = args.gsp_zipf_alpha
|
zipf_alpha = getattr(args, "gsp_zipf_alpha", None)
|
||||||
|
|
||||||
# Defensive validation for in-process callers that construct a
|
# Defensive validation for in-process callers that construct a
|
||||||
# Namespace by hand and bypass the argparse boundary in
|
# Namespace by hand and bypass the argparse boundary in
|
||||||
|
|||||||
Reference in New Issue
Block a user