Skip to content

Conversation

@leogagnon
Copy link
Contributor

Description

Add simple (and naive) for dictionary output of modules. Similar to how tupless were dealt with, I just select the first value of the dict. Only made changes to BaseModel. I'm not yet super familiar with the code so there might be some other modification needed.

Testing Done

It works with my model which has module dict outputs (for ZeroIntervention and LoreftIntervention). Didn't do extensive testing as this felt quite straightforward.

Checklist:

  • My PR title strictly follows the format: [Your Priority] Your Title
  • I have attached the testing log above
  • I provide enough comments to my code
  • I have changed documentations
  • I have added tests for my changes

@aryamanarora
Copy link
Collaborator

LGTM, pinging @frankaging: have you ever used modules which output dicts? Hasn't come up for me but this fix seems reasonable.

@frankaging
Copy link
Member

LGTM! Later, we might want to further remove the assumption of intervening on the first element by creating field in the config to provide the intervening keyword.

@frankaging
Copy link
Member

@leogagnon Thanks!

@frankaging frankaging merged commit 57a45fd into stanfordnlp:main Jul 29, 2024
@leogagnon leogagnon deleted the feature/support-dict-output branch July 29, 2024 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants