Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

[PACER] Adding flexibility + removing padding idx before v2t #4488

Merged
merged 3 commits into from
Apr 13, 2022
Merged

Conversation

jxmsML
Copy link
Contributor

@jxmsML jxmsML commented Apr 8, 2022

Patch description

  1. return Any reranker class not just RPAReranker for partial only agent
  2. check if 'classifier' is in shared, this is for the SeeKeR case, where
    dialogue_agent = model_class(opt, knowledge_agent.share()) but knowledge_agent.share() doesn't have classifier attribute
  3. adding def get_target_character(self): that returns the target label the reranker tries to optimize for.
  4. removing padding id before applying self.agent_v2t(self.context), otherwise during batch generation one might run into this kind of error KeyError, '__null__' not found in self.dict
  5. int(pred['text'] == self.character) - 1 replaced with pred['text_candidates'].index(self.character) in case the predictor is a multi-class.

Testing steps

Other information

@jxmsML jxmsML requested a review from klshuster April 11, 2022 18:04
@jxmsML jxmsML merged commit ae2e12a into main Apr 13, 2022
@jxmsML jxmsML deleted the pacer_edits branch April 13, 2022 20:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants