Nick Sorros commited on
Commit
1fc3d25
·
1 Parent(s): b8ec696

Shorten example width to fit in screen better

Browse files
Files changed (1) hide show
  1. README.md +10 -4
README.md CHANGED
@@ -25,10 +25,16 @@ You can use the model straight from the hub but because it contains a custom for
25
  ```
26
  from transformers import AutoModel, AutoTokenizer
27
 
28
- tokenizer = AutoTokenizer.from_pretrained("Wellcome/WellcomeBertMesh")
29
- model = AutoModel.from_pretrained("Wellcome/WellcomeBertMesh", trust_remote_code=True)
30
-
31
- inputs = tokenizer(["This grant is about malaria and not about HIV."], padding="max_length")
 
 
 
 
 
 
32
  labels = model(**inputs, return_labels=True)
33
  print(labels)
34
  ```
 
25
  ```
26
  from transformers import AutoModel, AutoTokenizer
27
 
28
+ tokenizer = AutoTokenizer.from_pretrained(
29
+ "Wellcome/WellcomeBertMesh"
30
+ )
31
+ model = AutoModel.from_pretrained(
32
+ "Wellcome/WellcomeBertMesh",
33
+ trust_remote_code=True
34
+ )
35
+
36
+ text = "This grant is about malaria and not about HIV."
37
+ inputs = tokenizer([text], padding="max_length")
38
  labels = model(**inputs, return_labels=True)
39
  print(labels)
40
  ```