Ishwar B
commited on
Commit
·
d212377
1
Parent(s):
5174196
Use hf URLs for images
Browse files- data/clue/train.jsonl +2 -2
- data/mep/train.jsonl +2 -2
- data/stats.json +2 -2
- scripts/build_viewer_files.py +4 -1
data/clue/train.jsonl
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7f395f5f31a7b4c20a42ba81dfffccca279a8c90829c78bb2b12e6c628a4980c
|
| 3 |
+
size 1214855
|
data/mep/train.jsonl
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3c7aeb9034dd16f8cbdaceef1813de4a33cc52db208465d4edee65624a160c69
|
| 3 |
+
size 929483
|
data/stats.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
| 1 |
{
|
| 2 |
"clue": {
|
| 3 |
"num_examples": 1648,
|
| 4 |
-
"num_bytes":
|
| 5 |
"source_path": "raw/clue_metadata.jsonl",
|
| 6 |
"output_path": "data/clue/train.jsonl"
|
| 7 |
},
|
| 8 |
"mep": {
|
| 9 |
"num_examples": 1216,
|
| 10 |
-
"num_bytes":
|
| 11 |
"source_path": "raw/mep_metadata.jsonl",
|
| 12 |
"output_path": "data/mep/train.jsonl"
|
| 13 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"clue": {
|
| 3 |
"num_examples": 1648,
|
| 4 |
+
"num_bytes": 1214855,
|
| 5 |
"source_path": "raw/clue_metadata.jsonl",
|
| 6 |
"output_path": "data/clue/train.jsonl"
|
| 7 |
},
|
| 8 |
"mep": {
|
| 9 |
"num_examples": 1216,
|
| 10 |
+
"num_bytes": 929483,
|
| 11 |
"source_path": "raw/mep_metadata.jsonl",
|
| 12 |
"output_path": "data/mep/train.jsonl"
|
| 13 |
}
|
scripts/build_viewer_files.py
CHANGED
|
@@ -10,6 +10,8 @@ from typing import Dict, Iterator, MutableMapping
|
|
| 10 |
ROOT = Path(__file__).resolve().parents[1]
|
| 11 |
RAW_DIR = ROOT / "raw"
|
| 12 |
OUTPUT_DIR = ROOT / "data"
|
|
|
|
|
|
|
| 13 |
|
| 14 |
CONFIG_SOURCES: Dict[str, Path] = {
|
| 15 |
"clue": RAW_DIR / "clue_metadata.jsonl",
|
|
@@ -49,7 +51,8 @@ def _normalize_record(record: MutableMapping[str, object]) -> MutableMapping[str
|
|
| 49 |
image_path = record.get("image_path")
|
| 50 |
record["image_path"] = image_path
|
| 51 |
if image_path:
|
| 52 |
-
|
|
|
|
| 53 |
else:
|
| 54 |
record["image"] = None
|
| 55 |
return record
|
|
|
|
| 10 |
ROOT = Path(__file__).resolve().parents[1]
|
| 11 |
RAW_DIR = ROOT / "raw"
|
| 12 |
OUTPUT_DIR = ROOT / "data"
|
| 13 |
+
HF_DATASET_ID = "ishwarbb23/cuebench"
|
| 14 |
+
HF_IMAGE_PREFIX = f"hf://datasets/{HF_DATASET_ID}/"
|
| 15 |
|
| 16 |
CONFIG_SOURCES: Dict[str, Path] = {
|
| 17 |
"clue": RAW_DIR / "clue_metadata.jsonl",
|
|
|
|
| 51 |
image_path = record.get("image_path")
|
| 52 |
record["image_path"] = image_path
|
| 53 |
if image_path:
|
| 54 |
+
normalized_path = str(Path(image_path))
|
| 55 |
+
record["image"] = f"{HF_IMAGE_PREFIX}{normalized_path}"
|
| 56 |
else:
|
| 57 |
record["image"] = None
|
| 58 |
return record
|