Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
adversarial-hatespeech
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mai
adversarial-hatespeech
c995a9acf86c083a726a9f93e5187e72b654d74b
adversarial-hatespeech
utils
attack.py
Find file
Normal view
Permalink
attack.py
91 B
Newer
Older
New script for attacking
mai
committed
2 years ago
1
2
import
transformers
Move evaluation to utils/eval.py
mai
committed
2 years ago
3
4
def
attack
(
sentence
,
model
,
tokenizer
):
model
=
model
.
to
(
device
)
New script for attacking
mai
committed
2 years ago
5