fclong commited on
Commit
3e1b852
1 Parent(s): c92c0f0

Create model.py

Browse files
Files changed (1) hide show
  1. model.py +7 -0
model.py ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ from transformers import BartTokenizer, BartModel
2
+
3
+ tokenizer = BartTokenizer.from_pretrained('facebook/bart-large') model = BartModel.from_pretrained('facebook/bart-large')
4
+
5
+ inputs = tokenizer("Hello, my dog is cute", return_tensors="pt") outputs = model(**inputs)
6
+
7
+ last_hidden_states = outputs.last_hidden_state