Spaces:
Sleeping
Sleeping
Commit
·
1503886
1
Parent(s):
997b5bb
Update app.py
Browse files
app.py
CHANGED
@@ -24,7 +24,6 @@ tokenizer = BertTokenizer.from_pretrained('bert-base-multilingual-cased')
|
|
24 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
25 |
bert_model = bert_model.to(device)
|
26 |
model_finetuned = GPT2LMHeadModel.from_pretrained('GPT_2')
|
27 |
-
model_finetuned.eval()
|
28 |
|
29 |
labels = ["не токсичный", "оскорбляющий", "непристойный", "угрожающий", "опасный"]
|
30 |
def text2toxicity(text, aggregate=True):
|
|
|
24 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
25 |
bert_model = bert_model.to(device)
|
26 |
model_finetuned = GPT2LMHeadModel.from_pretrained('GPT_2')
|
|
|
27 |
|
28 |
labels = ["не токсичный", "оскорбляющий", "непристойный", "угрожающий", "опасный"]
|
29 |
def text2toxicity(text, aggregate=True):
|