Create model.py
Browse files
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
|