Skip to content

Commit

Permalink
[CLAP] Fix logit scales dtype for fp16 (huggingface#25754)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchit-gandhi authored and parambharat committed Sep 26, 2023
1 parent 6671260 commit 8bdeb54
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/transformers/models/clap/modeling_clap.py
Original file line number Diff line number Diff line change
Expand Up @@ -1955,8 +1955,8 @@ def __init__(self, config: ClapConfig):
text_config = config.text_config
audio_config = config.audio_config

self.logit_scale_a = nn.Parameter(torch.log(torch.tensor(config.logit_scale_init_value)))
self.logit_scale_t = nn.Parameter(torch.log(torch.tensor(config.logit_scale_init_value)))
self.logit_scale_a = nn.Parameter(torch.tensor(math.log(config.logit_scale_init_value)))
self.logit_scale_t = nn.Parameter(torch.tensor(math.log(config.logit_scale_init_value)))

self.projection_dim = config.projection_dim

Expand Down

0 comments on commit 8bdeb54

Please sign in to comment.