chidamnat2002 commited on
Commit
9037487
·
verified ·
1 Parent(s): 3c6154f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -4
README.md CHANGED
@@ -95,10 +95,10 @@ id2label = {idx: label for label, idx in label2id.items()}
95
  text = "Discover the latest trends in AI and wearable technology."
96
 
97
  with torch.no_grad():
98
- inputs = tokenizer(text, return_tensors="pt", truncation=True)
99
- outputs = model(**inputs)
100
- probs = torch.sigmoid(outputs.logits).squeeze().cpu().numpy()
101
- predicted_labels = [(id2label[i], round(p, 3)) for i, p in enumerate(probs) if p >= 0.5]
102
  ```
103
 
104
  📖 Citation
 
95
  text = "Discover the latest trends in AI and wearable technology."
96
 
97
  with torch.no_grad():
98
+ inputs = tokenizer(text, return_tensors="pt", truncation=True)
99
+ outputs = model(**inputs)
100
+ probs = torch.sigmoid(outputs.logits).squeeze().cpu().numpy()
101
+ predicted_labels = [(id2label[i], round(p, 3)) for i, p in enumerate(probs) if p >= 0.5]
102
  ```
103
 
104
  📖 Citation