Upload folder using huggingface_hub
Browse files- .gitattributes +2 -0
- tot2mem-human-diffusion/human_information_retrieval_1.zip +3 -0
- tot2mem-human-diffusion/test.jsonl +0 -0
- tot2mem-video-contrastive-test/test.jsonl +0 -0
- tot2mem-video-contrastive-train/train.jsonl +3 -0
- tot2mem-video/test.jsonl +0 -0
- tot2mem-video/train.jsonl +3 -0
- tot2mem_dataset.py +90 -0
.gitattributes
CHANGED
|
@@ -58,3 +58,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 58 |
# Video files - compressed
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 58 |
# Video files - compressed
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 61 |
+
tot2mem-video/train.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 62 |
+
tot2mem-video-contrastive-train/train.jsonl filter=lfs diff=lfs merge=lfs -text
|
tot2mem-human-diffusion/human_information_retrieval_1.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:177dc04e227f98020a2e8fab26aa309547e3ab32a0ee1c469285c0a0ccb24cbd
|
| 3 |
+
size 2146156354
|
tot2mem-human-diffusion/test.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tot2mem-video-contrastive-test/test.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tot2mem-video-contrastive-train/train.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3f736b9763b650ef8b543ac8f16686cfa143f175fcf39b6d8ad42e6846d4f723
|
| 3 |
+
size 335755691
|
tot2mem-video/test.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tot2mem-video/train.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:adfdf0e361e791d970f95fef91b788be5304ba88dac8cce6920e731ede8cb7bd
|
| 3 |
+
size 301303224
|
tot2mem_dataset.py
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import json
|
| 2 |
+
import datasets
|
| 3 |
+
|
| 4 |
+
class Tot2mem(datasets.GeneratorBasedBuilder):
|
| 5 |
+
BUILDER_CONFIGS = [
|
| 6 |
+
datasets.BuilderConfig(name="tot2mem-video", version=datasets.Version("1.0.0")),
|
| 7 |
+
datasets.BuilderConfig(name="tot2mem-video-contrastive-train", version=datasets.Version("1.0.0")),
|
| 8 |
+
datasets.BuilderConfig(name="tot2mem-video-contrastive-test", version=datasets.Version("1.0.0")),
|
| 9 |
+
datasets.BuilderConfig(name="tot2mem-human-diffusion", version=datasets.Version("1.0.0")),
|
| 10 |
+
]
|
| 11 |
+
DEFAULT_CONFIG_NAME = "task1"
|
| 12 |
+
|
| 13 |
+
def _info(self):
|
| 14 |
+
if self.config.name == "tot2mem-video":
|
| 15 |
+
return datasets.DatasetInfo(
|
| 16 |
+
features=datasets.Features({
|
| 17 |
+
"id": datasets.Value("string"),
|
| 18 |
+
"image": datasets.Sequence(datasets.Value("string")),
|
| 19 |
+
"conversations": datasets.Sequence(
|
| 20 |
+
dataset.Features({
|
| 21 |
+
"from": datasets.Value("string"),
|
| 22 |
+
"value": datasets.Value("string")
|
| 23 |
+
})
|
| 24 |
+
)
|
| 25 |
+
})
|
| 26 |
+
)
|
| 27 |
+
|
| 28 |
+
elif self.config.name == "tot2mem-video-contrastive-train":
|
| 29 |
+
return datasets.DatasetInfo(
|
| 30 |
+
features=datasets.Features({
|
| 31 |
+
"qry": datasets.Value("string"),
|
| 32 |
+
"qry_image_path": datasets.Sequence(datasets.Value("string")),
|
| 33 |
+
"pos_text": datasets.Value("string"),
|
| 34 |
+
"pos_image_path": datasets.Value(None),
|
| 35 |
+
"neg_text": datasets.Value("string"),
|
| 36 |
+
"neg_image_path": datasets.Value(None),
|
| 37 |
+
})
|
| 38 |
+
)
|
| 39 |
+
|
| 40 |
+
elif self.config.name == "tot2mem-video-contrastive-test":
|
| 41 |
+
return datasets.DatasetInfo(
|
| 42 |
+
features=datasets.Features({
|
| 43 |
+
"id": datasets.Value("string"),
|
| 44 |
+
"real_recall": datasets.Value("string"),
|
| 45 |
+
"video_desc": datasets.Value("string"),
|
| 46 |
+
"image_path_list": datasets.Sequence(datasets.Value("string"))
|
| 47 |
+
})
|
| 48 |
+
)
|
| 49 |
+
|
| 50 |
+
elif self.config.name == "tot2mem-human-diffusion":
|
| 51 |
+
return datasets.DatasetInfo(
|
| 52 |
+
features=datasets.Features({
|
| 53 |
+
"id": datasets.Value("int32"),
|
| 54 |
+
"image": datasets.Sequence(datasets.Value("string")),
|
| 55 |
+
"conversations": datasets.Sequence(
|
| 56 |
+
dataset.Features({
|
| 57 |
+
"from": datasets.Value("string"),
|
| 58 |
+
"value": datasets.Value("string")
|
| 59 |
+
})
|
| 60 |
+
)
|
| 61 |
+
})
|
| 62 |
+
)
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
def _split_generators(self, dl_manager):
|
| 67 |
+
base = self.config.name
|
| 68 |
+
if base == "tot2mem-video":
|
| 69 |
+
return [
|
| 70 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"path": f"{base}/train.jsonl"}),
|
| 71 |
+
datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"path": f"{base}/test.jsonl"}),
|
| 72 |
+
]
|
| 73 |
+
elif base == "tot2mem-video-contrastive-train":
|
| 74 |
+
return [
|
| 75 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"path": f"{base}/train.jsonl"})
|
| 76 |
+
]
|
| 77 |
+
elif base == "tot2mem-video-contrastive-test":
|
| 78 |
+
return [
|
| 79 |
+
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"path": f"{base}/test.jsonl"})
|
| 80 |
+
]
|
| 81 |
+
elif base == "tot2mem-human-diffusion":
|
| 82 |
+
return [
|
| 83 |
+
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"path": f"{base}/test.jsonl"})
|
| 84 |
+
]
|
| 85 |
+
|
| 86 |
+
def _generate_examples(self, path):
|
| 87 |
+
with open(path, "r", encoding="utf-8") as f:
|
| 88 |
+
for i, line in enumerate(f):
|
| 89 |
+
ex = json.loads(line)
|
| 90 |
+
yield i, ex
|