allenai/scibert

Unable to load scibert model

Closed this issue · 3 comments

Hi, I am trying to use scibert model for a NER task via running python -m allennlp.run predict ./scibert_scivocab_uncased/weights.tar.gz ./data/test.txt. However, I keep getting this config.json not found error.
Anybody has ideas what's wrong here? Or, is there any demo code that could offer for both the allennlp model and the huggingface model?

2020-02-18 21:37:58,182 - INFO - allennlp.common.registrable - instantiating registered subclass relu of <class 'allennlp.nn.activations.Activation'>
2020-02-18 21:37:58,241 - INFO - allennlp.common.registrable - instantiating registered subclass relu of <class 'allennlp.nn.activations.Activation'>
2020-02-18 21:37:58,306 - INFO - allennlp.common.registrable - instantiating registered subclass relu of <class 'allennlp.nn.activations.Activation'>
2020-02-18 21:37:58,373 - INFO - allennlp.common.registrable - instantiating registered subclass relu of <class 'allennlp.nn.activations.Activation'>
2020-02-18 21:38:03,966 - INFO - allennlp.models.archival - loading archive file ./scibert_scivocab_uncased/weights.tar.gz
2020-02-18 21:38:03,967 - INFO - allennlp.models.archival - extracting archive file ./scibert_scivocab_uncased/weights.tar.gz to temp dir /tmp/tmp2bz4ewjj
Traceback (most recent call last):
  File "/opt/conda/envs/pytorch-py3.6/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/opt/conda/envs/pytorch-py3.6/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/blob/v-jiawzh/scibert/scibert/src/allennlp/allennlp/run.py", line 21, in <module>
    run()
  File "/blob/v-jiawzh/scibert/scibert/src/allennlp/allennlp/run.py", line 18, in run
    main(prog="allennlp")
  File "/blob/v-jiawzh/scibert/scibert/src/allennlp/allennlp/commands/__init__.py", line 102, in main
    args.func(args)
  File "/blob/v-jiawzh/scibert/scibert/src/allennlp/allennlp/commands/predict.py", line 214, in _predict
    predictor = _get_predictor(args)
  File "/blob/v-jiawzh/scibert/scibert/src/allennlp/allennlp/commands/predict.py", line 120, in _get_predictor
    overrides=args.overrides)
  File "/blob/v-jiawzh/scibert/scibert/src/allennlp/allennlp/models/archival.py", line 214, in load_archive
    config = Params.from_file(os.path.join(serialization_dir, CONFIG_NAME), overrides)
  File "/blob/v-jiawzh/scibert/scibert/src/allennlp/allennlp/common/params.py", line 474, in from_file
    params_file = cached_path(params_file)
  File "/blob/v-jiawzh/scibert/scibert/src/allennlp/allennlp/common/file_utils.py", line 106, in cached_path
    raise FileNotFoundError("file {} not found".format(url_or_filename))
FileNotFoundError: file /tmp/tmp2bz4ewjj/config.json not found
2020-02-18 21:38:08,412 - INFO - allennlp.models.archival - removing temporary unarchived model dir at /tmp/tmp2bz4ewjj

which version of scibert is this?

Hi, @ibeltagy . It's the PyTorch AllenNLP Models, and my allennlp version is '0.9.0-unreleased'

Hi, I have the same error message, may I know how it is fixed? Thank you!