Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
77cb2ab7
Unverified
Commit
77cb2ab7
authored
Aug 23, 2023
by
Sanchit Gandhi
Committed by
GitHub
Aug 23, 2023
Browse files
⚠
️ [CLAP] Fix dtype of logit scales in init (#25682)
[CLAP] Fix dtype of logit scales
parent
2cf87e2b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
src/transformers/models/clap/modeling_clap.py
src/transformers/models/clap/modeling_clap.py
+2
-3
No files found.
src/transformers/models/clap/modeling_clap.py
View file @
77cb2ab7
...
...
@@ -18,7 +18,6 @@ import math
from
dataclasses
import
dataclass
from
typing
import
Any
,
List
,
Optional
,
Tuple
,
Union
import
numpy
as
np
import
torch
import
torch.nn.functional
as
F
from
torch
import
nn
...
...
@@ -1956,8 +1955,8 @@ class ClapModel(ClapPreTrainedModel):
text_config
=
config
.
text_config
audio_config
=
config
.
audio_config
self
.
logit_scale_a
=
nn
.
Parameter
(
torch
.
tensor
(
np
.
log
(
config
.
logit_scale_init_value
)))
self
.
logit_scale_t
=
nn
.
Parameter
(
torch
.
tensor
(
np
.
log
(
config
.
logit_scale_init_value
)))
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
.
projection_dim
=
config
.
projection_dim
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment