| build_assistant_content |
Ran ran; our contract draft was wrong, not the code |
xiaofengShi/MechVQA/data_generation/format_verified_data.py code served (permissive licence) · get_code("8adc9cb24bd71f83") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
ARGS = {
'qa_pair': {
'answer': 'The capital of France is Paris.',
'final_answer': None,
'vote_result': {
'final_answer_think': 'France is a country in Europe. Paris is its capital city.'
},
'think': None
}
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| build_breakdown |
Ran ran; our contract draft was wrong, not the code |
xiaofengShi/MechVQA/evaluation/mechvqa_eval/summarize.py code served (permissive licence) · get_code("8e6846d1d7a08896") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
from collections import defaultdict
# Build a minimal records structure that the function expects
records = [
{
'original_record': {
'metadata': {
'category': 'type_a',
'source': 'dataset_1'
}
},
'evaluation_result': {
'model_v1': {
'voted_score': 1.0,
'error': False
},
'model_v2': {
'voted_score': 0.8,
'error': False
}
}
},
{
'original_record': {
'metadata': {
'category': 'type_b',
'source': 'dataset_2'
}
},
'evaluation_result': {
'model_v1': {
'voted_score': 0.5,
'error': False
}
}
},
{
'original_record': {
'metadata': {
'category': 'type_a',
'source': 'dataset_1'
}
},
'evaluation_result': {
'model_v1': {
'voted_score': 0.0,
'error': True
}
}
},
{
'original_record': {
'metadata': {
'category': 'type_b',
'source': 'dataset_2'
}
},
'evaluation_result': {
'model_v1': {
'voted_score': 1.0,
'error': False
}
}
},
{
'metadata': {
'category': 'type_c',
'source': 'dataset_3'
},
'evaluation_result': {
'model_v1': {
'voted_score': 0.75,
'error': False
}
}
}
]
ARGS = {
'records': records,
'target_model': 'model_v1',
'field': 'category'
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| build_extract_prompt |
Ran ran; our contract draft was wrong, not the code |
xiaofengShi/MechVQA/data_generation/extract_pipeline.py code served (permissive licence) · get_code("e22a4f517793a5eb") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
torch.manual_seed(0)
# Construct arguments for build_extract_prompt
drawing_path = "/path/to/drawing_sample.pdf"
ocr_text = """
技术要求
1. 热处理后齿面硬度为 241~286HBW
2. 未注倒角为 C2
3. 齿轮内在质量按 MQ 级 (GB/T3480.5-2008) 执行
4. 齿根圆滑过渡,棱角倒钝
5. 未注尺寸公差按GB/T 1804-2000-m
6. 未注几何公差按GB/T 1184-1996-K
"""
md_tables = [
"""| 序号 | 零件名称 | 是否标准件 | 数量 | 材料 |
|------|---------|---------|------|------|
| 1 | 活塞 | 非标准件 | 1 | 铸铁 |
| 2 | 连杆螺栓 | 标准件 | 4 | 45号钢 |""",
"""| 项目 | 规格 | 数值 |
|------|------|------|
| 齿数 | - | 42 |
| 模数 | - | 2.5 |
| 齿宽 | - | 20 |
| 硬度 | HBW | 260 |"""
]
ARGS = {
"drawing_path": drawing_path,
"ocr_text": ocr_text,
"md_tables": md_tables
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| extract_question_from_prompt |
Ran ran; our contract draft was wrong, not the code |
xiaofengShi/MechVQA/data_generation/format_verified_data.py code served (permissive licence) · get_code("ebd88eeb2a611e47") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
torch.manual_seed(0)
# Construct valid arguments for extract_question_from_prompt
ARGS = {
"prompt": "中文问题:这是一个关于机器学习的问题吗?\n一些背景信息。"
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| extract_question_from_prompt |
Ran ran; our contract draft was wrong, not the code |
xiaofengShi/MechVQA/data_generation/generate_fixed_questions.py code served (permissive licence) · get_code("0a7d2d792524cd74") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import re
QUESTION_PATTERNS = (re.compile('^中文问题[::](.*)$', re.MULTILINE), re.compile('^问题[::](.*)$', re.MULTILINE), re.compile('^Question[::](.*)$', re.MULTILINE))
def extract_question_from_prompt(prompt: str) -> str:
"""Extract question text from the original question-generation prompt."""
for pattern in QUESTION_PATTERNS:
match = pattern.search(prompt)
if match:
return match.group(1).strip()
return ''
# Setup code
ARGS = {
'prompt': 'Question:What is the capital of France?'
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| format_extract_metadata |
Ran ran; our contract draft was wrong, not the code |
xiaofengShi/MechVQA/data_generation/generate_vqa_free_query.py code served (permissive licence) · get_code("a0a496efd5b6f7b6") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import json
from typing import Callable, List, Dict, Any, Iterable, Optional
def format_extract_metadata(params: Dict[str, Any]) -> str:
if not params:
return '{}'
return json.dumps(params, ensure_ascii=False, indent=2)
# Setup code
ARGS = {
"params": {
"model_name": "test_model",
"version": "1.0",
"layer_count": 3,
"hidden_dim": 512,
"config": {
"learning_rate": 0.001,
"batch_size": 32,
"epochs": 10
},
"tags": ["nlp", "transformer", "pretrained"],
"metrics": {
"accuracy": 0.95,
"loss": 0.042
}
}
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| generate_answer_with_temperature |
Ran ran; our contract draft was wrong, not the code |
xiaofengShi/MechVQA/data_generation/generate_answers_for_vqa.py code served (permissive licence) · get_code("207bbe044e833c47") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import json
from unittest.mock import MagicMock, patch
# Mock the helper functions that are called but not defined in the function
def normalize_capability(capability: str) -> str:
"""Mock normalization of capability"""
valid_capabilities = ['Recognition', 'Reasoning', 'Judging']
if capability in valid_capabilities:
return capability
return 'Recognition'
def normalize_language(language: str) -> str:
"""Mock normalization of language"""
valid_languages = ['中文', '英文']
if language in valid_languages:
return language
return '中文'
def answer_language_instruction(language: str) -> str:
"""Mock language instruction"""
if language == '英文':
return 'Respond in English.'
return '用中文回答。'
def call_openai_compatible(prompt: str, model: str, image_paths, temperature: float, thinking: bool, timeout: int) -> str:
"""Mock OpenAI compatible API call"""
return "This is a mock answer to the mechanical drawing question."
# Patch the functions in the module scope
import sys
current_module = sys.modules[__name__]
current_module.normalize_capability = normalize_capability
current_module.normalize_language = normalize_language
current_module.answer_language_instruction = answer_language_instruction
current_module.call_openai_compatible = call_openai_compatible
ARGS = {
'question': '这个零件的长度是多少?',
'capability': 'Recognition',
'image_path': '/path/to/mechanical/drawing.png',
'model': 'gpt-4-vision',
'params': {
'views': ['Front', 'Top', 'Side'],
'dimensions': [100, 50, 25],
'material': 'Steel'
},
'language': '中文',
'request_timeout': 240
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_correct_answer |
Ran ran; our contract draft was wrong, not the code |
xiaofengShi/MechVQA/evaluation/mechvqa_eval/evaluate_vqa.py code served (permissive licence) · get_code("24205d22b172393e") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import re
from typing import Any, Dict, List, Optional, Tuple
def extract_answer(response: str) -> str:
if not response:
return ''
match = re.search('<answer>(.*?)</answer>', response, flags=re.DOTALL | re.IGNORECASE)
if match:
return match.group(1).strip()
match = re.search('<answer>(.*)', response, flags=re.DOTALL | re.IGNORECASE)
if match:
return match.group(1).strip()
match = re.search('</think>(.*)', response, flags=re.DOTALL | re.IGNORECASE)
if match and match.group(1).strip():
return match.group(1).strip()
return response.strip()
def get_correct_answer(record: Dict[str, Any]) -> str:
for message in record.get('messages', []):
if message.get('role') == 'assistant' and message.get('content'):
return extract_answer(str(message.get('content', '')))
metadata = record.get('metadata', {})
check_results = record.get('check_results', {})
return str(metadata.get('correct_answer') or check_results.get('correct_answer') or record.get('answer', ''))
# Construct valid arguments for get_correct_answer
record_with_messages = {
'messages': [
{'role': 'user', 'content': 'What is 2+2?'},
{'role': 'assistant', 'content': '<answer>4</answer>'}
],
'metadata': {},
'check_results': {}
}
record_with_metadata = {
'messages': [],
'metadata': {'correct_answer': 'Paris'},
'check_results': {},
'answer': 'fallback'
}
record_with_check_results = {
'messages': [],
'metadata': {},
'check_results': {'correct_answer': 'Berlin'},
'answer': 'fallback2'
}
record_simple = {
'messages': [],
'metadata': {},
'check_results': {},
'answer': 'simple_answer'
}
record_empty = {}
ARGS = {
'record': record_with_messages
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_images |
Ran ran; our contract draft was wrong, not the code |
xiaofengShi/MechVQA/evaluation/mechvqa_eval/evaluate_vqa.py code served (permissive licence) · get_code("f5bda340023ee7e1") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
# Construct valid arguments for get_images function
torch.manual_seed(0)
# The function takes a single parameter: record (Dict[str, Any])
# It accesses record.get('images', []) and expects images to be either:
# 1. A string (which gets wrapped in a list if non-empty)
# 2. An iterable of paths (which get converted to strings and filtered)
# Test case 1: images as a list of paths
record_with_list = {
'images': ['path/to/image1.jpg', 'path/to/image2.png', None, '']
}
ARGS = {
'record': record_with_list
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_user_question |
Ran ran; our contract draft was wrong, not the code |
xiaofengShi/MechVQA/evaluation/mechvqa_eval/evaluate_vqa.py code served (permissive licence) · get_code("213d40abdad4993d") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
from typing import Any, Dict, List, Optional, Tuple
torch.manual_seed(0)
# Test case 1: record with messages list containing user role
record_with_messages = {
'messages': [
{'role': 'assistant', 'content': 'Hello there'},
{'role': 'user', 'content': 'What is the answer?'},
{'role': 'assistant', 'content': 'The answer is 42'}
]
}
ARGS = {
'record': record_with_messages
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| image_to_data_url |
Ran ran; our contract draft was wrong, not the code |
xiaofengShi/MechVQA/evaluation/mechvqa_eval/providers.py code served (permissive licence) · get_code("ccaf235bfd4ec58f") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import base64
from pathlib import Path
import tempfile
import os
# Create a temporary image file for testing
temp_dir = tempfile.mkdtemp()
temp_image_path = os.path.join(temp_dir, "test_image.png")
# Write a minimal valid PNG file (1x1 pixel)
png_data = base64.b64decode(
b"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="
)
with open(temp_image_path, 'wb') as f:
f.write(png_data)
ARGS = {
'path': temp_image_path
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| json_language_label |
Ran ran; our contract draft was wrong, not the code |
xiaofengShi/MechVQA/data_generation/language.py code served (permissive licence) · get_code("9e0fc12c9bdf4f4e") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
from typing import Any
# Setup for json_language_label function
# The function takes a 'language' parameter of type Any
# and normalizes it using the normalize_language function
ARGS = {
'language': '中文'
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| load_jsonl |
Ran ran; our contract draft was wrong, not the code |
xiaofengShi/MechVQA/evaluation/mechvqa_eval/io_utils.py code served (permissive licence) · get_code("0596526ef5c6ca8e") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import json
from pathlib import Path
import tempfile
import os
# Create a temporary JSONL file for testing
temp_dir = tempfile.mkdtemp()
temp_jsonl_path = os.path.join(temp_dir, "test.jsonl")
# Write some sample JSONL data
test_records = [
{"id": 1, "name": "Alice", "value": 42},
{"id": 2, "name": "Bob", "value": 100},
{"id": 3, "name": "Charlie", "value": 75}
]
with open(temp_jsonl_path, 'w', encoding='utf-8') as f:
for record in test_records:
f.write(json.dumps(record) + '\n')
ARGS = {
"path": temp_jsonl_path
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| load_jsonl_files |
Ran ran; our contract draft was wrong, not the code |
xiaofengShi/MechVQA/data_generation/check_generated_questions.py code served (permissive licence) · get_code("83657d080d13acad") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import json
import os
import tempfile
from typing import Any, Dict, Iterable, List, Optional, Sequence
# Create temporary JSONL files for testing
temp_dir = tempfile.mkdtemp()
# Create first test file with valid JSON lines
test_file_1 = os.path.join(temp_dir, "test1.jsonl")
with open(test_file_1, 'w', encoding='utf-8') as f:
f.write('{"key": "value1", "number": 1}\n')
f.write('{"key": "value2", "number": 2}\n')
# Create second test file with valid JSON lines
test_file_2 = os.path.join(temp_dir, "test2.jsonl")
with open(test_file_2, 'w', encoding='utf-8') as f:
f.write('{"name": "Alice", "age": 30}\n')
f.write('{"name": "Bob", "age": 25}\n')
# Create a nonexistent file path for testing file not found handling
nonexistent_file = os.path.join(temp_dir, "nonexistent.jsonl")
# Define ARGS with all parameters
ARGS = {
'paths': [test_file_1, test_file_2],
'ignore_errors': False
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| load_jsonl_files |
Ran ran; our contract draft was wrong, not the code |
xiaofengShi/MechVQA/data_generation/generate_answers_for_vqa.py code served (permissive licence) · get_code("fb0311f743cf0c68") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import os
import json
import tempfile
from typing import List, Dict, Any, Iterable
# Create temporary JSONL files for testing
temp_dir = tempfile.mkdtemp()
# Create first test JSONL file
jsonl_file_1 = os.path.join(temp_dir, "test1.jsonl")
with open(jsonl_file_1, 'w', encoding='utf-8') as f:
f.write('{"id": 1, "text": "hello"}\n')
f.write('{"id": 2, "text": "world"}\n')
f.write('{"id": 3, "text": "discarded", "note": "舍弃"}\n')
# Create second test JSONL file
jsonl_file_2 = os.path.join(temp_dir, "test2.jsonl")
with open(jsonl_file_2, 'w', encoding='utf-8') as f:
f.write('{"id": 4, "text": "foo"}\n')
f.write('\n') # empty line to test
f.write('{"id": 5, "text": "bar"}\n')
# Create a non-existent path to test the ignore case
nonexistent_path = os.path.join(temp_dir, "nonexistent.jsonl")
# Define paths as an iterable (list)
paths = [jsonl_file_1, jsonl_file_2, nonexistent_path]
ARGS = {
'paths': paths,
'encoding': 'utf-8',
'ignore_errors': False
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| load_jsonl_files |
Ran ran; our contract draft was wrong, not the code |
xiaofengShi/MechVQA/data_generation/generate_vqa_free_query.py code served (permissive licence) · get_code("6cbbe1813b76ba59") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import os
import json
import tempfile
from typing import Iterable, List, Dict, Any
# Create temporary JSONL files for testing
temp_dir = tempfile.mkdtemp()
# Create first JSONL file
jsonl_file_1 = os.path.join(temp_dir, "test1.jsonl")
with open(jsonl_file_1, 'w', encoding='utf-8') as f:
f.write('{"id": 1, "text": "hello"}\n')
f.write('{"id": 2, "text": "world"}\n')
f.write('{"id": 3, "text": "test", "note": "舍弃"}\n')
# Create second JSONL file
jsonl_file_2 = os.path.join(temp_dir, "test2.jsonl")
with open(jsonl_file_2, 'w', encoding='utf-8') as f:
f.write('{"id": 4, "text": "foo"}\n')
f.write('\n') # empty line
f.write('{"id": 5, "text": "bar"}\n')
# Create a non-existent file path to test the existence check
nonexistent_file = os.path.join(temp_dir, "nonexistent.jsonl")
# Define ARGS
ARGS = {
'paths': [jsonl_file_1, jsonl_file_2, nonexistent_file],
'encoding': 'utf-8',
'ignore_errors': False
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| normalize_language |
Ran ran; our contract draft was wrong, not the code |
xiaofengShi/MechVQA/data_generation/language.py code served (permissive licence) · get_code("58924881c1ca6801") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
# Test case 1: valid Chinese language input
ARGS = {
'value': '中文',
'default': '中文'
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| question_language_instruction |
Ran ran; our contract draft was wrong, not the code |
xiaofengShi/MechVQA/data_generation/language.py code served (permissive licence) · get_code("959c5a8ceb4986d6") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
# Setup for question_language_instruction function
# The function takes one parameter: language (Any type)
# It normalizes the language and returns an instruction string
# Test cases for the language parameter
ARGS = {
'language': '英文'
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| read_json |
Ran ran; our contract draft was wrong, not the code |
xiaofengShi/MechVQA/evaluation/mechvqa_eval/io_utils.py code served (permissive licence) · get_code("3d41ae5289167635") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import json
import tempfile
from pathlib import Path
from typing import Any, Dict
# Create a temporary JSON file with test data
temp_dir = tempfile.mkdtemp()
test_data = {
"key1": "value1",
"key2": 42,
"key3": [1, 2, 3],
"key4": {"nested": "object"}
}
temp_file_path = str(Path(temp_dir) / "test.json")
with open(temp_file_path, 'w', encoding='utf-8') as f:
json.dump(test_data, f)
ARGS = {
"path": temp_file_path
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| read_jsonl |
Ran ran; our contract draft was wrong, not the code |
xiaofengShi/MechVQA/data_generation/generate_vqa_free_query.py code served (permissive licence) · get_code("f73db1bba0fc60bf") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import json
import tempfile
import os
# Create a temporary JSONL file with valid JSON records
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test.jsonl")
with open(temp_file, 'w', encoding='utf-8') as f:
f.write('{"name": "Alice", "age": 30}\n')
f.write('{"name": "Bob", "age": 25}\n')
f.write('\n') # blank line to test skipping
f.write('{"name": "Charlie", "age": 35}\n')
ARGS = {
'path': temp_file
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| resolve_data_source |
Ran ran; our contract draft was wrong, not the code |
xiaofengShi/MechVQA/data_generation/format_verified_data.py code served (permissive licence) · get_code("baebeda17a61fafc") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
from pathlib import Path
from typing import Any, Dict, Optional
torch.manual_seed(0)
# Construct arguments for resolve_data_source
image_path = "/home/user/data/images/sample.jpg"
record = {
'metadata': {
'source': 'dataset_v1'
},
'id': 123
}
qa_pair = {
'question': 'What is in the image?',
'answer': 'A cat',
'data_source': 'qa_source_1'
}
explicit_source = None
ARGS = {
'image_path': image_path,
'record': record,
'qa_pair': qa_pair,
'explicit_source': explicit_source
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| safe_json_loads |
Ran ran; our contract draft was wrong, not the code |
xiaofengShi/MechVQA/data_generation/check_generated_questions.py code served (permissive licence) · get_code("42f7436bee9f4cf1") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import json
from typing import Any, Dict
# The function safe_json_loads takes a single parameter: text (str)
# It attempts to parse JSON from the text, either directly or by extracting
# a JSON block from it if direct parsing fails.
# Test case 1: Simple valid JSON object as a string
text_simple = '{"key": "value", "number": 42}'
# Test case 2: Valid JSON embedded in other text
text_embedded = 'Some text before {"nested": {"data": true}} and after'
# Test case 3: JSON with escaped quotes
text_escaped = '{"message": "He said \\"hello\\"", "status": "ok"}'
ARGS = {
'text': text_simple
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| safe_json_loads |
Ran ran; our contract draft was wrong, not the code |
xiaofengShi/MechVQA/data_generation/extract_pipeline.py code served (permissive licence) · get_code("620457f8545a4190") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import json
def _extract_json_block(s: str) -> str:
start = s.find('{')
if start == -1:
raise ValueError('No JSON object found in model response.')
stack = 0
for i in range(start, len(s)):
if s[i] == '{':
stack += 1
elif s[i] == '}':
stack -= 1
if stack == 0:
return s[start:i + 1]
raise ValueError('Unbalanced JSON braces in model response.')
def safe_json_loads(s: str) -> dict:
try:
return json.loads(s)
except Exception:
block = _extract_json_block(s)
return json.loads(block)
# Test case 1: Valid JSON string
test_string_1 = '{"key": "value", "number": 42}'
# Test case 2: Valid JSON with extra text before and after
test_string_2 = 'Some text before {"nested": {"data": [1, 2, 3]}} some text after'
# Test case 3: Valid JSON with multiple braces
test_string_3 = 'prefix {"a": 1, "b": {"c": 2}} suffix'
ARGS = {
"s": test_string_1
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| safe_json_loads |
Ran ran; our contract draft was wrong, not the code |
xiaofengShi/MechVQA/data_generation/generate_answers_for_vqa.py code served (permissive licence) · get_code("7246eaaf705f35c2") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import json
def _extract_json_block(s: str) -> str:
"""从字符串中提取 JSON 块"""
start = s.find('{')
if start == -1:
raise ValueError('未在回复中找到 JSON 对象')
stack = 0
for i in range(start, len(s)):
if s[i] == '{':
stack += 1
elif s[i] == '}':
stack -= 1
if stack == 0:
return s[start:i + 1]
raise ValueError('JSON 括号不平衡')
def safe_json_loads(s: str) -> dict:
"""安全地解析 JSON,如果直接解析失败则尝试提取 JSON 块"""
try:
return json.loads(s)
except Exception:
block = _extract_json_block(s)
return json.loads(block)
# Test case 1: Valid JSON string that parses directly
test_string_1 = '{"key": "value", "number": 42}'
# Test case 2: Valid JSON embedded in text with extra content
test_string_2 = 'Some text before {"name": "test", "items": [1, 2, 3]} and some text after'
# Test case 3: Nested JSON structure
test_string_3 = '{"outer": {"inner": "value"}, "array": [{"id": 1}, {"id": 2}]}'
ARGS = {
"s": test_string_1
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| generate_new_prompt |
Not yet run unverified (harvested, no recorded run) |
xiaofengShi/MechVQA/data_generation/generate_fixed_questions.py code served (permissive licence) · get_code("4f90754f556f81dd") How it ran |
| read_jsonl |
Not yet run unverified (harvested, no recorded run) |
xiaofengShi/MechVQA/data_generation/check_generated_questions.py code served (permissive licence) · get_code("0d8d1a6b7845a85d") How it ran |
| run_ocr |
Not yet run unverified (harvested, no recorded run) |
xiaofengShi/MechVQA/data_generation/extract_pipeline.py code served (permissive licence) · get_code("47642cc5a1f9107d") How it ran |