| BertForCL |
Ran ran on a synthesized input |
hkust-nlp/syncse/simcse/models.py code served (permissive licence) · get_code("c15599049fd15b4a") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned SequenceClassifierOutput. 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 transformers import BertConfig
from types import SimpleNamespace
# Create a minimal BERT config
config = BertConfig(
vocab_size=100,
hidden_size=16,
num_hidden_layers=2,
num_attention_heads=2,
intermediate_size=32,
max_position_embeddings=128,
hidden_dropout_prob=0.1,
attention_probs_dropout_prob=0.1,
)
# Create model_args namespace
model_args = SimpleNamespace(
pooler_type='cls',
temp=0.05,
hard_negative_weight=0,
do_mlm=False,
mlm_weight=0.1,
)
# Create a minimal BertModel
from transformers import BertModel
bert_model = BertModel(config)
# Since the class definition is incomplete, we'll construct the components that are used
# Based on the cl_forward function, we need: encoder, pooler, mlp, pooler_type, model_args, config
class BertForCL(nn.Module):
def __init__(self, config, model_args, encoder):
super().__init__()
self.config = config
self.model_args = model_args
self.encoder = encoder
self.pooler_type = model_args.pooler_type
self.pooler = Pooler(model_args.pooler_type)
if model_args.pooler_type == 'cls':
self.mlp = MLPLayer(config)
self.sim = Similarity(temp=model_args.temp)
def forward(self, input_ids=None, attention_mask=None, token_type_ids=None,
position_ids=None, head_mask=None, inputs_embeds=None, labels=None,
output_attentions=None, output_hidden_states=None, return_dict=None,
mlm_input_ids=None, mlm_labels=None):
return cl_forward(
self, self.encoder, input_ids=input_ids, attention_mask=attention_mask,
token_type_ids=token_type_ids, position_ids=position_ids, head_mask=head_mask,
inputs_embeds=inputs_embeds, labels=labels, output_attentions=output_attentions,
output_hidden_states=output_hidden_states, return_dict=return_dict,
mlm_input_ids=mlm_input_ids, mlm_labels=mlm_labels
)
INIT_ARGS = {
'config': config,
'model_args': model_args,
'encoder': bert_model,
}
# Create input tensors
# input_ids shape: (batch_size, num_sent, seq_length)
batch_size = 2
num_sent = 2
seq_length = 12
input_ids = torch.randint(0, 100, (batch_size, num_sent, seq_length))
attention_mask = torch.ones(batch_size, num_sent, seq_length)
token_type_ids = torch.zeros(batch_size, num_sent, seq_length, dtype=torch.long)
ARGS = {
'input_ids': input_ids,
'attention_mask': attention_mask,
'token_type_ids': token_type_ids,
'position_ids': None,
'head_mask': None,
'inputs_embeds': None,
'labels': None,
'output_attentions': None,
'output_hidden_states': None,
'return_dict': True,
'mlm_input_ids': None,
'mlm_labels': None,
}
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type SequenceClassifierOutput — a SequenceClassifierOutput output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SequenceClassifierOutput 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| ContrastivTensionModel |
Ran ran on a synthesized input · constructed an object; no result was computed |
FreddeFrallan/Contrastive-Tension/ContrastiveTension/ContrastiveTensionModel.py code served (permissive licence) · get_code("00b78ef545fe4550") 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 an instance of its own class, ContrastivTensionModel: the run constructed the object and did not call it, so no result was computed. 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 tensorflow as tf
import numpy as np
# Create a minimal mock model that satisfies the interface used in the code
class MockTransformerModel(tf.keras.Model):
def __init__(self, embedding_dim=4):
super().__init__()
self.embedding_dim = embedding_dim
self.dense = tf.keras.layers.Dense(embedding_dim)
def call(self, inputs, training=False):
input_ids = inputs['input_ids']
# Return tuple: (embeddings, other_output)
# embeddings shape: (batch_size, sequence_length, embedding_dim)
batch_size = tf.shape(input_ids)[0]
seq_length = tf.shape(input_ids)[1]
embeddings = self.dense(tf.cast(input_ids, tf.float32))
return (embeddings, None)
# Create model instances
model1 = MockTransformerModel(embedding_dim=4)
model2 = MockTransformerModel(embedding_dim=4)
# Create tiny tensors for testing
batch_size = 2
seq_length = 3
# Input data: (input_ids, attention_mask) pairs
inds1 = tf.constant([[1, 2, 3], [4, 5, 6]], dtype=tf.int32)
att1 = tf.constant([[1, 1, 1], [1, 1, 0]], dtype=tf.int32)
inds2 = tf.constant([[7, 8, 9], [10, 11, 12]], dtype=tf.int32)
att2 = tf.constant([[1, 1, 1], [1, 0, 0]], dtype=tf.int32)
# Labels for binary classification
labels = tf.constant([[1.0], [0.0]], dtype=tf.float32)
# Prepare x and y for fit method
x = (inds1, att1, inds2, att2)
y = labels
ARGS = {
'model1': model1,
'model2': model2,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, tensorflow, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ContrastivTensionModel — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ContrastivTensionModel 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
|
| DropoutLayer |
Ran ran on a synthesized input · constructed an object; no result was computed |
nuochenpku/sscl/sscl/models.py code served (permissive licence) · get_code("cbdb205ae8fa5618") 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 an instance of its own class, DropoutLayer: the run constructed the object and did not call it, so no result was computed. 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
torch.manual_seed(0)
# Create a minimal config class that has the attributes the DropoutLayer expects
class MinimalConfig:
def __init__(self):
pass
# Create the config instance
config = MinimalConfig()
# Create sample features tensor (batch_size=2, feature_dim=4)
features = torch.randn(2, 4)
# Define ARGS mapping all parameters to values
ARGS = {
"config": config
}
- 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 DropoutLayer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a DropoutLayer 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
|
| MLPLayer |
Ran ran on a synthesized input |
puerrrr/focal-infonce/focalNCE/models.py code served (permissive licence) · get_code("9ac67fa1b927fc99") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, 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
class Config:
def __init__(self, hidden_size):
self.hidden_size = hidden_size
INIT_ARGS = {
"config": Config(hidden_size=4)
}
ARGS = {
"features": torch.randn(2, 4)
}
if __name__ == "__main__":
model = nn.Module()
model.__class__ = type('MLPLayer', (nn.Module,), {
'__init__': lambda self, config: (
super(type(self), self).__init__(),
setattr(self, 'key_layer', nn.Linear(config.hidden_size, config.hidden_size)),
setattr(self, 'activation', nn.Tanh())
),
'forward': lambda self, features, **kwargs: self.activation(self.key_layer(features))
})
mlp = type('MLPLayer', (nn.Module,), {
'__init__': lambda self, config: (
super(type(self), self).__init__(),
setattr(self, 'key_layer', nn.Linear(config.hidden_size, config.hidden_size)),
setattr(self, 'activation', nn.Tanh())
),
'forward': lambda self, features, **kwargs: self.activation(self.key_layer(features))
})(INIT_ARGS["config"])
output = mlp(ARGS["features"])
print(output.shape)
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 2, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
- 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| Pooler |
Ran ran on a synthesized input · constructed an object; no result was computed |
nuochenpku/sscl/sscl/models.py code served (permissive licence) · get_code("084cdb52bc764df4") 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 an instance of its own class, Pooler: the run constructed the object and did not call it, so no result was computed. 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
torch.manual_seed(0)
# Mock outputs object that mimics HuggingFace transformer model outputs
class MockOutputs:
def __init__(self, batch_size=2, seq_len=5, hidden_dim=4, num_layers=3):
self.last_hidden_state = torch.randn(batch_size, seq_len, hidden_dim)
self.pooler_output = torch.randn(batch_size, hidden_dim)
# hidden_states is a tuple of tensors, one per layer (including embedding layer)
self.hidden_states = tuple(torch.randn(batch_size, seq_len, hidden_dim) for _ in range(num_layers))
# Create test inputs
batch_size = 2
seq_len = 5
# Attention mask: shape (batch_size, seq_len)
attention_mask = torch.ones(batch_size, seq_len)
attention_mask[0, 4] = 0 # Mask last token in first sequence
attention_mask[1, 3:] = 0 # Mask last two tokens in second sequence
# Mock outputs
outputs = MockOutputs(batch_size=batch_size, seq_len=seq_len, hidden_dim=4, num_layers=3)
# Define ARGS for Pooler
ARGS = {
'pooler_type': 'avg'
}
- 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 Pooler — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Pooler 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
|
| PositionalEncoding |
Ran ran on a synthesized input · constructed an object; no result was computed |
fangrouli/Document-embedding-generation-models/Transformer.py pointer only (licence: NONE) · get_code("df850ec18857365a") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, fangrouli/Document-embedding-generation-models 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. |
| PrefixEncoder |
Ran ran on a synthesized input · constructed an object; no result was computed |
yjiangcm/dcpcse/promcse/models.py pointer only (licence: NONE) · get_code("9472f0fd91c6ce99") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, yjiangcm/dcpcse 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. |
| ProjectionMLP |
Ran ran on a synthesized input · constructed an object; no result was computed |
nuochenpku/sscl/sscl/models.py code served (permissive licence) · get_code("872b7f900bfbde62") 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 an instance of its own class, ProjectionMLP: the run constructed the object and did not call it, so no result was computed. 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
torch.manual_seed(0)
class Config:
def __init__(self, hidden_size):
self.hidden_size = hidden_size
config = Config(hidden_size=4)
ARGS = {
"config": config
}
- 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 ProjectionMLP — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ProjectionMLP 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
|
| SiameseBERT |
Ran ran on a synthesized input · constructed an object; no result was computed |
rafaljanwojcik/SentenceBERT_vs_SiameseLSTM/modules/models.py pointer only (licence: NONE) · get_code("858aaa4a9df561a0") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, rafaljanwojcik/SentenceBERT_vs_SiameseLSTM 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. |
| Similarity |
Ran ran on a synthesized input · constructed an object; no result was computed |
puerrrr/focal-infonce/focalNCE/models.py code served (permissive licence) · get_code("302aa6c6e2e758b8") 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 an instance of its own class, Similarity: the run constructed the object and did not call it, so no result was computed. 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
torch.manual_seed(0)
# The Similarity class expects:
# 1. temp: a temperature parameter (float or similar)
# 2. forward() takes x and y which are passed to nn.CosineSimilarity(dim=-1)
# CosineSimilarity expects two tensors of the same shape
# Create small tensors for x and y
# CosineSimilarity with dim=-1 computes similarity along the last dimension
# So we need matching shapes: (batch, features)
x = torch.randn(2, 4) # batch=2, features=4
y = torch.randn(2, 4) # batch=2, features=4
# Temperature parameter (typically a small positive float)
temp = 0.07
ARGS = {
"temp": temp,
}
- 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 Similarity — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Similarity 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
|
| TransformerModel |
Ran ran on a synthesized input · constructed an object; no result was computed |
fangrouli/Document-embedding-generation-models/Transformer.py pointer only (licence: NONE) · get_code("265a0746f1edf50c") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, fangrouli/Document-embedding-generation-models 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. |
| azhang_MLP |
Ran ran on a synthesized input |
jcyk/mse-amr/simcse/models.py code served (permissive licence) · get_code("fcf235d048bd02d9") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float, shape (2, 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 torch
import torch.nn as nn
class azhang_MLP(nn.Module):
"""weak"""
def __init__(self, in_dim, out_dim, hidden_size):
super().__init__()
self.net = nn.Sequential(nn.Linear(in_dim, hidden_size), nn.ReLU(), nn.Linear(hidden_size, hidden_size), nn.ReLU(), nn.Linear(hidden_size, out_dim))
def forward(self, x):
return self.net(x)
INIT_ARGS = {
'in_dim': 4,
'out_dim': 3,
'hidden_size': 8,
}
ARGS = {
'x': torch.randn(2, 4),
}
model = azhang_MLP(**INIT_ARGS)
output = model(**ARGS)
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 2, dtype family float, shape (2, 3) — shape (2, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| build_intra_topic_pairs |
Ran ran on a synthesized input |
gmcgoldr/theissues/src/theissues/clustering.py code served (permissive licence) · get_code("4f1eabf533121ffa") 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 ndarray, ndim 3, dtype family float, shape (6, 2, 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)
rng = np.random.default_rng(0)
# Create small embeddings array
# Shape: (num_sequences, num_dims) = (8, 4)
num_sequences = 8
num_dims = 4
embeddings = np.random.randn(num_sequences, num_dims).astype(np.float32)
# Create groups - each group contains indices of sequences in the same group
# We'll create 3 groups with different sizes
groups = [
[0, 1, 2], # Group 0: 3 sequences
[3, 4, 5], # Group 1: 3 sequences
[6, 7], # Group 2: 2 sequences
]
# Number of pairs to draw from each group
num_pairs = 2
ARGS = {
"groups": groups,
"embeddings": embeddings,
"num_pairs": num_pairs,
"rng": rng,
}
- 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 float, shape (6, 2, 4) — shape (6, 2, 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
|
| build_sequence_gather_indices |
Ran ran on a synthesized input |
gmcgoldr/theissues/src/theissues/training.py code served (permissive licence) · get_code("8369d387619c884e") 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 Tensor, ndim 2, dtype family int, shape (3, 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 torch
torch.manual_seed(0)
# Construct arguments for build_sequence_gather_indices
num_tokens = 5
splits = torch.LongTensor([0, 2, 1])
seq_len = 3
ARGS = {
"num_tokens": num_tokens,
"splits": splits,
"seq_len": seq_len,
}
- 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 Tensor, ndim 2, dtype family int, shape (3, 3) — shape (3, 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
|
| build_sequence_mask_after |
Ran ran on a synthesized input |
gmcgoldr/theissues/src/theissues/training.py code served (permissive licence) · get_code("9f093abe8a8633f3") 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 Tensor, ndim 2, dtype family int, shape (5, 2) 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 torch
import numpy as np
torch.manual_seed(0)
# Create a small sequence tensor with shape (seq_len, num_seqs)
# seq_len=5, num_seqs=2
sequences = torch.LongTensor([
[1, 2],
[3, 4],
[0, 5], # end_value appears in first sequence at index 2
[6, 0], # end_value appears in second sequence at index 3
[7, 8]
])
end_value = 0
ARGS = {
"sequences": sequences,
"end_value": end_value
}
- 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 Tensor, ndim 2, dtype family int, shape (5, 2) — shape (5, 2) 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
|
| build_sequences_splits |
Ran ran on a synthesized input |
gmcgoldr/theissues/src/theissues/training.py code served (permissive licence) · get_code("31bba20e3bd8bab6") 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 Tensor, ndim 1, dtype family int, shape (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 torch
torch.manual_seed(0)
# Create a simple sequences tensor with some tokens
# Shape: (batch_size,) = (10,) containing token IDs
sequences = torch.LongTensor([1, 2, 3, 5, 2, 5, 1, 2, 5, 3])
# Define a split token ID that appears in the sequences
split_token_id = 5
ARGS = {
"sequences": sequences,
"split_token_id": split_token_id,
}
- 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 Tensor, ndim 1, dtype family int, shape (3,) — shape (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
|
| build_topic_groups |
Ran ran on a synthesized input |
gmcgoldr/theissues/src/theissues/clustering.py code served (permissive licence) · get_code("5939fd392b84fb91") 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 re
from typing import List, Mapping
# Construct test texts that will trigger various cluster keywords
texts = [
"The CERB program helped many Canadians during the pandemic.",
"The Canadian Emergency Response Benefit was crucial for families.",
"Residential schools caused tremendous harm to Indigenous peoples.",
"The Truth and Reconciliation Commission documented abuses.",
"We need to implement a carbon tax to fight climate change.",
"A price on carbon is essential for environmental policy.",
"Vaccines have saved millions of lives worldwide.",
"Pfizer and Moderna developed effective vaccines.",
"AstraZeneca also contributed to vaccine development.",
"The government should reopen the economy safely.",
"Reopening businesses must be done carefully.",
]
ARGS = {
"texts": texts
}
- 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
|
| bzhang_MLP |
Ran ran on a synthesized input |
jcyk/mse-amr/simcse/models.py code served (permissive licence) · get_code("4e4cd886852d45da") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, 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
# INIT_ARGS for bzhang_MLP.__init__(in_dim, out_dim, hidden_size)
INIT_ARGS = {
'in_dim': 4,
'out_dim': 3,
'hidden_size': 6
}
# ARGS for forward(x)
ARGS = {
'x': torch.randn(2, 4) # batch_size=2, in_dim=4
}
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 2, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
- 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| calculate_pca |
Ran ran on a synthesized input |
gmcgoldr/theissues/src/theissues/clustering.py code served (permissive licence) · get_code("89511893f786e611") 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. 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 numpy as np
np.random.seed(0)
# Create a small data matrix with shape (n_points, n_dimensions)
# Using distinct sizes: 5 data points, 4 dimensions
x = np.random.randn(5, 4).astype(np.float32)
# q must be <= the number of dimensions
q = 2
ARGS = {
'x': x,
'q': q,
}
- 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 tuple — a tuple output has no array shape of its own; none is 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
|
| cl_forward |
Ran ran; our contract draft was wrong, not the code |
puerrrr/focal-infonce/focalNCE/models.py code served (permissive licence) · get_code("7129023fed66db75") 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 SequenceClassifierOutput. 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
torch.manual_seed(0)
# Stand-in config class
class Config:
def __init__(self):
self.use_return_dict = True
self.vocab_size = 100
self.hidden_size = 4
# Stand-in model_args class
class ModelArgs:
def __init__(self):
self.pooler_type = 'cls'
self.temp = 0.05
self.m = 0.01
self.mlm_weight = 0.1
# Minimal encoder (returns BaseModelOutputWithPoolingAndCrossAttentions-like object)
class MinimalEncoder(nn.Module):
def __init__(self, hidden_size=4):
super().__init__()
self.hidden_size = hidden_size
self.dense = nn.Linear(hidden_size, hidden_size)
def forward(self, input_ids, attention_mask=None, token_type_ids=None,
position_ids=None, head_mask=None, inputs_embeds=None,
output_attentions=None, output_hidden_states=None, return_dict=None):
batch_size = input_ids.size(0)
seq_len = input_ids.size(1)
# Create dummy hidden states
last_hidden_state = torch.randn(batch_size, seq_len, self.hidden_size)
hidden_states = (torch.randn(batch_size, seq_len, self.hidden_size),) if output_hidden_states else None
class EncoderOutput:
def __init__(self, last_hidden_state, hidden_states=None):
self.last_hidden_state = last_hidden_state
self.hidden_states = hidden_states
self.attentions = None
return EncoderOutput(last_hidden_state, hidden_states)
# Minimal pooler
class MinimalPooler(nn.Module):
def __init__(self, hidden_size=4):
super().__init__()
self.dense = nn.Linear(hidden_size, hidden_size)
def forward(self, attention_mask, outputs):
last_hidden_state = outputs.last_hidden_state
# Use CLS token (first token)
pooled = last_hidden_state[:, 0, :]
return pooled
# Minimal MLP
class MinimalMLP(nn.Module):
def __init__(self, hidden_size=4):
super().__init__()
self.dense = nn.Linear(hidden_size, hidden_size)
def forward(self, x):
return self.dense(x)
# Minimal LM head
class MinimalLMHead(nn.Module):
def __init__(self, hidden_size=4, vocab_size=100):
super().__init__()
self.dense = nn.Linear(hidden_size, vocab_size)
def forward(self, x):
return self.dense(x)
# Minimal classifier class
class MinimalClassifier(nn.Module):
def __init__(self):
super().__init__()
self.config = Config()
self.model_args = ModelArgs()
self.device = torch.device('cpu')
self.pooler_type = 'cls'
self.training = True
self.encoder = MinimalEncoder(hidden_size=4)
self.pooler = MinimalPooler(hidden_size=4)
self.mlp = MinimalMLP(hidden_size=4)
self.lm_head = MinimalLMHead(hidden_size=4, vocab_size=100)
self.sim = nn.CosineSimilarity(dim=-1)
def forward(self, **kwargs):
pass
# Create instances
cls = MinimalClassifier()
encoder = cls.encoder
# Create input tensors
# batch_size=2, num_sent=2, seq_len=3
input_ids = torch.randint(0, 100, (2, 2, 3))
attention_mask = torch.ones(2, 2, 3)
token_type_ids = torch.zeros(2, 2, 3, dtype=torch.long)
position_ids = None
head_mask = None
inputs_embeds = None
labels = torch.tensor([0, 1])
output_attentions = False
output_hidden_states = False
return_dict = True
mlm_input_ids = torch.randint(0, 100, (2, 2, 3))
mlm_labels = torch.randint(0, 100, (2, 2, 3))
ARGS = {
'cls': cls,
'encoder': encoder,
'input_ids': input_ids,
'attention_mask': attention_mask,
'token_type_ids': token_type_ids,
'position_ids': position_ids,
'head_mask': head_mask,
'inputs_embeds': inputs_embeds,
'labels': labels,
'output_attentions': output_attentions,
'output_hidden_states': output_hidden_states,
'return_dict': return_dict,
'mlm_input_ids': mlm_input_ids,
'mlm_labels': mlm_labels,
}
- 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 SequenceClassifierOutput — a SequenceClassifierOutput output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SequenceClassifierOutput 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
|
| cl_forward |
Ran ran; our contract draft was wrong, not the code |
jcyk/mse-amr/simcse/models.py code served (permissive licence) · get_code("07787be6ded0e351") 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 SequenceClassifierOutput. 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 transformers.modeling_outputs import SequenceClassifierOutput, BaseModelOutputWithPoolingAndCrossAttentions
torch.manual_seed(0)
# Create minimal stand-in classes and modules
class MinimalConfig:
def __init__(self):
self.use_return_dict = True
self.hidden_size = 4
self.vocab_size = 100
self.num_attention_heads = 2
self.num_hidden_layers = 2
self.intermediate_size = 8
self.max_position_embeddings = 512
self.type_vocab_size = 2
class MinimalModelArgs:
def __init__(self):
self.pooler_type = 'cls'
self.temp = 0.05
self.training_method = 'simcse'
self.hard_negative_weight = 0.5
class MinimalPooler(nn.Module):
def __init__(self):
super().__init__()
def forward(self, attention_mask, outputs):
# Simple pooler that returns the [CLS] token representation
return outputs.last_hidden_state[:, 0, :]
class MinimalMLP(nn.Module):
def __init__(self, input_size=4, output_size=4):
super().__init__()
self.linear = nn.Linear(input_size, output_size)
def forward(self, x):
return self.linear(x)
class MinimalSim(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x, y):
# Cosine similarity: (batch1, 1, dim) x (1, batch2, dim) -> (batch1, batch2)
return F.cosine_similarity(x, y, dim=-1)
class MinimalEncoder(nn.Module):
def __init__(self, hidden_size=4):
super().__init__()
self.hidden_size = hidden_size
self.embedding = nn.Embedding(100, hidden_size)
self.transformer_layer = nn.TransformerEncoderLayer(
d_model=hidden_size,
nhead=2,
dim_feedforward=8,
batch_first=True
)
def forward(self, input_ids, attention_mask=None, token_type_ids=None,
position_ids=None, head_mask=None, inputs_embeds=None,
output_attentions=None, output_hidden_states=False, return_dict=True):
embeddings = self.embedding(input_ids)
# Create attention mask for transformer
if attention_mask is not None:
att_mask = (1.0 - attention_mask.float()) * -10000.0
else:
att_mask = None
hidden_states = self.transformer_layer(embeddings, src_key_padding_mask=None)
if return_dict:
return BaseModelOutputWithPoolingAndCrossAttentions(
last_hidden_state=hidden_states,
pooler_output=hidden_states[:, 0, :],
hidden_states=(hidden_states,) if output_hidden_states else None
)
return (hidden_states,)
class MinimalCLModel(nn.Module):
def __init__(self):
super().__init__()
self.config = MinimalConfig()
self.model_args = MinimalModelArgs()
self.device = 'cpu'
self.training = True
self.pooler = MinimalPooler()
self.mlp = MinimalMLP(input_size=4, output_size=4)
self.mlp_pred = MinimalMLP(input_size=4, output_size=4)
self.sim = MinimalSim()
# Create tensors
batch_size = 2
num_sent = 2
seq_len = 3
hidden_size = 4
input_ids = torch.randint(0, 100, (batch_size, num_sent, seq_len))
attention_mask = torch.ones((batch_size, num_sent, seq_len))
ARGS = {
'cls': MinimalCLModel(),
'encoder': MinimalEncoder(hidden_size=4),
'input_ids': input_ids,
'attention_mask': attention_mask,
'token_type_ids': None,
'position_ids': None,
'head_mask': None,
'inputs_embeds': None,
'labels': None,
'output_attentions': False,
'output_hidden_states': False,
'return_dict': True,
'mlm_input_ids': None,
'mlm_labels': None,
}
- 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 SequenceClassifierOutput — a SequenceClassifierOutput output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SequenceClassifierOutput 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
|
| compare_sent_transformer |
Ran ran, honoured the contract we drafted |
xiaoouwang/frenchnlp/frenchnlp/sentence.py pointer only (licence: NOASSERTION) · get_code("c571e67515e0ff95") How it ranThe body of this sample is withheld: GitHub could not classify the licence of this paper's repository, xiaoouwang/frenchnlp (NOASSERTION). 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. |
| czhang_MLP |
Ran ran on a synthesized input |
jcyk/mse-amr/simcse/models.py code served (permissive licence) · get_code("e1f8c403a1e96d8e") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float, shape (2, 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 torch
import torch.nn as nn
class czhang_MLP(nn.Module):
"""This one is strong"""
def __init__(self, in_dim, out_dim, hidden_size):
super().__init__()
self.net = nn.Sequential(nn.Linear(in_dim, hidden_size), nn.ReLU(), nn.Linear(hidden_size, hidden_size), nn.ReLU(), nn.Linear(hidden_size, out_dim), nn.LayerNorm(out_dim))
def forward(self, x):
return self.net(x)
INIT_ARGS = {
'in_dim': 4,
'out_dim': 3,
'hidden_size': 8,
}
ARGS = {
'x': torch.randn(2, 4),
}
model = czhang_MLP(**INIT_ARGS)
output = model(**ARGS)
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 2, dtype family float, shape (2, 3) — shape (2, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| dzhang_MLP |
Ran ran on a synthesized input |
jcyk/mse-amr/simcse/models.py code served (permissive licence) · get_code("932453f299fb7654") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float, shape (2, 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 torch
import torch.nn as nn
class dzhang_MLP(nn.Module):
"""not deep enough"""
def __init__(self, in_dim, out_dim, hidden_size):
super().__init__()
self.net = nn.Sequential(nn.Linear(in_dim, hidden_size), nn.ReLU(), nn.Linear(hidden_size, out_dim), nn.LayerNorm(out_dim))
def forward(self, x):
return self.net(x)
INIT_ARGS = {
'in_dim': 4,
'out_dim': 3,
'hidden_size': 8,
}
ARGS = {
'x': torch.randn(2, 4),
}
if __name__ == '__main__':
model = dzhang_MLP(**INIT_ARGS)
output = model(**ARGS)
print(f"Output shape: {output.shape}")
print(f"Output: {output}")
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 2, dtype family float, shape (2, 3) — shape (2, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| key_words_match_intention |
Ran ran on a synthesized input |
zhihaillm/wisdominterrogatory/app/langchain_demo/code/clc/matching.py code served (permissive licence) · get_code("c511c8001abbd371") 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 set. 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 os
import tempfile
# Create a temporary directory and file for the intention_reg.json
temp_dir = tempfile.mkdtemp()
app_dir = os.path.join(temp_dir, 'app', 'langchain_demo', 'data', 'cache')
os.makedirs(app_dir, exist_ok=True)
# Create the intention_reg.json file with sample data
intention_data = {
"greeting": ["hello", "hi", "hey"],
"farewell": ["bye", "goodbye", "see you"],
"help": ["assist", "support", "help me"]
}
json_path = os.path.join(app_dir, 'intention_reg.json')
with open(json_path, 'w') as f:
json.dump(intention_data, f)
# Change to temp directory so the relative path works
original_cwd = os.getcwd()
os.chdir(temp_dir)
# Create the function with the correct path
def key_words_match_intention(input):
kg_names = set()
with open('app/langchain_demo/data/cache/intention_reg.json', 'r') as f:
dic = json.load(f)
for key, val in dic.items():
for el in val:
if el in input:
kg_names.add(key)
return kg_names
# Define the input string that will be used to test the function
input_string = "hello there, can you assist me?"
ARGS = {
"input": input_string
}
- 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 set — a set output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a set 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
|
| kill_port |
Ran ran on a synthesized input |
hhzrd/BEFAQ/common/kill_program.py code served (permissive licence) · get_code("3e688147017e6353") 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 os
# The function kill_port takes a port number (integer) as its only parameter
# It attempts to kill a process running on that port using a system command
# We need to provide a valid port number
port_number = 8080
ARGS = {
'port': port_number
}
- 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
|
| manhattan |
Ran ran on a synthesized input |
Susheel-1999/Sentence_Similarity/sentence_similarity/similarity_functions.py code served (permissive licence) · get_code("51432767e48e693e") 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 float, ndim 0, dtype family float, shape () 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 torch
import numpy as np
torch.manual_seed(0)
# The manhattan function takes two iterables x and y
# It zips them together, computes absolute differences, sums them, and rounds to 3 decimals
# We need two sequences of numbers that can be zipped together
x = [1.0, 2.5, 3.7, 4.2]
y = [1.5, 2.0, 4.1, 3.9]
ARGS = {
"x": x,
"y": y
}
- 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 float, ndim 0, dtype family float, shape () — shape () 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
|
| minkowski |
Ran ran on a synthesized input |
Susheel-1999/Sentence_Similarity/sentence_similarity/similarity_functions.py code served (permissive licence) · get_code("b53bdc3c4189a65f") 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 float, ndim 0, dtype family float, shape () 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 torch
import numpy as np
torch.manual_seed(0)
# The minkowski function computes the Minkowski distance (L3 norm) between two sequences
# It expects x and y to be iterable sequences of numbers
# The function zips them together and computes the 3rd root of sum of absolute differences cubed
x = [1.0, 2.0, 3.0, 4.0]
y = [1.5, 2.5, 3.5, 4.5]
ARGS = {
"x": x,
"y": y
}
- 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 float, ndim 0, dtype family float, shape () — shape () 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
|
| name_spacy_to_sentencebert |
Ran ran on a synthesized input |
martinomensio/spacy-sentence-bert/spacy_sentence_bert/util.py code served (permissive licence) · get_code("c38df05247b84a49") 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.
# Setup code for name_spacy_to_sentencebert
def name_spacy_to_sentencebert(spacy_name):
result = spacy_name.replace('_', '-')
return result
# Construct arguments
ARGS = {
'spacy_name': 'en_core_web_sm'
}
- 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
|
| ozhang_MLP |
Ran ran on a synthesized input |
jcyk/mse-amr/simcse/models.py code served (permissive licence) · get_code("39b082869b286751") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float, shape (2, 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 torch
import torch.nn as nn
class ozhang_MLP(nn.Module):
def __init__(self, in_dim, out_dim, hidden_size):
super().__init__()
self.net = nn.Sequential(nn.Linear(in_dim, hidden_size), nn.BatchNorm1d(hidden_size), nn.ReLU(), nn.Linear(hidden_size, hidden_size), nn.ReLU(), nn.Linear(hidden_size, out_dim))
def forward(self, x):
return self.net(x)
INIT_ARGS = {
'in_dim': 4,
'out_dim': 3,
'hidden_size': 8,
}
ARGS = {
'x': torch.randn(2, 4),
}
model = ozhang_MLP(**INIT_ARGS)
output = model(**ARGS)
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 2, dtype family float, shape (2, 3) — shape (2, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| prepare_statement_encoding |
Ran ran on a synthesized input |
gmcgoldr/theissues/src/theissues/utils.py code served (permissive licence) · get_code("fcc6795327e2fa96") 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.
from typing import Dict, Iterable, NamedTuple, Tuple
import tokenizers as tk
class Statement(NamedTuple):
source: str
text: str
class SpecialTokens:
unk = '[UNK]'
sep = '[SEP]'
bos = '[BOS]'
eos = '[EOS]'
def __init__(self, tokenizer: tk.Tokenizer, validate: bool=False) -> None:
self.unk_id = tokenizer.token_to_id(self.unk)
self.bos_id = tokenizer.token_to_id(self.bos)
self.eos_id = tokenizer.token_to_id(self.eos)
self.sep_id = tokenizer.token_to_id(self.sep)
if validate:
if self.unk_id is None:
raise ValueError(f'tokenizer does not contain {self.unk}')
if self.bos_id is None:
raise ValueError(f'tokenizer does not contain {self.bos}')
if self.eos_id is None:
raise ValueError(f'tokenizer does not contain {self.eos}')
if self.sep_id is None:
raise ValueError(f'tokenizer does not contain {self.sep}')
@classmethod
def tokens(cls) -> Tuple[str]:
return (cls.unk, cls.sep, cls.bos, cls.eos)
def prepare_statement_encoding(statement: Statement) -> str:
"""
Preparing a statement for encoding. Returns a string of the form:
`[SEP] source [BOS] text ... [EOS]`
Args:
statement: the statement to encode
"""
return f'{SpecialTokens.sep} {statement.source} {SpecialTokens.bos} {statement.text} {SpecialTokens.eos}'
# Construct valid arguments
statement = Statement(
source="wikipedia",
text="The quick brown fox jumps over the lazy dog"
)
ARGS = {
"statement": statement
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- tokenizers — 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
|
| sentemb_forward |
Ran ran; our contract draft was wrong, not the code |
jcyk/mse-amr/simcse/models.py code served (permissive licence) · get_code("32d955e246903e89") 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 BaseModelOutputWithPoolingAndCrossAttentions. 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 transformers.modeling_outputs import BaseModelOutputWithPoolingAndCrossAttentions
torch.manual_seed(0)
# Stand-in config class
class Config:
def __init__(self):
self.use_return_dict = True
self.hidden_size = 4
self.vocab_size = 100
self.type_vocab_size = 2
self.max_position_embeddings = 512
self.num_hidden_layers = 2
self.num_attention_heads = 2
self.intermediate_size = 8
# Stand-in model_args class
class ModelArgs:
def __init__(self):
self.after_projector = True
# Simple pooler that accepts attention_mask and outputs
class SimplePooler(nn.Module):
def __init__(self, hidden_size):
super().__init__()
self.hidden_size = hidden_size
def forward(self, attention_mask, outputs):
# Simple mean pooling: return mean of last_hidden_state
last_hidden = outputs.last_hidden_state
return last_hidden.mean(dim=1)
# Simple MLP projector
class SimpleMLP(nn.Module):
def __init__(self, hidden_size):
super().__init__()
self.linear = nn.Linear(hidden_size, hidden_size)
def forward(self, x):
return self.linear(x)
# Mock encoder (simplified BERT-like encoder)
class MockEncoder(nn.Module):
def __init__(self, config):
super().__init__()
self.config = config
self.embeddings = nn.Embedding(config.vocab_size, config.hidden_size)
self.layers = nn.ModuleList([
nn.Linear(config.hidden_size, config.hidden_size)
for _ in range(config.num_hidden_layers)
])
def forward(self, input_ids, attention_mask=None, token_type_ids=None,
position_ids=None, head_mask=None, inputs_embeds=None,
output_attentions=None, output_hidden_states=None, return_dict=True):
if inputs_embeds is None:
hidden_states = self.embeddings(input_ids)
else:
hidden_states = inputs_embeds
all_hidden_states = [hidden_states] if output_hidden_states else None
for layer in self.layers:
hidden_states = layer(hidden_states)
if output_hidden_states:
all_hidden_states.append(hidden_states)
if return_dict:
return BaseModelOutputWithPoolingAndCrossAttentions(
last_hidden_state=hidden_states,
pooler_output=hidden_states.mean(dim=1),
hidden_states=all_hidden_states,
attentions=None
)
return (hidden_states,)
# Build the cls object
class SentembModel(nn.Module):
def __init__(self):
super().__init__()
self.config = Config()
self.model_args = ModelArgs()
self.pooler_type = 'avg_top2'
self.pooler = SimplePooler(self.config.hidden_size)
self.mlp = SimpleMLP(self.config.hidden_size)
# Create instances
config = Config()
cls = SentembModel()
encoder = MockEncoder(config)
# Create small batch tensors
batch_size = 2
seq_length = 3
input_ids = torch.randint(0, config.vocab_size, (batch_size, seq_length))
attention_mask = torch.ones((batch_size, seq_length), dtype=torch.long)
token_type_ids = torch.zeros((batch_size, seq_length), dtype=torch.long)
position_ids = torch.arange(seq_length, dtype=torch.long).unsqueeze(0).expand(batch_size, -1)
head_mask = None
inputs_embeds = None
labels = None
output_attentions = False
output_hidden_states = True
return_dict = True
ARGS = {
'cls': cls,
'encoder': encoder,
'input_ids': input_ids,
'attention_mask': attention_mask,
'token_type_ids': token_type_ids,
'position_ids': position_ids,
'head_mask': head_mask,
'inputs_embeds': inputs_embeds,
'labels': labels,
'output_attentions': output_attentions,
'output_hidden_states': output_hidden_states,
'return_dict': return_dict
}
- 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 BaseModelOutputWithPoolingAndCrossAttentions — a BaseModelOutputWithPoolingAndCrossAttentions output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a BaseModelOutputWithPoolingAndCrossAttentions 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
|
| set_hooks |
Ran ran on a synthesized input |
martinomensio/spacy-sentence-bert/spacy_sentence_bert/language.py code served (permissive licence) · get_code("4e8b30d8d981126f") 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 Mock. 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 spaCy Doc object with the required attributes
doc = Mock()
# Initialize user_hooks and user_span_hooks as dictionaries
doc.user_hooks = {}
doc.user_span_hooks = {}
doc.user_token_hooks = {}
# Create mock token/span objects with _.sentence_bert attribute
mock_token = Mock()
mock_token._ = Mock()
mock_token._.sentence_bert = torch.randn(4)
mock_span = Mock()
mock_span._ = Mock()
mock_span._.sentence_bert = torch.randn(4)
mock_doc = Mock()
mock_doc._ = Mock()
mock_doc._.sentence_bert = torch.randn(4)
ARGS = {
"doc": doc
}
- 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 Mock — a Mock output has no array shape of its own; none is 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
|
| BertForCL |
Not yet run unverified (harvested, no recorded run) |
yjiangcm/dcpcse/promcse/models.py pointer only (licence: NONE) · get_code("686396546abff873") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, yjiangcm/dcpcse 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. No invocation recorded. |
| BertForCL |
Not yet run unverified (harvested, no recorded run) |
nuochenpku/sscl/sscl/models.py code served (permissive licence) · get_code("67b848a28b094d8e") How it ran |
| BertForCL |
Not yet run unverified (harvested, no recorded run) |
puerrrr/focal-infonce/focalNCE/models.py code served (permissive licence) · get_code("b248e7b923a2c743") How it ran |
| BertForCL |
Not yet run unverified (harvested, no recorded run) |
jcyk/mse-amr/simcse/models.py code served (permissive licence) · get_code("cfcdc208c6f85bf3") How it ran |
| LongBertPredictor |
Not yet run unverified (harvested, no recorded run) |
OctopusMind/longBert/train/longbert_utils.py code served (permissive licence) · get_code("0cbdfd56794bd3b4") How it ran |
| Pooler |
Not yet run unverified (harvested, no recorded run) |
jcyk/mse-amr/simcse/models.py code served (permissive licence) · get_code("14d8220d0ad290ce") How it ran |
| RobertaForCL |
Not yet run unverified (harvested, no recorded run) |
yjiangcm/promcse/promcse/models.py pointer only (licence: NONE) · get_code("ee25e6e27384a5bb") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, yjiangcm/promcse 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. No invocation recorded. |
| SentBert |
Not yet run unverified (harvested, no recorded run) |
Danqi7/584-final/models.py pointer only (licence: NONE) · get_code("442b59853addd2de") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, Danqi7/584-final 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. No invocation recorded. |
| build_mlp |
Not yet run unverified (harvested, no recorded run) |
jcyk/mse-amr/simcse/models.py code served (permissive licence) · get_code("d7723134bf6e3bd2") How it ran |
| cl_forward |
Not yet run unverified (harvested, no recorded run) |
yjiangcm/dcpcse/promcse/models.py pointer only (licence: NONE) · get_code("11633811e04f78a3") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, yjiangcm/dcpcse 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. No invocation recorded. |
| cl_forward |
Not yet run unverified (harvested, no recorded run) |
nuochenpku/sscl/sscl/models.py code served (permissive licence) · get_code("6240552f92bf148f") How it ran |
| cl_init |
Not yet run unverified (harvested, no recorded run) |
yjiangcm/dcpcse/promcse/models.py pointer only (licence: NONE) · get_code("9b2126395aa31fff") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, yjiangcm/dcpcse 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. No invocation recorded. |
| cl_init |
Not yet run unverified (harvested, no recorded run) |
nuochenpku/sscl/sscl/models.py code served (permissive licence) · get_code("6309d0697eb157fc") How it ran |
| cl_init |
Not yet run unverified (harvested, no recorded run) |
puerrrr/focal-infonce/focalNCE/models.py code served (permissive licence) · get_code("86a386d0f82442dc") How it ran |
| cl_init |
Not yet run unverified (harvested, no recorded run) |
hkust-nlp/syncse/simcse/models.py code served (permissive licence) · get_code("ecf7ae695fd278cd") How it ran |
| cl_init |
Not yet run unverified (harvested, no recorded run) |
jcyk/mse-amr/simcse/models.py code served (permissive licence) · get_code("31852ff2075805f1") How it ran |
| construct_negtives |
Not yet run unverified (harvested, no recorded run) |
nuochenpku/sscl/sscl/models.py code served (permissive licence) · get_code("941deecc46bb006c") How it ran |
| create_lang |
Not yet run unverified (harvested, no recorded run) |
martinomensio/spacy-sentence-bert/spacy_sentence_bert/util.py code served (permissive licence) · get_code("df6ff0395b06ea36") How it ran |
| decode_token_ids |
Not yet run unverified (harvested, no recorded run) |
gmcgoldr/theissues/src/theissues/utils.py code served (permissive licence) · get_code("b6ee269d40006587") How it ran |
| euclidean |
Not yet run unverified (harvested, no recorded run) |
Susheel-1999/Sentence_Similarity/sentence_similarity/similarity_functions.py code served (permissive licence) · get_code("f066e3a9c1823a5d") How it ran |
| gather_embeddings |
Not yet run unverified (harvested, no recorded run) |
puerrrr/focal-infonce/focalNCE/models.py code served (permissive licence) · get_code("b834174c62e09dbd") How it ran |
| get_id_to_token |
Not yet run unverified (harvested, no recorded run) |
gmcgoldr/theissues/src/theissues/utils.py code served (permissive licence) · get_code("eb26fd491b20e527") How it ran |
| sentemb_forward |
Not yet run unverified (harvested, no recorded run) |
yjiangcm/dcpcse/promcse/models.py pointer only (licence: NONE) · get_code("20ddfaeb2cd9188c") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, yjiangcm/dcpcse 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. No invocation recorded. |
| sp_logits |
Not yet run unverified (harvested, no recorded run) |
puerrrr/focal-infonce/focalNCE/models.py code served (permissive licence) · get_code("0fe6a0e42f7b4354") How it ran |
| upload_image_to_imgur |
Not yet run unverified (harvested, no recorded run) |
zhihaillm/wisdominterrogatory/pics/upload_fig.py code served (permissive licence) · get_code("e49609a7ba74163b") How it ran |