Create README
Browse files
README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
| 2 |
+
import torch
|
| 3 |
+
|
| 4 |
+
model = AutoModelForSequenceClassification.from_pretrained("linh101201/scibert-concept-annotation", num_labels=2).to("cuda")
|
| 5 |
+
tokenizer = AutoTokenizer.from_pretrained("allenai/scibert_scivocab_uncased")
|
| 6 |
+
|
| 7 |
+
inputs = tokenizer("Large Language Model in Law Documents Hub", "natural language processing", return_tensors="pt").to("cuda")
|
| 8 |
+
|
| 9 |
+
with torch.no_grad():
|
| 10 |
+
logits = model(**inputs).logits
|
| 11 |
+
print(logits)
|