Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1 |
-
---
|
2 |
-
license: unknown
|
3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: unknown
|
3 |
+
---
|
4 |
+
pip install transformers
|
5 |
+
from transformers import automodelforcausallm, autotokenizer
|
6 |
+
import torch
|
7 |
+
torch_device = "cuda" if torch.cuda.is_available() else "cpu"
|
8 |
+
model_name="mrm8488/distilroberta-finetuned-financial-news-sentiment-analysis"
|
9 |
+
tokenizer = autotokenizer.from_pretrained(model_name)
|
10 |
+
model=automodelforcausallm.from_pretrained(model_name,pad_token_id=tokenizer.eos_token_id).to(torch_device)
|
11 |
+
model_inputs=tokenizer('Nvidia reported profits of €10Mio',return_tensors='pt').to(torch_device)
|
12 |
+
output = model(**inputs).logits.argmax(axis=1)
|
13 |
+
|