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
OpenDAS
OpenFold
Commits
92835fd5
Commit
92835fd5
authored
Oct 23, 2023
by
Sachin Kadyan
Browse files
More cleaning of bulk embedding generation script
parent
0026173e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
scripts/precompute_embeddings.py
scripts/precompute_embeddings.py
+2
-3
No files found.
scripts/precompute_embeddings.py
View file @
92835fd5
...
...
@@ -110,7 +110,7 @@ def main(args):
logits
=
out
[
"logits"
].
to
(
device
=
"cpu"
)
representations
=
{
layer
:
t
.
to
(
device
=
"cpu"
)
for
layer
,
t
in
out
[
"representations"
]
.
items
(
)
33
:
out
[
"representations"
]
[
33
].
to
(
device
=
"cpu"
)
}
for
i
,
label
in
enumerate
(
labels
):
...
...
@@ -118,8 +118,7 @@ def main(args):
result
=
{
"label"
:
label
}
result
[
"representations"
]
=
{
layer
:
t
[
i
,
1
:
len
(
strs
[
i
])
+
1
].
clone
()
for
layer
,
t
in
representations
.
items
()
33
:
representations
[
33
][
i
,
1
:
len
(
strs
[
i
])
+
1
].
clone
()
}
torch
.
save
(
result
,
...
...
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