Update dataset card
Browse files
README.md
CHANGED
@@ -17,7 +17,7 @@ id2label = json.load(open(cached_download(hf_hub_url(REPO_ID, FILENAME)), "r"))
|
|
17 |
id2label = {int(k):v for k,v in id2label.items()}
|
18 |
```
|
19 |
|
20 |
-
To add an id2label mapping for a new dataset, simply define a Python dictionary, and then save that dictionary as a JSON file, like so:
|
21 |
```
|
22 |
import json
|
23 |
|
@@ -26,4 +26,5 @@ id2label = {0: 'cat', 1: 'dog'}
|
|
26 |
|
27 |
with open('cats-and-dogs-id2label.json', 'w') as fp:
|
28 |
json.dump(id2label, fp)
|
29 |
-
```
|
|
|
|
17 |
id2label = {int(k):v for k,v in id2label.items()}
|
18 |
```
|
19 |
|
20 |
+
To add an `id2label` mapping for a new dataset, simply define a Python dictionary, and then save that dictionary as a JSON file, like so:
|
21 |
```
|
22 |
import json
|
23 |
|
|
|
26 |
|
27 |
with open('cats-and-dogs-id2label.json', 'w') as fp:
|
28 |
json.dump(id2label, fp)
|
29 |
+
```
|
30 |
+
You can then upload it to this repository (assuming you have right access).
|