0

I'm trying to load the ruBERT model into Deeppavlov as follows:

#is a dict
config_path = {
   "chainer": {
      "in": [
         "x"
      ],
      "in_y": [
         "y"
      ],
      "out": [
         "y_pred_labels",
         "y_pred_probas"
      ],
      "pipe": [
         ...
   }
}

model = build_model(config_path, download=False)

At the same time, I have all the files of the original ruBERT model locally. However, an error throws when building the model:

OSError: Error no file named pytorch_model.bin found in directory ruBERT_hFace2 but there is a file for TensorFlow weights. Use `from_tf=True` to load this model from those weights.

At the same time, there is nowhere a clear explanation of how to pass this parameter through the build_model function.

How to pass this parameter across build_model correctly?


UPDATE 1

At the moment, the version of Deep Pavlov 1.0.2 is installed. The checkpoint of the model consists of following files:

enter image description here

senek
  • 45
  • 1
  • 1
  • 9

1 Answers1

0

Currently there is no way to pass any parameter via build_model. In case of additional parameter you should align the configuration file accordingly. Alternatively you can change it via Python code.

from deeppavlov import build_model, configs, evaluate_model
from deeppavlov.core.commands.utils import parse_config
config = parse_config(f"config.json")
...
model = build_model(config, download=True, install=True)

But first please make sure that you are using the latest version of DeepPavlov. In addition please take a look at out recent article on Medium. If you need a further assistance please provide more details.

com
  • 2,606
  • 6
  • 29
  • 44
  • At the moment, the version of Deep Pavlov 1.0.2 is installed. It does not help. The model was trained using Deep Pavlov, the checkpoint of the model consists of files (list of files I added to question) – senek Jan 13 '23 at 08:06