SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2407.16364 · NeurIPS · 2024

Harmonizing Visual Text Comprehension and Generation

Hao Liu, Yuan Xie, Shu Wei, Jingqun Tang, Binghong Wu, Can Huang, Zhen Zhao, Chunhui Lin, Xin Tan, Zhizhong Zhang

arXiv · PDF · Open in the Atlas

Code that ran

11 of 18 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 9 failures of our instrument; 7 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2407.16364.json · badge: /api/ran/2407.16364.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
bytedance/textharmony canonical (classifier label)
classifier basis: census
7 ran · 7 no recorded run
bytedance/TextHarmony canonical (classifier label)
classifier basis: classifier_2025
4 ran · 0 no recorded run
FunctionStatusWhere it lives
load_jsonl Ran
ran; our contract draft was wrong, not the code
bytedance/TextHarmony/evaluate.py
code served (permissive licence) · get_code("94e70fb96cf2444b")
How it ran

Ran in Syntology's jail on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. The comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-05T01:03:07Z). 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 sample data
temp_dir = tempfile.mkdtemp()
json_file = os.path.join(temp_dir, "test.jsonl")

# Write sample JSONL data
with open(json_file, 'w') as f:
    f.write(json.dumps({"id": 1, "question": "What is 2+2?"}) + "\n")
    f.write(json.dumps({"id": 2, "question": "What is the capital of France?"}) + "\n")
    f.write(json.dumps({"id": 3, "question": "What is machine learning?"}) + "\n")

