Skip to content

added support for text only metrics, and an implementation of hellaswag#7

Open
MajoRoth wants to merge 1 commit intoslp-rl:mainfrom
MajoRoth:main
Open

added support for text only metrics, and an implementation of hellaswag#7
MajoRoth wants to merge 1 commit intoslp-rl:mainfrom
MajoRoth:main

Conversation

@MajoRoth
Copy link

@MajoRoth MajoRoth commented Mar 8, 2025

No description provided.

Comment on lines +38 to +41
text = text.replace(" [title]", ". ")
text = re.sub("\\[.*?\\]", "", text)
text = text.replace(" ", " ")
return text
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why replace [title] with ".". is this how this metric is normally processed?

for sample_files in tqdm(dl):
counter +=1

with torch.no_grad():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why add text_log_likelihood to a speech lm model?

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.

2 participants