added support for text only metrics, and an implementation of hellaswag#7
Open
MajoRoth wants to merge 1 commit intoslp-rl:mainfrom
Open
added support for text only metrics, and an implementation of hellaswag#7MajoRoth wants to merge 1 commit intoslp-rl:mainfrom
MajoRoth wants to merge 1 commit intoslp-rl:mainfrom
Conversation
Comment on lines
+38
to
+41
| text = text.replace(" [title]", ". ") | ||
| text = re.sub("\\[.*?\\]", "", text) | ||
| text = text.replace(" ", " ") | ||
| return text |
Collaborator
There was a problem hiding this comment.
Why replace [title] with ".". is this how this metric is normally processed?
| for sample_files in tqdm(dl): | ||
| counter +=1 | ||
|
|
||
| with torch.no_grad(): |
Collaborator
There was a problem hiding this comment.
there is not need for the no_grad here. we have with torch.inference_mode(): in the main function.
| ignore_tokens = self.tokeniser.get_ignore_tokens(used_token_modality) | ||
| return self.model.log_likelihood(tokens, mean_nll, ignore_tokens) | ||
|
|
||
| def text_log_likelihood(self, texts: List[str], mean_nll: bool = True, used_token_modality: Optional[str] = None) -> torch.Tensor: |
Collaborator
There was a problem hiding this comment.
why add text_log_likelihood to a speech lm model?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.