Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
ccl-core committed Dec 2, 2024
1 parent 1530926 commit 8e8ccf4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions datasets/1.0/huggingface-lmms-eval-lite/output/gqa.jsonl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{"gqa/split": "lite", "gqa/id": "201307251", "gqa/imageId": "n161313", "gqa/question": "Is it overcast?", "gqa/answer": "no", "gqa/fullAnswer": "No, it is clear.", "gqa/isBalanced": true, "gqa/groups": {"gqa/groups/global": "None", "gqa/groups/local": "01-weather_overcast"}, "gqa/entailed": "[]", "gqa/equivalent": "['201307251']", "gqa/types": {"gqa/types/structural": "verify", "gqa/types/semantic": "global", "gqa/types/detailed": "weatherVerifyC"}, "gqa/annotations/question": {"gqa/annotations/question/objectId": "None", "gqa/annotations/question/value": "None"}, "gqa/annotations/answer": {"gqa/annotations/answer/objectId": "None", "gqa/annotations/answer/value": "None"}, "gqa/annotations/fullAnswer": {"gqa/annotations/fullAnswer/objectId": "None", "gqa/annotations/fullAnswer/value": "None"}, "gqa/semantic": "[{'gqa/semantic/operation': b'select', 'gqa/semantic/argument': b'scene', 'gqa/semantic/dependencies': array([], dtype=int32)}, {'gqa/semantic/operation': b'verify weather', 'gqa/semantic/argument': b'overcast', 'gqa/semantic/dependencies': array([0], dtype=int32)}]", "gqa/semanticStr": "select: scene->verify weather: overcast [0]"}
{"gqa/split": "lite", "gqa/id": "20171139", "gqa/imageId": "n379991", "gqa/question": "What cooking utensil is round?", "gqa/answer": "baking pan", "gqa/fullAnswer": "The cooking utensil is a baking pan.", "gqa/isBalanced": true, "gqa/groups": {"gqa/groups/global": "cooking utensil", "gqa/groups/local": "12q-cooking utensil_round"}, "gqa/entailed": "['20171137', '20171138']", "gqa/equivalent": "['20171139']", "gqa/types": {"gqa/types/structural": "query", "gqa/types/semantic": "cat", "gqa/types/detailed": "categoryThat"}, "gqa/annotations/question": {"gqa/annotations/question/objectId": "None", "gqa/annotations/question/value": "None"}, "gqa/annotations/answer": {"gqa/annotations/answer/objectId": "None", "gqa/annotations/answer/value": "None"}, "gqa/annotations/fullAnswer": {"gqa/annotations/fullAnswer/objectId": "None", "gqa/annotations/fullAnswer/value": "None"}, "gqa/semantic": "[{'gqa/semantic/operation': b'select', 'gqa/semantic/argument': b'cooking utensil (3)', 'gqa/semantic/dependencies': array([], dtype=int32)}, {'gqa/semantic/operation': b'filter shape', 'gqa/semantic/argument': b'round', 'gqa/semantic/dependencies': array([0], dtype=int32)}, {'gqa/semantic/operation': b'query', 'gqa/semantic/argument': b'name', 'gqa/semantic/dependencies': array([1], dtype=int32)}]", "gqa/semanticStr": "select: cooking utensil (3)->filter shape: round [0]->query: name [1]"}
{"gqa/split": "lite", "gqa/id": "201303338", "gqa/imageId": "n518912", "gqa/question": "What ethnic group is the person that is wearing a jacket?", "gqa/answer": "caucasian", "gqa/fullAnswer": "The man is caucasian.", "gqa/isBalanced": true, "gqa/groups": {"gqa/groups/global": "race", "gqa/groups/local": "10q-man_race"}, "gqa/entailed": "['201303332', '201303333', '201303334', '201303335', '201303336', '201303337', '201303339', '201303316', '201303317', '201303341', '201303340', '201303343', '201303342', '201303344']", "gqa/equivalent": "['201303338', '201303339']", "gqa/types": {"gqa/types/structural": "query", "gqa/types/semantic": "attr", "gqa/types/detailed": "directWhich"}, "gqa/annotations/question": {"gqa/annotations/question/objectId": "None", "gqa/annotations/question/value": "None"}, "gqa/annotations/answer": {"gqa/annotations/answer/objectId": "None", "gqa/annotations/answer/value": "None"}, "gqa/annotations/fullAnswer": {"gqa/annotations/fullAnswer/objectId": "None", "gqa/annotations/fullAnswer/value": "None"}, "gqa/semantic": "[{'gqa/semantic/operation': b'select', 'gqa/semantic/argument': b'jacket (3)', 'gqa/semantic/dependencies': array([], dtype=int32)}, {'gqa/semantic/operation': b'relate', 'gqa/semantic/argument': b'person,wearing,s (0)', 'gqa/semantic/dependencies': array([0], dtype=int32)}, {'gqa/semantic/operation': b'query', 'gqa/semantic/argument': b'race', 'gqa/semantic/dependencies': array([1], dtype=int32)}]", "gqa/semanticStr": "select: jacket (3)->relate: person,wearing,s (0) [0]->query: race [1]"}
{"gqa/split": "lite", "gqa/id": "201307251", "gqa/imageId": "n161313", "gqa/question": "Is it overcast?", "gqa/answer": "no", "gqa/fullAnswer": "No, it is clear.", "gqa/isBalanced": true, "gqa/groups": {"gqa/groups/global": "None", "gqa/groups/local": "01-weather_overcast"}, "gqa/entailed": "[]", "gqa/equivalent": "['201307251']", "gqa/types": {"gqa/types/structural": "verify", "gqa/types/semantic": "global", "gqa/types/detailed": "weatherVerifyC"}, "gqa/annotations/question": {"gqa/annotations/question/objectId": "None", "gqa/annotations/question/value": "None"}, "gqa/annotations/answer": {"gqa/annotations/answer/objectId": "None", "gqa/annotations/answer/value": "None"}, "gqa/annotations/fullAnswer": {"gqa/annotations/fullAnswer/objectId": "None", "gqa/annotations/fullAnswer/value": "None"}, "gqa/semantic": "[{'gqa/semantic/operation': b'select', 'gqa/semantic/argument': b'scene', 'gqa/semantic/dependencies': []}, {'gqa/semantic/operation': b'verify weather', 'gqa/semantic/argument': b'overcast', 'gqa/semantic/dependencies': [0]}]", "gqa/semanticStr": "select: scene->verify weather: overcast [0]"}
{"gqa/split": "lite", "gqa/id": "20171139", "gqa/imageId": "n379991", "gqa/question": "What cooking utensil is round?", "gqa/answer": "baking pan", "gqa/fullAnswer": "The cooking utensil is a baking pan.", "gqa/isBalanced": true, "gqa/groups": {"gqa/groups/global": "cooking utensil", "gqa/groups/local": "12q-cooking utensil_round"}, "gqa/entailed": "['20171137', '20171138']", "gqa/equivalent": "['20171139']", "gqa/types": {"gqa/types/structural": "query", "gqa/types/semantic": "cat", "gqa/types/detailed": "categoryThat"}, "gqa/annotations/question": {"gqa/annotations/question/objectId": "None", "gqa/annotations/question/value": "None"}, "gqa/annotations/answer": {"gqa/annotations/answer/objectId": "None", "gqa/annotations/answer/value": "None"}, "gqa/annotations/fullAnswer": {"gqa/annotations/fullAnswer/objectId": "None", "gqa/annotations/fullAnswer/value": "None"}, "gqa/semantic": "[{'gqa/semantic/operation': b'select', 'gqa/semantic/argument': b'cooking utensil (3)', 'gqa/semantic/dependencies': []}, {'gqa/semantic/operation': b'filter shape', 'gqa/semantic/argument': b'round', 'gqa/semantic/dependencies': [0]}, {'gqa/semantic/operation': b'query', 'gqa/semantic/argument': b'name', 'gqa/semantic/dependencies': [1]}]", "gqa/semanticStr": "select: cooking utensil (3)->filter shape: round [0]->query: name [1]"}
{"gqa/split": "lite", "gqa/id": "201303338", "gqa/imageId": "n518912", "gqa/question": "What ethnic group is the person that is wearing a jacket?", "gqa/answer": "caucasian", "gqa/fullAnswer": "The man is caucasian.", "gqa/isBalanced": true, "gqa/groups": {"gqa/groups/global": "race", "gqa/groups/local": "10q-man_race"}, "gqa/entailed": "['201303332', '201303333', '201303334', '201303335', '201303336', '201303337', '201303339', '201303316', '201303317', '201303341', '201303340', '201303343', '201303342', '201303344']", "gqa/equivalent": "['201303338', '201303339']", "gqa/types": {"gqa/types/structural": "query", "gqa/types/semantic": "attr", "gqa/types/detailed": "directWhich"}, "gqa/annotations/question": {"gqa/annotations/question/objectId": "None", "gqa/annotations/question/value": "None"}, "gqa/annotations/answer": {"gqa/annotations/answer/objectId": "None", "gqa/annotations/answer/value": "None"}, "gqa/annotations/fullAnswer": {"gqa/annotations/fullAnswer/objectId": "None", "gqa/annotations/fullAnswer/value": "None"}, "gqa/semantic": "[{'gqa/semantic/operation': b'select', 'gqa/semantic/argument': b'jacket (3)', 'gqa/semantic/dependencies': []}, {'gqa/semantic/operation': b'relate', 'gqa/semantic/argument': b'person,wearing,s (0)', 'gqa/semantic/dependencies': [0]}, {'gqa/semantic/operation': b'query', 'gqa/semantic/argument': b'race', 'gqa/semantic/dependencies': [1]}]", "gqa/semanticStr": "select: jacket (3)->relate: person,wearing,s (0) [0]->query: race [1]"}
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ def _cast_value(ctx: Context, value: Any, data_type: type | term.URIRef | None):
return bounding_box.parse(value)
elif not isinstance(data_type, type):
raise ValueError(f"No special case for type {data_type}.")
elif isinstance(value, list) or isinstance(value, np.ndarray):
return [_cast_value(ctx=ctx, value=v, data_type=data_type) for v in value]
elif data_type == bytes and not isinstance(value, bytes):
return _to_bytes(value)
else:
Expand Down Expand Up @@ -227,13 +229,10 @@ def _get_result(row):
if _is_na(value):
value = None
elif is_repeated:
try:
value = [
value = [
_cast_value(self.node.ctx, v, field.data_type)
for v in value
]
except TypeError:
value = value
else:
value = _cast_value(self.node.ctx, value, field.data_type)

Expand Down

0 comments on commit 8e8ccf4

Please sign in to comment.