def print_model_card(self):
    if hasattr(self, 'model_card'):
        param_out = '\n------------------------------------\n'
        param_out += '--------- Flair Model Card ---------\n'
        param_out += '------------------------------------\n'
        param_out += '- this Flair model was trained with:\n'
        param_out += f'''-- Flair version {self.model_card['flair_version']}
'''
        param_out += f'''-- PyTorch version {self.model_card['pytorch_version']}
'''
        if ('transformers_version' in self.model_card):
            param_out += f'''-- Transformers version {self.model_card['transformers_version']}
'''
        param_out += '------------------------------------\n'
        param_out += '------- Training Parameters: -------\n'
        param_out += '------------------------------------\n'
        training_params = '\n'.join((f"-- {param} = {self.model_card['training_parameters'][param]}" for param in self.model_card['training_parameters']))
        param_out += (training_params + '\n')
        param_out += '------------------------------------\n'
        log.info(param_out)
    else:
        log.info('This model has no model card (likely because it is not yet trained or was trained with Flair version < 0.9.1)')
def print_model_card(self):
    if hasattr(self, 'model_card'):
        param_out = '\n------------------------------------\n'
        param_out += '--------- Flair Model Card ---------\n'
        param_out += '------------------------------------\n'
        param_out += '- this Flair model was trained with:\n'
        param_out += f'-- Flair version {self.model_card['flair_version']}
'
        param_out += f'-- PyTorch version {self.model_card['pytorch_version']}
'
        if ('transformers_version' in self.model_card):
            param_out += f'-- Transformers version {self.model_card['transformers_version']}
'
        param_out += '------------------------------------\n'
        param_out += '------- Training Parameters: -------\n'
        param_out += '------------------------------------\n'
        training_params = '\n'.join((f"-- {param} = {self.model_card['training_parameters'][param]}" for param in self.model_card['training_parameters']))
        param_out += (training_params + '\n')
        param_out += '------------------------------------\n'
        log.info(param_out)
    else:
        log.info('This model has no model card (likely because it is not yet trained or was trained with Flair version < 0.9.1)')