Update README.md
Browse files
README.md
CHANGED
@@ -65,19 +65,9 @@ Use the code below to get started with the model.
|
|
65 |
|
66 |
```python
|
67 |
from hierarchy_transformers import HierarchyTransformer
|
68 |
-
from hierarchy_transformers.utils import get_torch_device
|
69 |
-
|
70 |
-
# set up the device (use cpu if no gpu found)
|
71 |
-
gpu_id = 0
|
72 |
-
device = get_torch_device(gpu_id)
|
73 |
|
74 |
# load the model
|
75 |
-
|
76 |
-
model = HierarchyTransformer.from_pretrained(
|
77 |
-
model_name_or_path='Hierarchy-Transformers/HiT-MiniLM-L12-WordNetNoun',
|
78 |
-
revision=revision
|
79 |
-
device=device
|
80 |
-
)
|
81 |
|
82 |
# entity names to be encoded.
|
83 |
entity_names = ["computer", "personal computer", "fruit", "berry"]
|
|
|
65 |
|
66 |
```python
|
67 |
from hierarchy_transformers import HierarchyTransformer
|
|
|
|
|
|
|
|
|
|
|
68 |
|
69 |
# load the model
|
70 |
+
model = HierarchyTransformer.from_pretrained('Hierarchy-Transformers/HiT-MiniLM-L12-WordNetNoun')
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
# entity names to be encoded.
|
73 |
entity_names = ["computer", "personal computer", "fruit", "berry"]
|