Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

[🤗] Safely get model_name from opt #4395

Merged
merged 3 commits into from
Mar 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion parlai/agents/hugging_face/dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion parlai/agents/hugging_face/gpt2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion parlai/tasks/lccc/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
'https://cloud.tsinghua.edu.cn/f/f131a4d259184566a29c/?dl=1',
'LCCC.zip',
'f5203511cd8d6a608008af0aa290aa516d983abc16aa510471e3c4ee6bca7886',
),
)
]


Expand Down
4 changes: 1 addition & 3 deletions parlai/tasks/task_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down