PaddlePaddle / Knover

Large-scale open domain KNOwledge grounded conVERsation system based on PaddlePaddle
Apache License 2.0
673 stars 131 forks source link

For the error of running the command 'bash ./scripts/local/job.sh ./projects/PLATO-2/pretrain/24L_infer.conf' #138

Open kiseliu opened 2 years ago

kiseliu commented 2 years ago

For the following parameters in the config of https://github.com/PaddlePaddle/Knover/blob/develop/projects/PLATO-2/pretrain/24L_infer.conf:

16 init_params="./24L/Plato"
17 nsp_init_params="./24L/NSP"

How can I get these two models? Do I need transform from the model https://dialogue.bj.bcebos.com/Knover/projects/PLATO-2/24L.tar to get them by myself.

sserdoubleh commented 2 years ago

You need to download the models from this url.

sserdoubleh commented 2 years ago

Follow this : https://github.com/PaddlePaddle/Knover/blob/develop/projects/PLATO-2/README.md#pre-trained-dialogue-generation-model

kiseliu commented 2 years ago

Sorry, I just found that the model file I used is from PaddleNLP

wget https://bj.bcebos.com/paddlenlp/models/transformers/plato2/24L.pdparams.

This problem is solved, thanks a lot.

But there has another question. Could you provide me a script to transform the model file "./24L/Plato" to dygraph format?

sserdoubleh commented 2 years ago

Dygraph branch cannot support PLATO-2 now.

kiseliu commented 2 years ago

I found that I can use the following code to transform the model file "./24L/Plato" to dygraph format.

282        fluid.io.load_vars(
283            self.exe,
284            model_path,
285            main_program=self.program,
286            predicate=__predicate__)
287        fluid.io.save(self.program.static_dict(), 'outputs/PLATO')    # For stage 2.1, we transform the PLATO model.

Adding the line 287 to the file of https://github.com/PaddlePaddle/Knover/blob/develop/knover/core/model.py.

Then we can have three files saved in 'outputs/PLATO':

PLATO.pdmodel
PLATO.pddot
PLATO.pdparams