AgaMiko commited on
Commit
cfcb71d
1 Parent(s): b7f6e9b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -1
README.md CHANGED
@@ -21,6 +21,8 @@ tokenizer = AutoTokenizer.from_pretrained("Voicelab/herbert-base-cased-sentiment
21
 
22
  model = AutoModelForSequenceClassification.from_pretrained("Voicelab/herbert-base-cased-sentiment")
23
 
 
 
24
  encoding = tokenizer(
25
  input,
26
  add_special_tokens=True,
@@ -29,9 +31,10 @@ encoding = tokenizer(
29
  padding='max_length',
30
  return_attention_mask=True,
31
  return_tensors='pt',
32
- ).to("cuda:0")
33
  output = model(**encoding).logits.to("cpu").detach().numpy()
34
  prediction = id2label[np.argmax(output)]
 
35
 
36
  ```
37
 
 
21
 
22
  model = AutoModelForSequenceClassification.from_pretrained("Voicelab/herbert-base-cased-sentiment")
23
 
24
+ input = ["Ale fajnie, spadł dzisiaj śnieg! Ulepimy dziś bałwana?"]
25
+
26
  encoding = tokenizer(
27
  input,
28
  add_special_tokens=True,
 
31
  padding='max_length',
32
  return_attention_mask=True,
33
  return_tensors='pt',
34
+ )
35
  output = model(**encoding).logits.to("cpu").detach().numpy()
36
  prediction = id2label[np.argmax(output)]
37
+ print(input, "--->", prediction)
38
 
39
  ```
40