Spaces:
Running
Running
Update README.md
Browse files
README.md
CHANGED
|
@@ -20,19 +20,9 @@ Use the following code to get started with HiTs:
|
|
| 20 |
|
| 21 |
```python
|
| 22 |
from hierarchy_transformers import HierarchyTransformer
|
| 23 |
-
from hierarchy_transformers.utils import get_torch_device
|
| 24 |
-
|
| 25 |
-
# set up the device (use cpu if no gpu found)
|
| 26 |
-
gpu_id = 0
|
| 27 |
-
device = get_torch_device(gpu_id)
|
| 28 |
|
| 29 |
# load the model
|
| 30 |
-
|
| 31 |
-
model = HierarchyTransformer.from_pretrained(
|
| 32 |
-
model_name_or_path='Hierarchy-Transformers/HiT-MiniLM-L12-WordNetNoun',
|
| 33 |
-
revision=revision
|
| 34 |
-
device=device
|
| 35 |
-
)
|
| 36 |
|
| 37 |
# entity names to be encoded.
|
| 38 |
entity_names = ["computer", "personal computer", "fruit", "berry"]
|
|
|
|
| 20 |
|
| 21 |
```python
|
| 22 |
from hierarchy_transformers import HierarchyTransformer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
# load the model
|
| 25 |
+
model = HierarchyTransformer.from_pretrained('Hierarchy-Transformers/HiT-MiniLM-L12-WordNetNoun')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
# entity names to be encoded.
|
| 28 |
entity_names = ["computer", "personal computer", "fruit", "berry"]
|