microsoft / torchscale

Foundation Architecture for (M)LLMs
https://aka.ms/GeneralAI
MIT License
3.01k stars 202 forks source link

Config fix #39

Open agoryuno opened 1 year ago

agoryuno commented 1 year ago

I've rewritten the torchscale.architecture.config module to use inheritance and remove the redundant code. There are now 3 classes:

Config - that holds all common options EncoderConfig - inherits 'Config' and holds Encoder specific options DecoderConfig - inherits 'Config' and holds Decoder specific options EncoderDecoderConfig - inherits EncoderConfig and DecoderConfig and holds that one option shared by Encoder and Decoder objects.

I also took the liberty to add some type hints for args parameters in encoder/decoder modules.