| encode_example |
Ran ran; our contract draft was wrong, not the code |
isi-nlp/astrapop/src/ets/train_classifier.py code served (permissive licence) · get_code("07603ec33561b4eb") 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
torch.manual_seed(0)
# Stand-in tokenizer that mimics HuggingFace tokenizer behavior
class MockTokenizer:
def __call__(self, text, max_length=512, truncation=True):
# Return mock token IDs and attention mask
tokens = [101, 2054, 2003, 102] # Mock token sequence
return {
'input_ids': tokens[:max_length],
'attention_mask': [1] * len(tokens[:max_length])
}
# Create example dict with required fields
example = {
'txt': 'This is a sample text for language identification.',
'native_lang': 'ENG' # Will need to adjust since ENG is not in LANG2IDX
}
# Actually, let's use a valid language from LANG2IDX
example = {
'txt': 'This is a sample text for language identification.',
'native_lang': 'FRA'
}
tokenizer = MockTokenizer()
ARGS = {
'example': example,
'tokenizer': tokenizer
}
- 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 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
|
| encode_example_paraphrase |
Ran ran; our contract draft was wrong, not the code |
isi-nlp/astrapop/src/reddit/train_sft.py code served (permissive licence) · get_code("8176a95ae3a201b8") 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
class MockTokenizer:
def __init__(self):
self.bos_token = '[BOS]'
self.eos_token = '[EOS]'
self.vocab_size = 1000
def __call__(self, text, add_special_tokens=False, max_length=128, truncation=False):
# Simple mock: split text and create token ids
words = text.split()
token_ids = [hash(word) % self.vocab_size for word in words]
if len(token_ids) > max_length:
token_ids = token_ids[:max_length]
return {
'input_ids': token_ids,
'attention_mask': [1] * len(token_ids)
}
example = {
'src': 'The quick brown fox',
'tgt': 'A fast brown animal'
}
tokenizer = MockTokenizer()
ARGS = {
'example': example,
'tokenizer': tokenizer,
'max_len': 128
}
- 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
|
| encode_paraphrase_example |
Ran ran; our contract draft was wrong, not the code |
isi-nlp/astrapop/src/ets/train_sft.py code served (permissive licence) · get_code("8910f4e5b5d4bbee") 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
from transformers import AutoTokenizer
# Create a minimal tokenizer stand-in that has the required attributes and methods
class MinimalTokenizer:
def __init__(self):
self.bos_token = "[BOS]"
self.eos_token = "[EOS]"
self.vocab_size = 1000
def __call__(self, text, add_special_tokens=False, max_length=128, truncation=True):
# Simple mock tokenization: split by spaces and convert to token ids
tokens = text.split()
token_ids = [hash(token) % self.vocab_size for token in tokens]
# Apply truncation if needed
if truncation and len(token_ids) > max_length:
token_ids = token_ids[:max_length]
return {
'input_ids': token_ids,
'attention_mask': [1] * len(token_ids)
}
# Create example data
example = {
'src': 'The quick brown fox',
'tgt': 'A fast brown fox'
}
# Create tokenizer
tokenizer = MinimalTokenizer()
# Define all arguments
ARGS = {
'example': example,
'tokenizer': tokenizer,
'max_len': 128,
'direction': 'forward'
}
- 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 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
|
| encode_transfer_example |
Ran ran; our contract draft was wrong, not the code |
isi-nlp/astrapop/src/ets/train_sft.py code served (permissive licence) · get_code("f463ab3c42a28cb4") 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 transformers import PreTrainedTokenizer
torch.manual_seed(0)
class MockTokenizer:
def __init__(self):
self.bos_token = "[BOS]"
self.eos_token = "[EOS]"
self.vocab = {
"[BOS]": 0,
"[EOS]": 1,
"[SRC]": 2,
"[/SRC]": 3,
"hello": 4,
"world": 5,
"test": 6,
}
def __call__(self, text, add_special_tokens=False, max_length=1000, truncation=True):
tokens = text.split()
token_ids = [self.vocab.get(token, 5) for token in tokens]
if truncation and len(token_ids) > max_length:
token_ids = token_ids[:max_length]
return {
'input_ids': token_ids,
'attention_mask': [1] * len(token_ids)
}
example = {
'src': 'hello world',
'tgt': 'test output'
}
tokenizer = MockTokenizer()
ARGS = {
'example': example,
'tokenizer': tokenizer,
'max_len': 1000
}
- 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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| generate |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
isi-nlp/astrapop/src/ets/generate.py code served (permissive licence) · get_code("6c1788682bf64080") 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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
# Stand-in tokenizer that mimics HuggingFace tokenizer behavior
class MockTokenizer:
def __init__(self):
self.pad_token_id = 0
def __call__(self, prompts, add_special_tokens=False, max_length=384,
padding=True, truncation=True, return_tensors='pt'):
# Return mock encoded prompts
batch_size = len(prompts) if isinstance(prompts, list) else 1
seq_len = 5
return {
'input_ids': torch.randint(1, 100, (batch_size, seq_len)),
'attention_mask': torch.ones(batch_size, seq_len)
}
def batch_decode(self, token_ids, skip_special_tokens=True):
# Return mock decoded strings
batch_size = token_ids.size(0)
return [f"generated text {i}" for i in range(batch_size)]
# Stand-in generation config
class MockGenerationConfig:
def __init__(self):
self.max_length = 128
self.num_beams = 1
# Stand-in model with generate method
class MockModel(nn.Module):
def __init__(self):
super().__init__()
self.linear = nn.Linear(4, 4)
self._adapter_name = None
def set_adapter(self, adapter_name):
self._adapter_name = adapter_name
def generate(self, input_ids, attention_mask, generation_config, max_new_tokens):
# Return mock generated token ids
batch_size = input_ids.size(0)
input_len = input_ids.size(1)
new_tokens = 3
# Concatenate input_ids with new generated tokens
generated = torch.cat([
input_ids,
torch.randint(1, 100, (batch_size, new_tokens))
], dim=1)
return generated
# Construct arguments
prompts = ["Hello world", "How are you"]
model = MockModel()
tokenizer = MockTokenizer()
generation_config = MockGenerationConfig()
adapter_name = "test_adapter"
max_new_tokens = 128
ARGS = {
"prompts": prompts,
"model": model,
"tokenizer": tokenizer,
"generation_config": generation_config,
"adapter_name": adapter_name,
"max_new_tokens": max_new_tokens
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| generate |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
isi-nlp/astrapop/src/ets/generate_dpo_cpo_data.py code served (permissive licence) · get_code("4fef07692ec2e44f") 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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
from unittest.mock import Mock
torch.manual_seed(0)
# Minimal tokenizer stand-in
class MinimalTokenizer:
def __call__(self, prompts, add_special_tokens=False, max_length=1000,
padding=True, truncation=True, return_tensors='pt'):
batch_size = len(prompts) if isinstance(prompts, list) else 1
return {
'input_ids': torch.randint(0, 100, (batch_size, 5)),
'attention_mask': torch.ones(batch_size, 5, dtype=torch.long)
}
def batch_decode(self, token_ids, skip_special_tokens=True):
return ["generated text " + str(i) for i in range(token_ids.size(0))]
# Minimal generation config
class MinimalGenerationConfig:
pass
# Minimal model with generate method
class MinimalModel(nn.Module):
def __init__(self):
super().__init__()
self.linear = nn.Linear(4, 4)
def generate(self, input_ids, attention_mask, generation_config,
max_new_tokens, refs_input_ids=None, refs_attn_mask=None):
batch_size = input_ids.size(0)
seq_len = input_ids.size(1)
new_tokens = torch.randint(0, 100, (batch_size, max_new_tokens))
return torch.cat([input_ids, new_tokens], dim=1)
def set_adapter(self, adapter_name):
pass
# Create instances
tokenizer = MinimalTokenizer()
model = MinimalModel()
generation_config = MinimalGenerationConfig()
prompts = ["Hello world", "Test prompt"]
# Optional encoded_refs for testing the refs path
encoded_refs = {
'input_ids': torch.randint(0, 100, (2, 6)),
'attention_mask': torch.ones(2, 6, dtype=torch.long)
}
ARGS = {
'prompts': prompts,
'model': model,
'tokenizer': tokenizer,
'generation_config': generation_config,
'adapter_name': None,
'max_new_tokens': 128,
'encoded_refs': None
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_concat_transfer_prompt |
Ran ran; our contract draft was wrong, not the code |
isi-nlp/astrapop/src/reddit/train_ppo.py code served (permissive licence) · get_code("44f9b5a95924386d") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
torch.manual_seed(0)
# Analyze the function:
# - get_concat_transfer_prompt takes two parameters: src and refs
# - src is used in an f-string: f'[SRC]{src}[/SRC]'
# - refs is iterated over in a list comprehension: [f'[REF]{ref}[/REF]' for ref in refs]
# - Both src and refs are converted to strings in f-strings
# - So they can be strings or any objects with __str__ method
src = "This is the source text"
refs = ["Reference one", "Reference two", "Reference three"]
ARGS = {
"src": src,
"refs": refs,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_paraphrase_prompt |
Ran ran; our contract draft was wrong, not the code |
isi-nlp/astrapop/src/ets/generate.py code served (permissive licence) · get_code("9cc59215e82b53ec") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
torch.manual_seed(0)
src = "The quick brown fox jumps over the lazy dog"
ARGS = {
"src": src
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_random_tgt_lang |
Ran ran; our contract draft was wrong, not the code |
isi-nlp/astrapop/src/ets/train_ppo.py code served (permissive licence) · get_code("9d3e98497d85a686") 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 random
LANG2IDX = {'ARA': 0, 'DEU': 1, 'FRA': 2, 'HIN': 3, 'ITA': 4, 'JPN': 5, 'KOR': 6, 'SPA': 7, 'TEL': 8, 'TUR': 9, 'ZHO': 10}
def get_random_tgt_lang(src_lang):
langs = sorted(LANG2IDX.keys())
langs.remove(src_lang)
random_tgt_lang = random.choice(langs)
return random_tgt_lang
random.seed(0)
ARGS = {
'src_lang': 'ARA'
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_styll_prompt |
Ran ran; our contract draft was wrong, not the code |
isi-nlp/astrapop/src/reddit/train_sft.py code served (permissive licence) · get_code("724242a144261aac") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
# Define ARGS for get_styll_prompt
# The function takes:
# - src: a string (the source text to be rewritten)
# - refs: a list of tuples, where each tuple contains (paraphrased_tgt_text, tgt_text)
src = "The quick brown fox jumps over the lazy dog"
refs = [
("A fast brown fox leaps over a sleepy dog", "The speedy fox jumped over the sleeping dog"),
("The rapid fox hops across the inactive dog", "A quick fox vaulted over the lethargic dog"),
]
ARGS = {
"src": src,
"refs": refs,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_transfer_prompt |
Ran ran; our contract draft was wrong, not the code |
isi-nlp/astrapop/src/ets/generate.py code served (permissive licence) · get_code("af515ba22c9dfe28") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
ARGS = {
"src": "Hello, how are you?",
"native_lang": "en"
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_transfer_prompt |
Ran ran; our contract draft was wrong, not the code |
isi-nlp/astrapop/src/ets/generate_dpo_cpo_data.py code served (permissive licence) · get_code("ec477fe8b167e730") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
torch.manual_seed(0)
def get_transfer_prompt(src):
prompt = f'[SRC]{src}[/SRC]'
return prompt
ARGS = {
'src': 'This is a source text for transfer learning.'
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| encode_example_transfer |
Not yet run unverified (harvested, no recorded run) |
isi-nlp/astrapop/src/reddit/train_sft.py code served (permissive licence) · get_code("c42a75435bdfbae3") How it ran |