parquet-converter
commited on
Commit
•
9263006
1
Parent(s):
70ee7ff
Update parquet files
Browse files- MME-RealWorld-Base64.py +0 -30
- MME-RealWorld-CN/MME_RealWorld_CN_base64_1.json +0 -3
- MME-RealWorld/MME_RealWorld_base64_0.json +0 -3
- MME-RealWorld/MME_RealWorld_base64_2.json +0 -3
- MME-RealWorld/MME_RealWorld_base64_3.json +0 -3
- MME-RealWorld/MME_RealWorld_base64_4.json +0 -3
- MME-RealWorld/MME_RealWorld_base64_5.json +0 -3
- MME-RealWorld/MME_RealWorld_base64_6.json +0 -3
- MME-RealWorld/MME_RealWorld_base64_7.json +0 -3
- MME-RealWorld/MME_RealWorld_base64_8.json +0 -3
- README.md +0 -26
- dataset_info.json +0 -3
- MME-RealWorld/MME_RealWorld_base64_1.json → default/partial-train/0000.parquet +2 -2
- MME-RealWorld-CN/MME_RealWorld_CN_base64_0.json → default/partial-train/0001.parquet +2 -2
- nohup.out +0 -0
MME-RealWorld-Base64.py
DELETED
@@ -1,30 +0,0 @@
|
|
1 |
-
import json
|
2 |
-
import os
|
3 |
-
from datasets import Dataset, DatasetDict, Features, Value, Sequence
|
4 |
-
|
5 |
-
def load_json_lines(file_path):
|
6 |
-
with open(file_path, 'r') as f:
|
7 |
-
for line in f:
|
8 |
-
yield json.loads(line)
|
9 |
-
|
10 |
-
def _generate_examples(chunk_files):
|
11 |
-
for file in chunk_files:
|
12 |
-
for example in load_json_lines(file):
|
13 |
-
yield example['Question_id'], example
|
14 |
-
|
15 |
-
def load_dataset(*args, **kwargs):
|
16 |
-
dataset_dir = kwargs['data_dir'] # The directory containing JSON chunks
|
17 |
-
chunk_files = [os.path.join(dataset_dir, f) for f in os.listdir(dataset_dir) if f.endswith('.json')]
|
18 |
-
features = Features({
|
19 |
-
'index': Value(dtype='string'),
|
20 |
-
'image': Value(dtype='string'),
|
21 |
-
'question': Value(dtype='string'),
|
22 |
-
'multi-choice options': Sequence(Value(dtype='string')),
|
23 |
-
'answer': Value(dtype='string'),
|
24 |
-
'category': Value(dtype='string'),
|
25 |
-
'l2-category': Value(dtype='string'),
|
26 |
-
})
|
27 |
-
dataset = DatasetDict({
|
28 |
-
'train': Dataset.from_generator(lambda: _generate_examples(chunk_files), features=features)
|
29 |
-
})
|
30 |
-
return dataset
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MME-RealWorld-CN/MME_RealWorld_CN_base64_1.json
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:0e369737e105ea5bd94c11bde63a2288592736a885a4a5dd8df8fb87f3a5c816
|
3 |
-
size 2209850160
|
|
|
|
|
|
|
|
MME-RealWorld/MME_RealWorld_base64_0.json
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:cb933494d4be23fa2859bab882ac70999067f6ef083feb64d7dc41adf2845aea
|
3 |
-
size 4189305921
|
|
|
|
|
|
|
|
MME-RealWorld/MME_RealWorld_base64_2.json
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:180154f62ab56ed1ff3d4de00fe3c70a91b8e6bd13c8fe5afffe164d55b1177e
|
3 |
-
size 4184630252
|
|
|
|
|
|
|
|
MME-RealWorld/MME_RealWorld_base64_3.json
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:11911a9c92ec757e18bf7fcbb95046e49017b1c255ec9c3446fd6eb43732919d
|
3 |
-
size 4186695809
|
|
|
|
|
|
|
|
MME-RealWorld/MME_RealWorld_base64_4.json
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:479c15598a299261b5ae011aaa7b0774fd268ec9e137f3477de9d9cb27c05f19
|
3 |
-
size 4187442465
|
|
|
|
|
|
|
|
MME-RealWorld/MME_RealWorld_base64_5.json
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:926902add2df836300d6ba19abeaca9dbc834b296cf037352a8fb8fe82f2e7f0
|
3 |
-
size 4179256570
|
|
|
|
|
|
|
|
MME-RealWorld/MME_RealWorld_base64_6.json
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:51f3dd102580f0b25c4e9afe55c274677714b14c965b0ecf8b3489d4c9f76f00
|
3 |
-
size 4185832480
|
|
|
|
|
|
|
|
MME-RealWorld/MME_RealWorld_base64_7.json
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:d5913c2b244a3dc4f38b67291a8ca97f6a431bf884b8c96843152c7cb3643dd3
|
3 |
-
size 4185881576
|
|
|
|
|
|
|
|
MME-RealWorld/MME_RealWorld_base64_8.json
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:1083e62f26699c7a875b98aab55e6d0cd98d1b5cb33b97dfa8af757e4039c993
|
3 |
-
size 1392593525
|
|
|
|
|
|
|
|
README.md
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
# MME-RealWorld Dataset
|
2 |
-
|
3 |
-
This dataset contains multiple JSON files split into chunks. It includes information such as questions, images encoded in base64, and other related metadata.
|
4 |
-
|
5 |
-
## Usage
|
6 |
-
|
7 |
-
You can load the dataset using the `datasets` library:
|
8 |
-
|
9 |
-
```python
|
10 |
-
from datasets import load_dataset
|
11 |
-
|
12 |
-
dataset = load_dataset('yifanzhang114/MME-RealWorld-Base64', data_dir='MME-RealWorld')
|
13 |
-
dataset = load_dataset('yifanzhang114/MME-RealWorld-Base64', data_dir='MME-RealWorld-CN')
|
14 |
-
|
15 |
-
## the image can be decoded by
|
16 |
-
|
17 |
-
def decode_base64_to_image(base64_string, target_size=-1):
|
18 |
-
image_data = base64.b64decode(base64_string)
|
19 |
-
image = Image.open(io.BytesIO(image_data))
|
20 |
-
if image.mode in ('RGBA', 'P'):
|
21 |
-
image = image.convert('RGB')
|
22 |
-
if target_size > 0:
|
23 |
-
image.thumbnail((target_size, target_size))
|
24 |
-
return image
|
25 |
-
|
26 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dataset_info.json
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:585506df014c1561dd9347b438ca64ef9633628c0b9000fbf93658e5cb7aa987
|
3 |
-
size 193
|
|
|
|
|
|
|
|
MME-RealWorld/MME_RealWorld_base64_1.json → default/partial-train/0000.parquet
RENAMED
@@ -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:f7b4e57c77c58ef6b67ca049226a2b5b96ec1c86d6364aa367d6ea783447ff2d
|
3 |
+
size 2520048531
|
MME-RealWorld-CN/MME_RealWorld_CN_base64_0.json → default/partial-train/0001.parquet
RENAMED
@@ -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:f0b5328d483ad2615bdd375d57857d0ef18070b7b05ccf7f6c5b0001939b0664
|
3 |
+
size 1502170769
|
nohup.out
DELETED
File without changes
|