tipeXwins / PipeLLMine

0 stars 0 forks source link

avoid initialization of fields outside constructor: Creation of constructors in classes #14

Closed martinezmatias closed 1 year ago

martinezmatias commented 1 year ago

I created a constructor for the subclasses of HFCommunicationController for example: https://github.com/tipeXwins/TFG-LMBugFixing/pull/8/commits/1fe9a2e968903eedea7284601b4b1c910ababc32#diff-ac0a755fd47439442a92af9baf7e281050607ef0c779de1241422498535de7ecR81

The reasons is twofold: a) it´s a better practice than putting the fields and affect them outside a method (e.g., https://github.com/tipeXwins/TFG-LMBugFixing/blob/main/Pipeline/Calls.py#L61) b) when the module calls is imported in another files, the tokenizers and models are only loaded when the class is instantiated, and there the constructor is invoked.

tipeXwins commented 1 year ago

I also have refactored Query_creation adding constructor with parameters see: #15 , f49d37f