diff --git a/parlai/agents/hugging_face/dict.py b/parlai/agents/hugging_face/dict.py index ed83c3bda7a..6247095d765 100644 --- a/parlai/agents/hugging_face/dict.py +++ b/parlai/agents/hugging_face/dict.py @@ -140,7 +140,7 @@ def get_tokenizer(self, opt): """ Instantiate tokenizer. """ - if opt["model_name"]: + if opt.get("model_name"): fle_key = opt["model_name"] else: model_sz = opt["gpt2_size"] diff --git a/parlai/agents/hugging_face/gpt2.py b/parlai/agents/hugging_face/gpt2.py index 5942baee529..346152617d2 100644 --- a/parlai/agents/hugging_face/gpt2.py +++ b/parlai/agents/hugging_face/gpt2.py @@ -58,7 +58,7 @@ def __init__(self, opt, dict): def _init_from_pretrained(self, opt): # load model - if opt["model_name"]: + if opt.get("model_name"): fle_key = opt["model_name"] else: model_sz = opt["gpt2_size"] diff --git a/parlai/tasks/lccc/build.py b/parlai/tasks/lccc/build.py index fb6b1557c17..b468eb1c6db 100644 --- a/parlai/tasks/lccc/build.py +++ b/parlai/tasks/lccc/build.py @@ -9,7 +9,7 @@ 'https://cloud.tsinghua.edu.cn/f/f131a4d259184566a29c/?dl=1', 'LCCC.zip', 'f5203511cd8d6a608008af0aa290aa516d983abc16aa510471e3c4ee6bca7886', - ), + ) ] diff --git a/parlai/tasks/task_list.py b/parlai/tasks/task_list.py index 7b81197b59a..66be1b85067 100644 --- a/parlai/tasks/task_list.py +++ b/parlai/tasks/task_list.py @@ -1554,9 +1554,7 @@ "display_name": "LCCC", "task": "lccc", "tags": ["ChitChat"], - "description": ( - "Large-scale cleaned Chinese conversation dataset." - ), + "description": ("Large-scale cleaned Chinese conversation dataset."), "links": { "arXiv": "https://arxiv.org/pdf/2008.03946", "website": "https://github.com/thu-coai/CDial-GPT",