| chat_template_preprocess |
Ran ran; our contract draft was wrong, not the code |
LAMDA-RL/Q-Adapter/utils/datasets.py code served (permissive licence) · get_code("087b6200b29a1f20") 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 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
from transformers import PreTrainedTokenizer
from unittest.mock import MagicMock
torch.manual_seed(0)
class StandInTokenizer:
def __init__(self):
self.chat_template = "[{% for message in messages %}{{ message['role'] }}: {{ message['content'] }}\n{% endfor %}]"
def apply_chat_template(self, messages, tokenize=False, add_generation_prompt=False):
result = ""
if isinstance(messages, list):
for msg in messages:
if isinstance(msg, dict):
result += f"{msg.get('role', 'user')}: {msg.get('content', '')}\n"
if add_generation_prompt:
result += "assistant: "
if tokenize:
return [1, 2, 3]
return result
data_sample = {
'chosen': [
{'role': 'user', 'content': 'Hello'},
{'role': 'assistant', 'content': 'Hi there!'}
],
'rejected': [
{'role': 'user', 'content': 'Hello'},
{'role': 'assistant', 'content': 'Goodbye.'}
]
}
tokenizer = StandInTokenizer()
ARGS = {
'data_sample': data_sample,
'tokenizer': tokenizer
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch, transformers — 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
|
| collator |
Ran ran; our contract draft was wrong, not the code |
LAMDA-RL/Q-Adapter/ppo_train.py code served (permissive licence) · get_code("fddcce152bc7d3bd") 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
torch.manual_seed(0)
# The collator function takes a list of dictionaries and reorganizes them
# by key, collecting all values for each key into separate lists.
# We need to construct a list of dictionaries where each dict has the same keys.
data = [
{
"input_ids": torch.tensor([1, 2, 3, 4]),
"attention_mask": torch.tensor([1, 1, 1, 0]),
"label": 0
},
{
"input_ids": torch.tensor([5, 6, 7, 8]),
"attention_mask": torch.tensor([1, 1, 1, 1]),
"label": 1
}
]
ARGS = {
"data": data
}
- 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
|
| get_transformers_model |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
LAMDA-RL/Q-Adapter/utils/models.py code served (permissive licence) · get_code("f7380188a0e8cdc9") 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 MinimalCausalLMModel. 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
from torch import nn
from unittest.mock import Mock, MagicMock, patch
import tempfile
import os
torch.manual_seed(0)
# Create a minimal tokenizer mock with required attributes
class MinimalTokenizer:
def __init__(self):
self.pad_token_id = 0
self.eos_token_id = 2
self.bos_token_id = 1
self.vocab_size = 100
# Create a minimal model mock that satisfies the function's usage
class MinimalCausalLMModel(nn.Module):
def __init__(self):
super().__init__()
self.config = Mock()
self.config.pad_token_id = None
self.linear = nn.Linear(4, 4)
def forward(self, input_ids, attention_mask=None):
return Mock(logits=self.linear(torch.randn(2, 4)))
@classmethod
def from_pretrained(cls, model_path, torch_dtype=None, device_map=None,
quantization_config=None, trust_remote_code=None):
model = cls()
model.config.pad_token_id = None
return model
# Create a minimal LoRA config mock
class MinimalLoRAConfig:
def __init__(self, r=8, lora_alpha=16, target_modules=None, lora_dropout=0.05, bias='none'):
self.r = r
self.lora_alpha = lora_alpha
self.target_modules = target_modules or ['q_proj', 'v_proj']
self.lora_dropout = lora_dropout
self.bias = bias
# Create a model with print_trainable_parameters method
class MinimalPEFTModel(nn.Module):
def __init__(self, base_model):
super().__init__()
self.base_model = base_model
self.config = base_model.config
def print_trainable_parameters(self):
pass
@classmethod
def from_pretrained(cls, model, lora_path):
return cls(model)
# Patch the actual imports
with patch('transformers.AutoModelForCausalLM', MinimalCausalLMModel):
with patch('peft.PeftModel.from_pretrained', return_value=MinimalPEFTModel(MinimalCausalLMModel())):
with patch('peft.prepare_model_for_kbit_training', side_effect=lambda x: x):
with patch('peft.LoraConfig', MinimalLoRAConfig):
with patch('peft.get_peft_model', side_effect=lambda model, config: MinimalPEFTModel(model)):
tokenizer = MinimalTokenizer()
base_model = "gpt2"
model_class = MinimalCausalLMModel
ARGS = {
'base_model': base_model,
'tokenizer': tokenizer,
'model_class': model_class,
'lora_path': '',
'lora_r': 0,
'lora_alpha': 16,
'lora_dropout': 0.05,
'lora_target_modules': ['q_proj', 'v_proj'],
'device_map': 'cpu',
'load_in_8bit': False,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- peft, torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type MinimalCausalLMModel — a MinimalCausalLMModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MinimalCausalLMModel 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_transformers_tokenizer |
Ran ran; our contract draft was wrong, not the code |
LAMDA-RL/Q-Adapter/utils/models.py code served (permissive licence) · get_code("aa635e3b36eacb87") 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 MockTokenizer. 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 unittest.mock import Mock, MagicMock
torch.manual_seed(0)
# Create a mock tokenizer that behaves like a HuggingFace tokenizer
class MockTokenizer:
def __init__(self):
self.eos_token_id = 2
self.pad_token_id = None
self.padding_side = 'left'
@classmethod
def from_pretrained(cls, tokenizer_path, trust_remote_code=True):
return cls()
# Patch AutoTokenizer to return our mock
import transformers
original_auto_tokenizer = transformers.AutoTokenizer
transformers.AutoTokenizer.from_pretrained = MockTokenizer.from_pretrained
ARGS = {
'tokenizer_path': 'gpt2',
'padding_side': 'right'
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type MockTokenizer — a MockTokenizer output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockTokenizer 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
|
| hash_args |
Ran ran; our contract draft was wrong, not the code |
mansicer/Q-Adapter/lm-evaluation-harness/lm_eval/api/model.py code served (permissive licence) · get_code("20a7cc804eb22661") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) 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 hashlib
import json
# Construct valid arguments for hash_args function
# The function takes attr (attribute name) and args (tuple/list of arguments)
# and creates a JSON string to hash
attr = "test_attribute"
args = ("value1", 42, [1, 2, 3], {"key": "value"})
ARGS = {
"attr": attr,
"args": args
}
- 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 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
|
| init_transformers_model |
Ran ran; our contract draft was wrong, not the code |
LAMDA-RL/Q-Adapter/utils/models.py code served (permissive licence) · get_code("c4491a6621f89556") 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 MockModel. 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
from transformers import AutoModelForCausalLM, AutoTokenizer
from unittest.mock import Mock, patch, MagicMock
torch.manual_seed(0)
# Create a minimal mock tokenizer with the required pad_token_id attribute
class MockTokenizer:
def __init__(self):
self.pad_token_id = 0
# Create a minimal mock model class that returns a model with config
class MockModel(torch.nn.Module):
def __init__(self):
super().__init__()
self.config = Mock()
self.config.pad_token_id = None
self.linear = torch.nn.Linear(4, 4)
@classmethod
def from_pretrained(cls, model_path, torch_dtype=None, device_map=None, quantization_config=None, trust_remote_code=None):
return cls()
# Prepare arguments
tokenizer = MockTokenizer()
model_class = MockModel
model_path = "meta-llama/Llama-2-7b"
device_map = "cpu"
load_in_8bit = False
dtype = torch.float16
ARGS = {
"model_class": model_class,
"model_path": model_path,
"tokenizer": tokenizer,
"device_map": device_map,
"load_in_8bit": load_in_8bit,
"dtype": dtype
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type MockModel — a MockModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockModel 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
|
| modify_forward |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
LAMDA-RL/Q-Adapter/utils/q_adapter.py code served (permissive licence) · get_code("11bfc577314806ff") 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 PeftModelForCausalLM. 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
import torch.nn.functional as F
from peft.peft_model import PeftModelForCausalLM
from transformers.modeling_outputs import CausalLMOutputWithPast
torch.manual_seed(0)
class MockPeftModel(nn.Module):
def __init__(self):
super().__init__()
self.linear = nn.Linear(4, 5)
def forward(self, input_ids=None, attention_mask=None, inputs_embeds=None,
labels=None, output_attentions=None, output_hidden_states=None,
return_dict=None, past_key_values=None, **kwargs):
if inputs_embeds is None:
inputs_embeds = self.linear(torch.randn(2, 3, 4))
batch_size = 2
seq_len = 3
vocab_size = 5
logits = torch.randn(batch_size, seq_len, vocab_size)
return CausalLMOutputWithPast(
loss=None,
logits=logits,
past_key_values=None,
hidden_states=None,
attentions=None
)
def disable_adapter(self):
class ContextManager:
def __enter__(self):
return self
def __exit__(self, exc_type, exc_val, exc_tb):
pass
return ContextManager()
peft_model = MockPeftModel()
peft_model.__class__ = type('PeftModelForCausalLM', (MockPeftModel,), {})
alpha_tilde = 0.1
alpha_0 = 0.5
gamma = 0.99
beta = 0.1
register_callback = False
ARGS = {
'peft_model': peft_model,
'alpha_tilde': alpha_tilde,
'alpha_0': alpha_0,
'gamma': gamma,
'beta': beta,
'register_callback': register_callback
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, peft, torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type PeftModelForCausalLM — a PeftModelForCausalLM output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PeftModelForCausalLM 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
|
| modify_prepare_inputs_for_generation |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
LAMDA-RL/Q-Adapter/utils/q_adapter.py code served (permissive licence) · get_code("4efbafd90b8d3d01") 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 MockPeftModelForCausalLM. 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
from peft.peft_model import PeftModelForCausalLM
from transformers import AutoConfig, AutoModelForCausalLM
torch.manual_seed(0)
# Create a minimal mock model that satisfies the PeftModelForCausalLM interface
class MockPeftModelForCausalLM(nn.Module):
def __init__(self):
super().__init__()
self.lm_head = nn.Linear(4, 100)
self.model = nn.Linear(4, 4)
def __original_prepare_inputs_for_generation(self, input_ids, past_key_values=None, attention_mask=None, inputs_embeds=None, **kwargs):
"""Mock original method that returns a dict with typical generation inputs"""
return_dict = {
'input_ids': input_ids,
'attention_mask': attention_mask,
}
if past_key_values is not None:
return_dict['past_key_values'] = past_key_values
if inputs_embeds is not None:
return_dict['inputs_embeds'] = inputs_embeds
return return_dict
def prepare_inputs_for_generation(self, input_ids, past_key_values=None, attention_mask=None, inputs_embeds=None, **kwargs):
"""Default prepare_inputs_for_generation to be replaced"""
return self.__original_prepare_inputs_for_generation(
input_ids,
past_key_values=past_key_values,
attention_mask=attention_mask,
inputs_embeds=inputs_embeds,
**kwargs
)
# Instantiate the mock model
peft_model = MockPeftModelForCausalLM()
# Ensure the model has the method we'll be wrapping
peft_model.prepare_inputs_for_generation = peft_model.prepare_inputs_for_generation.__get__(peft_model, type(peft_model))
ARGS = {
"peft_model": peft_model,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- peft, torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type MockPeftModelForCausalLM — a MockPeftModelForCausalLM output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockPeftModelForCausalLM 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
|
| parse_eval_args |
Ran ran; our contract draft was wrong, not the code |
LAMDA-RL/Q-Adapter/lm-evaluation-harness/lm_eval/__main__.py pointer only (licence: Apache-2.0); the stored copy get_code serves, from BatsResearch/crosslingual-test-time-scaling, is pointer only (licence: NONE) · get_code("400ea4f64ccce5ef") How it ranThe body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from BatsResearch/crosslingual-test-time-scaling, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded. |
| qadapter_loss |
Ran ran; our contract draft was wrong, not the code |
mansicer/Q-Adapter/utils/q_adapter.py code served (permissive licence) · get_code("ee04f1495c3243f8") How it ranRan 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.functional as F
torch.manual_seed(0)
# Analyze the function to understand what's needed:
# - q_values_ai: tensor, used in arithmetic and masking operations
# - values: tensor, used in arithmetic and masking operations
# - mask: tensor, used for masking (multiplication), .sum(), .expand_as()
# - gamma: scalar, used in arithmetic
# - beta: scalar, used in arithmetic (default 0.1)
#
# The function expects:
# - reward_sum.shape[0] to be even (divided by 2 for bs)
# - reward.shape[1] to exist (for normalization)
# - mask to be broadcastable with reward
# Create small tensors with distinct dimensions
batch_size = 4 # Will be divided by 2, so bs=2
seq_len = 3 # Sequence/time dimension
# q_values_ai: shape (batch_size, seq_len)
q_values_ai = torch.randn(batch_size, seq_len)
# values: shape (batch_size, seq_len)
values = torch.randn(batch_size, seq_len)
# mask: shape (batch_size, seq_len) - binary mask
mask = torch.ones(batch_size, seq_len)
# gamma: scalar hyperparameter
gamma = 0.99
# beta: scalar hyperparameter (has default, but we'll provide it)
beta = 0.1
ARGS = {
'q_values_ai': q_values_ai,
'values': values,
'mask': mask,
'gamma': gamma,
'beta': beta,
}
- 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
|
| remove_duplicate_questions |
Ran ran; our contract draft was wrong, not the code |
LAMDA-RL/Q-Adapter/make_replay_data.py code served (permissive licence) · get_code("74f7be6e12369b9a") 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
import numpy as np
# Construct valid arguments for remove_duplicate_questions
# The function expects a list of dicts where each dict has a 'chosen' key
# containing a list with at least one item that has a 'content' key
data = [
{
'chosen': [
{'content': 'What is machine learning?'},
{'content': 'Some response 1'}
]
},
{
'chosen': [
{'content': 'How does neural networks work?'},
{'content': 'Some response 2'}
]
},
{
'chosen': [
{'content': 'What is machine learning?'},
{'content': 'Some response 3'}
]
},
{
'chosen': [
{'content': 'What is deep learning?'},
{'content': 'Some response 4'}
]
},
]
ARGS = {
'data': data
}
- 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 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
|
| rm_preprocess |
Ran ran; our contract draft was wrong, not the code |
LAMDA-RL/Q-Adapter/utils/datasets.py code served (permissive licence) · get_code("0af64997b20207ec") 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 function. 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)
# Create a minimal tokenizer stand-in
class MinimalTokenizer:
def __init__(self):
self.eos_token_id = 2
def __call__(self, text, truncation=True, max_length=256, padding=False, return_tensors=None):
# Simple tokenization: split text and convert to token ids
tokens = text.split()
input_ids = [1] * min(len(tokens), max_length)
attention_mask = [1] * len(input_ids)
return {
'input_ids': input_ids,
'attention_mask': attention_mask
}
# Create a minimal preprocess function
def minimal_preprocess_fn(data_sample, tokenizer):
# Returns (chosen, rejected, instruction) tuple
chosen = "This is a chosen response"
rejected = "This is a rejected response"
instruction = "Instruction"
return chosen, rejected, instruction
# Create sample data
sample_data = {"text": "sample"}
# Build ARGS dictionary
ARGS = {
"preprocess_fn": minimal_preprocess_fn,
"tokenizer": MinimalTokenizer(),
"cutoff_len": 256,
"add_eos_token": False,
"train_on_inputs": False
}
- 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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
|
| tokenize |
Ran ran; our contract draft was wrong, not the code |
LAMDA-RL/Q-Adapter/utils/datasets.py code served (permissive licence) · get_code("6a216d37018e6479") 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 unittest.mock import Mock
torch.manual_seed(0)
class MockTokenizer:
def __init__(self):
self.eos_token_id = 2
def __call__(self, prompt, truncation=False, max_length=256, padding=False, return_tensors=None):
# Simulate tokenization of a prompt
input_ids = [101, 2054, 2003, 2009, 2] # Example token sequence
attention_mask = [1, 1, 1, 1, 1]
return {
'input_ids': input_ids,
'attention_mask': attention_mask
}
tokenizer = MockTokenizer()
prompt = "What is this?"
cutoff_len = 256
add_eos_token = True
ARGS = {
'tokenizer': tokenizer,
'prompt': prompt,
'cutoff_len': cutoff_len,
'add_eos_token': add_eos_token
}
- 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
|
| evaluate |
Not yet run unverified (harvested, no recorded run) |
LAMDA-RL/Q-Adapter/make_replay_data.py code served (permissive licence) · get_code("06ed656b6c40d9ac") How it ran |