facebookresearch / ParlAI

A framework for training and evaluating AI models on a variety of openly available dialogue datasets.
https://parl.ai
MIT License
10.48k stars 2.09k forks source link

What is the format of model file such as squad.mdl ? #757

Closed haow85 closed 6 years ago

haow85 commented 6 years ago

What is the format of the model file such as squad.mdl ?

alexholdenmiller commented 6 years ago

from parlai/agents/drqa/model.py:

def save(self, filename):
        params = {
            'state_dict': {
                'network': self.network.state_dict(),
            },
            'feature_dict': self.feature_dict,
            'config': self.opt,
        }
        try:
            torch.save(params, filename)
        except BaseException:
            logger.warn('[ WARN: Saving failed... continuing anyway. ]')