linh101201 commited on
Commit
b4e1e67
·
verified ·
1 Parent(s): 1f4c6ac

Create README

Browse files
Files changed (1) hide show
  1. README.md +11 -0
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)