microsoft / TransformerCompression

For releasing code related to compression methods for transformers, accompanying our publications
MIT License
356 stars 31 forks source link

Add config abstract property in model adapter. #78

Closed pashminacameron closed 7 months ago

pashminacameron commented 7 months ago

Implement and use the config property in model adapter implementations.

pashminacameron commented 7 months ago

I'm not entirely sure what the implications of this change are, perhaps @msdmkats is better placed to assess

The config property was implemented by all existing model adapters anyway, but they weren't required to by the ModelAdapter interface. So pulling this up into the interface means any future model adapter will be required to implement it. It's possible for a model adapter to be implemented without the config property, but this makes it cleaner (can just be None if a certain model does not use a config).

nailimixaM commented 7 months ago

I'm not entirely sure what the implications of this change are, perhaps @msdmkats is better placed to assess

The config property was implemented by all existing model adapters anyway, but they weren't required to by the ModelAdapter interface. So pulling this up into the interface means any future model adapter will be required to implement it. It's possible for a model adapter to be implemented without the config property, but this makes it cleaner (can just be None if a certain model does not use a config).

Thanks, that makes a lot of sense 👍