ARGS = {
    "json_file": json_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
box_iou Ran
ran, honoured the contract we drafted
bytedance/textharmony/TextHarmony/utils/grounding_score.py
code served (permissive licence) · get_code("ce749f837424dd8c")
How it ran

Ran 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 tuple, ndim 3, 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
from torchvision.ops.boxes import box_area

torch.manual_seed(0)

# Create two sets of bounding boxes in format [x1, y1, x2, y2]
# boxes1: 2 boxes
# boxes2: 3 boxes
boxes1 = torch.tensor([
    [0.0, 0.0, 2.0, 2.0],
    [1.0, 1.0, 3.0, 3.0]
], dtype=torch.float32)

boxes2 = torch.tensor([
    [0.0, 0.0, 1.0, 1.0],
    [1.5, 1.5, 2.5, 2.5],
    [2.0, 2.0, 4.0, 4.0]
], dtype=torch.float32)

ARGS = {
    "boxes1": boxes1,
    "boxes2": boxes2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 3, dtype family float — a tuple 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
colorEncode Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
bytedance/textharmony/TextHarmony/custom_datasets/ade20k_preparation.py
code served (permissive licence) · get_code("f3030aefe59749fb")
How it ran

Ran 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 ndarray, ndim 3, dtype family int, shape (3, 4, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 numpy as np

# Create a small labelmap - 2D array with integer labels
labelmap = np.array([
    [0, 1, 2, 0],
    [1, 2, 1, 2],
    [0, 1, 1, 0]
], dtype=np.int32)

# Create a colors list - need at least 2 colors since max label in labelmap is 2
# Each color is an RGB tuple
colors = [
    (255, 0, 0),      # color for label 1 (red)
    (0, 255, 0),      # color for label 2 (green)
]

# Set mode to RGB
mode = 'RGB'

ARGS = {
    'labelmap': labelmap,
    'colors': colors,
    'mode': mode
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family int, shape (3, 4, 3) — shape (3, 4, 3) as a later run recorded it
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
extract_answer Ran
ran; our contract draft was wrong, not the code
bytedance/textharmony/TextHarmony/utils/vqa_score.py
code served (permissive licence) · get_code("c1b06375bdb265f4")
How it ran

Ran 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 = {
    "response": "The answer is a cat."
}
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
grounding_eval Ran
ran; our contract draft was wrong, not the code
bytedance/textharmony/TextHarmony/utils/grounding_score.py
code served (permissive licence) · get_code("218b45d457ba5f5b")
How it ran

Ran 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 json
import tempfile
import os

torch.manual_seed(0)

# Create a temporary JSON file with test results
test_results = [
    {
        "gt_box": [100.0, 150.0, 300.0, 400.0],
        "pred_box": "(100,150)(300,400)",
        "height": 600,
        "width": 800
    },
    {
        "gt_box": [200.0, 250.0, 500.0, 550.0],
        "pred_box": "(200,250)(500,550)",
        "height": 600,
        "width": 800
    }
]

# Write to a temporary file
temp_file = tempfile.NamedTemporaryFile(mode='w', suffix='.json', delete=False)
json.dump(test_results, temp_file)
temp_file.close()

ARGS = {
    "results_file": temp_file.name
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchvision — 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
load_annt_data Ran
ran; our contract draft was wrong, not the code
bytedance/TextHarmony/inference.py
code served (permissive licence) · get_code("6ae320f7c8e2bf52")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) 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
import numpy as np
from PIL import Image
import tempfile
import json
import os

torch.manual_seed(0)

# Create a minimal transform that works with PIL images
class MinimalTransform:
    def __call__(self, img):
        # Convert PIL image to tensor (3, 224, 224)
        arr = np.array(img)
        return torch.from_numpy(arr).permute(2, 0, 1).float()

# Create a minimal tokenizer
class MinimalTokenizer:
    def __init__(self):
        self.padding_side = 'right'
    
    def __call__(self, text, max_length=2048, truncation=True, padding='do_not_pad', return_tensors='np', return_attention_mask=True):
        # Simple tokenization: split by spaces and convert to token ids
        tokens = text.split()[:max_length]
        token_ids = np.array([hash(t) % 1000 for t in tokens], dtype=np.int64)
        
        # Pad or truncate to max_length
        if len(token_ids) < max_length:
            token_ids = np.pad(token_ids, (0, max_length - len(token_ids)), mode='constant', constant_values=0)
        else:
            token_ids = token_ids[:max_length]
        
        attention_mask = np.ones_like(token_ids)
        attention_mask[token_ids == 0] = 0
        
        return {
            'input_ids': token_ids[np.newaxis, :],
            'attention_mask': attention_mask[np.newaxis, :]
        }

# Create temporary image files
temp_dir = tempfile.mkdtemp()
img1_path = os.path.join(temp_dir, 'img1.png')
img2_path = os.path.join(temp_dir, 'img2.png')

# Create small dummy images
img1 = Image.new('RGB', (32, 32), color='red')
img2 = Image.new('RGB', (32, 32), color='blue')
img1.save(img1_path)
img2.save(img2_path)

# Create annotation data
annt_data = [
    {
        'sentences': ['What is in the image?', 'Describe it.'],
        'sentence_ixs': [0, 1],
        'images': [img1_path, img2_path],
        'image_first': [True, False],
        'generate_mode': 'answer_question'
    }
]

# Create temporary annotation file
annt_path = os.path.join(temp_dir, 'annotations.json')
with open(annt_path, 'w') as f:
    json.dump(annt_data, f)

# Define ARGS
ARGS = {
    'transform': MinimalTransform(),
    'tokenizer': MinimalTokenizer(),
    'num_total_token': 2048,
    'truncation': True,
    'num_img_token': 64,
    'generation_kwargs': {'max_new_tokens': 100},
    'annt_path': annt_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
PIL, numpy, 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
model_gen Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
bytedance/TextHarmony/evaluate.py
code served (permissive licence) · get_code("e6cb89e8ea67aeef")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
import numpy as np
from PIL import Image
import io
from unittest.mock import Mock

torch.manual_seed(0)

# Create a minimal mock model
class MockModel(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = torch.nn.Linear(4, 4)
    
    def generate(self, mode, **kwargs):
        # Return mock output with text_ids
        return {'text_ids': torch.tensor([[1, 2, 3, 4]])}

# Create a minimal mock tokenizer
class MockTokenizer:
    def __init__(self):
        self.padding_side = 'right'
    
    def __call__(self, text, max_length=None, truncation=False, padding='do_not_pad', return_tensors=None, return_attention_mask=False):
        # Return mock tokenized output
        input_ids = np.array([[1, 2, 3, 4, 5]], dtype=np.int64)
        attention_mask = np.array([[1, 1, 1, 1, 1]], dtype=np.int64)
        result = {'input_ids': input_ids}
        if return_attention_mask:
            result['attention_mask'] = attention_mask
        return result
    
    def batch_decode(self, token_ids, skip_special_tokens=False):
        return ['The answer is: sample output']

# Create a minimal mock transform
class MockTransform:
    def __call__(self, image):
        # Return a small tensor (3, 4, 4) for RGB image
        return torch.randn(3, 4, 4)

# Create mock image files (in memory)
def create_mock_image():
    img = Image.new('RGB', (8, 8), color='red')
    return img

# Create temporary image paths by creating actual small images
import tempfile
import os

temp_dir = tempfile.mkdtemp()
image_paths = []
for i in range(2):
    img = Image.new('RGB', (8, 8), color=(i*50, i*50, i*50))
    img_path = os.path.join(temp_dir, f'test_image_{i}.png')
    img.save(img_path)
    image_paths.append(img_path)

# Build ARGS dictionary
ARGS = {
    'model': MockModel(),
    'image_paths': image_paths,
    'question': 'What is in the image?',
    'transform': MockTransform(),
    'tokenizer': MockTokenizer(),
    'num_total_token': 2048,
    'truncation': True,
    'num_img_token': 512,
    'generation_kwargs': None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
PIL, numpy, 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
parse_box Ran
ran, honoured the contract we drafted
bytedance/textharmony/TextHarmony/utils/grounding_score.py
code served (permissive licence) · get_code("13e859c753057e62")
How it ran

Ran 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 tuple, 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 re

def parse_box(box_str):
    PATTERN = re.compile('\\((.*?)\\)\\((.*?)\\)')
    predict_bbox = re.findall(PATTERN, box_str)
    try:
        if ',' not in predict_bbox[0][0] or ',' not in predict_bbox[0][1]:
            predict_bbox = (0.0, 0.0, 0.0, 0.0)
        else:
            x1, y1 = [float(tmp) for tmp in predict_bbox[0][0].split(',')]
            x2, y2 = [float(tmp) for tmp in predict_bbox[0][1].split(',')]
            predict_bbox = (x1, y1, x2, y2)
    except:
        predict_bbox = (0.0, 0.0, 0.0, 0.0)
    return predict_bbox

# Valid box string with coordinates
valid_box_str = "(1.5,2.3)(4.7,5.1)"

ARGS = {
    "box_str": valid_box_str
}
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 tuple, ndim 1, dtype family float — a tuple 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
tensor_to_pil Ran
ran; our contract draft was wrong, not the code
bytedance/textharmony/TextHarmony/utils/clip_sim_score.py
code served (permissive licence) · get_code("1af97eee0d5e9a78")
How it ran

Ran 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 4, dtype family int; 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
from PIL import Image

torch.manual_seed(0)

# Create a small batch of images as tensors
# Shape: (batch_size, channels, height, width)
# Values in range [0, 1] as expected by the function
batch_size = 2
channels = 3
height = 4
width = 5

images = torch.rand(batch_size, channels, height, width)

ARGS = {
    "images": images
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 4, dtype family int — 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
unique Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
bytedance/textharmony/TextHarmony/custom_datasets/ade20k_preparation.py
code served (permissive licence) · get_code("e813a6aeca895c35")
How it ran

Ran 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 ndarray, ndim 1, dtype family int, shape (4,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Create a simple test array with some repeated elements
test_array = np.array([3, 1, 2, 1, 3, 2, 4, 1])

ARGS = {
    "ar": test_array,
    "return_index": False,
    "return_inverse": False,
    "return_counts": False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family int, shape (4,) — shape (4,) as a later run recorded it
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
update_texts Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
bytedance/TextHarmony/inference.py
code served (permissive licence) · get_code("6aae1c40e557fe64")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple, 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
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal tokenizer stand-in
class MinimalTokenizer:
    def __call__(self, text, max_length=2048, truncation=False, padding=False, return_tensors=None, return_attention_mask=False):
        # Return a dict with input_ids tensor
        input_ids = torch.tensor([[1, 100, 101, 2]], dtype=torch.long)
        result = {'input_ids': input_ids}
        if return_attention_mask:
            result['attention_mask'] = torch.ones_like(input_ids)
        return result

# Create inputs dict with required structure
inputs = {
    'text_ids': torch.tensor([[1, 100, 101, 2]], dtype=torch.long),
    'attention_mask': torch.ones((1, 4), dtype=torch.long),
    'image_tensors': torch.randn(1, 3, 8, 8),
    'target_image_idxs': torch.tensor([0]),
    'num_image_per_seq': torch.tensor([1]),
    'meta': {
        'multiround_context': ['Hello world', 'How are you']
    }
}

# Create text_ids tensor (batch_size=1, seq_len=5)
text_ids = torch.tensor([[1, 100, 101, 102, 2]], dtype=torch.long)

# Create special_token_dict
special_token_dict = {
    'bos_token_id': 1,
    'eos_token_id': 2,
    'pad_token_id': 31999,
    'soi_token_id': 32000,
    'image_token_id': 32001
}

# Create pad_image_tensor
pad_image_tensor = torch.randn(1, 3, 8, 8)

# Create tokenizer
tokenizer = MinimalTokenizer()

ARGS = {
    'inputs': inputs,
    'text_ids': text_ids,
    'special_token_dict': special_token_dict,
    'num_img_token': 64,
    'pad_image_tensor': pad_image_tensor,
    'force_gen_image_next': False,
    'force_replace_gen_text': False,
    'tokenizer': tokenizer,
    'cur_iter': -1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple 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
calculate_activation_statistics Not yet run
unverified (harvested, no recorded run)
bytedance/textharmony/TextHarmony/utils/fid_score.py
code served (permissive licence) · get_code("58f3cb144de3c6f9")
How it ran

no invocation recorded.

calculate_clip_sim_i2i Not yet run
unverified (harvested, no recorded run)
bytedance/textharmony/TextHarmony/utils/clip_sim_score.py
code served (permissive licence) · get_code("a2cc9c29fefca146")
How it ran

no invocation recorded.

calculate_frechet_distance Not yet run
unverified (harvested, no recorded run)
bytedance/textharmony/TextHarmony/utils/fid_score.py
code served (permissive licence) · get_code("0def50a351111624")
How it ran

no invocation recorded. this sample carries JSON test cases instead of a setup block; get_reference_implementation serves them with the level they back.

clip_rerank_generated_images Not yet run
unverified (harvested, no recorded run)
bytedance/textharmony/TextHarmony/utils/clip_sim_score.py
code served (permissive licence) · get_code("b6d159b5ffc47aa4")
How it ran

no invocation recorded.

get_activations Not yet run
unverified (harvested, no recorded run)
bytedance/textharmony/TextHarmony/utils/fid_score.py
code served (permissive licence) · get_code("696501a9b5a48e4b")
How it ran

no invocation recorded.

vizwiz_vqa_eval Not yet run
unverified (harvested, no recorded run)
bytedance/textharmony/TextHarmony/utils/vqa_score.py
code served (permissive licence) · get_code("521448a8a9392444")
How it ran

no invocation recorded.

vqa_eval Not yet run
unverified (harvested, no recorded run)
bytedance/textharmony/TextHarmony/utils/vqa_score.py
code served (permissive licence) · get_code("a80245c5d6d89489")
How it ran

no invocation recorded.

Also present in other papers' code

Of 18 samples lifted from this paper's linked repositories, 18 carry a function identity and 0 do not. Of the 18 distinct functions with an identity, 13 are also present in other papers whose code we hold (13 with at least one paper dated earlier, 1 the same month, 3 later) and 5 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
calculate_frechet_distance 74 other papers
65 dated earlier, 2 the same month, 6 later, 1 same year, order not determinable
1610.09585 (2016-10)
Conditional Image Synthesis With Auxiliary Classifier GANs
1706.08500 (2017-06)
GANs Trained by a Two Time-Scale Update Rule Converge to a Local Nash Equilibrium
1807.11458 (2018-07)
To learn image super-resolution, use a GAN to learn how to do image degradation first
and 71 more not named here
box_iou 24 other papers
18 dated earlier, 5 later, 1 undated · 5 only as an assembly brick
2103.12115 (2021-03)
End-to-End Trainable Multi-Instance Pose Estimation with Transformers
2104.00969 (2021-04)
TubeR: Tubelet Transformer for Video Action Detection
2112.05375 (2021-12)
Rethinking the Two-Stage Framework for Grounded Situation Recognition
and 21 more not named here
unique 6 other papers
5 dated earlier, 1 later
1807.10221 (2018-07)
Unified Perceptual Parsing for Scene Understanding
1807.11590 (2018-07)
Acquisition of Localization Confidence for Accurate Object Detection
1904.04514 (2019-04)
High-Resolution Representations for Labeling Pixels and Regions
and 3 more not named here
calculate_activation_statistics 2 other papers
2 dated earlier
2306.04675 (2023-06)
Exposing flaws of generative model evaluation metrics and their unfair treatment of diffusion models
2405.15232 (2024-05)
DEEM: Diffusion Models Serve as the Eyes of Large Language Models for Image Perception
update_texts 2 other papers
2 dated earlier
2401.10208 (2024-01)
MM-Interleaved: Interleaved Image-Text Generative Modeling via Multi-modal Feature Synchronizer
2405.15232 (2024-05)
DEEM: Diffusion Models Serve as the Eyes of Large Language Models for Image Perception
calculate_clip_sim_i2i 1 other paper
1 dated earlier
2405.15232 (2024-05)
DEEM: Diffusion Models Serve as the Eyes of Large Language Models for Image Perception
clip_rerank_generated_images 1 other paper
1 dated earlier
2405.15232 (2024-05)
DEEM: Diffusion Models Serve as the Eyes of Large Language Models for Image Perception
extract_answer 1 other paper
1 dated earlier
2405.15232 (2024-05)
DEEM: Diffusion Models Serve as the Eyes of Large Language Models for Image Perception
get_activations 1 other paper
1 dated earlier
2405.15232 (2024-05)
DEEM: Diffusion Models Serve as the Eyes of Large Language Models for Image Perception
grounding_eval 1 other paper
1 dated earlier
2405.15232 (2024-05)
DEEM: Diffusion Models Serve as the Eyes of Large Language Models for Image Perception
parse_box 1 other paper
1 dated earlier
2405.15232 (2024-05)
DEEM: Diffusion Models Serve as the Eyes of Large Language Models for Image Perception
tensor_to_pil 1 other paper
1 dated earlier
2405.15232 (2024-05)
DEEM: Diffusion Models Serve as the Eyes of Large Language Models for Image Perception
vizwiz_vqa_eval 1 other paper
1 dated earlier
2405.15232 (2024-05)
DEEM: Diffusion Models Serve as the Eyes of Large Language Models for Image Perception

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

In this work, we present TextHarmony, a unified and versatile multimodal generative model proficient in comprehending and generating visual text. Simultaneously generating images and texts typically results in performance degradation due to the inherent inconsistency between vision and language modalities. To overcome this challenge, existing approaches resort to modality-specific data for supervised fine-tuning, necessitating distinct model instances. We propose Slide-LoRA, which dynamically aggregates modality-specific and modality-agnostic LoRA experts, partially decoupling the multimodal generation space. Slide-LoRA harmonizes the generation of vision and language within a singular model instance, thereby facilitating a more unified generative process. Additionally, we develop a high-quality image caption dataset, DetailedTextCaps-100K, synthesized with a sophisticated closed-source MLLM to enhance visual text generation capabilities further. Comprehensive experiments across various benchmarks demonstrate the effectiveness of the proposed approach. Empowered by Slide-LoRA, TextHarmony achieves comparable performance to modality-specific fine-tuning results with only a 2% increase in parameters and shows an average improvement of 2.5% in visual text comprehension tasks and 4.0% in visual text generation tasks. Our work delineates the viability of an integrated approach to multimodal generation within the visual text domain, setting a foundation for subsequent inquiries. Code is available at https://github.com/bytedance/TextHarmony.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2407.16364")
get_code_for_paper("2407.16364")
have("2407.16364")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2407.16364.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2407.16364.svg)](https://syntology.ai/paper/2407.16364)

Connect an agent — have() is free.