Skip to content

Commit d45864d

Browse files
authored
model_config.json -> config.json (#4239)
1 parent ba0c3d1 commit d45864d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

paddlenlp/taskflow/information_extraction.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from ..layers import GlobalPointerForEntityExtraction, GPLinkerForRelationExtraction
2727
from ..transformers import UIE, UIEM, UIEX, AutoModel, AutoTokenizer
2828
from ..utils.doc_parser import DocParser
29+
from ..utils.env import CONFIG_NAME
2930
from ..utils.ie_utils import map_offset, pad_image_data
3031
from ..utils.log import logger
3132
from ..utils.tools import get_bool_ids_greater_than, get_span
@@ -398,9 +399,9 @@ def __init__(self, task, model, schema=None, **kwargs):
398399
# TODO: temporary solution to support HF Hub due to lack of AutoModel
399400
# change this logic to use AutoConfig when available
400401
if self.from_hf_hub:
401-
config_file_path = hf_hub_download(repo_id=self._task_path, filename="model_config.json")
402+
config_file_path = hf_hub_download(repo_id=self._task_path, filename=CONFIG_NAME)
402403
with open(config_file_path) as f:
403-
self._init_class = json.load(f)["init_class"]
404+
self._init_class = json.load(f)["architectures"].pop()
404405
else:
405406
self._check_task_files()
406407
with open(os.path.join(self._task_path, "model_config.json")) as f:

0 commit comments

Comments
 (0)