Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
proekt
obuch
Commits
01a9d117
Commit
01a9d117
authored
1 week ago
by
Мазур Грета Евгеньевна
Browse files
Options
Download
Patches
Plain Diff
obuch with cross and graphic SAVING LORA
parent
fd807d16
master
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.ipynb_checkpoints/bertwithgoodgrad-checkpoint.py
+1
-1
.ipynb_checkpoints/bertwithgoodgrad-checkpoint.py
bertwithgoodgrad.py
+1
-1
bertwithgoodgrad.py
with
2 additions
and
2 deletions
+2
-2
.ipynb_checkpoints/bertwithgoodgrad-checkpoint.py
+
1
−
1
View file @
01a9d117
...
...
@@ -43,7 +43,7 @@ class Classifiers(torch.nn.Module):
def
forward
(
self
,
hidden_state
):
cls_token
=
hidden_state
[:,
0
,
:]
# Берем [CLS] токен
return
{
'safety'
:
torch
.
softmax
(
self
.
safety
(
cls_token
),
'safety'
:
torch
.
softmax
(
self
.
safety
(
cls_token
)
)
,
'attack'
:
torch
.
softmax
(
self
.
attack
(
cls_token
))
}
...
...
This diff is collapsed.
Click to expand it.
bertwithgoodgrad.py
+
1
−
1
View file @
01a9d117
...
...
@@ -43,7 +43,7 @@ class Classifiers(torch.nn.Module):
def
forward
(
self
,
hidden_state
):
cls_token
=
hidden_state
[:,
0
,
:]
# Берем [CLS] токен
return
{
'safety'
:
torch
.
softmax
(
self
.
safety
(
cls_token
),
'safety'
:
torch
.
softmax
(
self
.
safety
(
cls_token
)
)
,
'attack'
:
torch
.
softmax
(
self
.
attack
(
cls_token
))
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets