Update README.md
Browse files
README.md
CHANGED
@@ -25,7 +25,7 @@ from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
|
25 |
model_id = "oshizo/japanese-sexual-moderation-v2"
|
26 |
|
27 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
28 |
-
|
29 |
model_id,
|
30 |
problem_type="regression"
|
31 |
)
|
@@ -38,7 +38,7 @@ texts = [
|
|
38 |
|
39 |
with torch.no_grad():
|
40 |
encoding = tokenizer(texts, padding=True, max_length=64, return_tensors="pt")
|
41 |
-
scores =
|
42 |
|
43 |
# tensor([[-0.0045],
|
44 |
# [ 0.2954],
|
|
|
25 |
model_id = "oshizo/japanese-sexual-moderation-v2"
|
26 |
|
27 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
28 |
+
model = AutoModelForSequenceClassification.from_pretrained(
|
29 |
model_id,
|
30 |
problem_type="regression"
|
31 |
)
|
|
|
38 |
|
39 |
with torch.no_grad():
|
40 |
encoding = tokenizer(texts, padding=True, max_length=64, return_tensors="pt")
|
41 |
+
scores = model(**encoding).logits
|
42 |
|
43 |
# tensor([[-0.0045],
|
44 |
# [ 0.2954],
|