| build_asr_model |
Ran ran on a synthesized input |
idiap/translation-aided-slu/models/build.py code served (permissive licence) · get_code("a65d1cf4ea441a9a") 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 Identity. 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 unittest.mock import Mock
torch.manual_seed(0)
class HParams:
def __init__(self):
self.asr_model_type = 'none'
self.adaptor_output_dim = 768
self.pad_token_id = 0
self.feat_proj_dropout = 0.1
self.final_dropout = 0.1
self.hidden_dropout = 0.1
self.activation_dropout = 0.1
self.mask_time_prob = 0.075
self.remove_top_layers = 0
self.asr_keep_feature_encoder_only = False
ARGS = {
'hparams': HParams()
}
- 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 Identity — a Identity output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Identity output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| build_classifier |
Ran ran on a synthesized input |
idiap/translation-aided-slu/models/build.py code served (permissive licence) · get_code("25d5a7d5c1a1d739") 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 Classifier. 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 unittest.mock import Mock
torch.manual_seed(0)
# Create a minimal hparams object with all required attributes
hparams = Mock()
hparams.classifier_type = 'none'
hparams.classifier_head_type = 'classifier'
hparams.classifier_hidden_size = 8
hparams.classifier_num_labels = 3
hparams.classifier_num_targets = 2
hparams.classifier_use_projector = True
hparams.classifier_projector_init_std = 0.02
hparams.classifier_pooling = 'mean'
hparams.classifier_dropout = 0.1
hparams.classifier_keep_layer_from = 0
hparams.classifier_keep_layer_to = 2
hparams.classifier_name = 'xlm-roberta-base'
hparams.qa_segment_cls = False
# Define input_dim
input_dim = 4
ARGS = {
'hparams': hparams,
'input_dim': input_dim,
}
- 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 Classifier — a Classifier output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Classifier output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| build_text_decoder |
Ran ran on a synthesized input |
idiap/translation-aided-slu/models/build.py code served (permissive licence) · get_code("7fc2ab07411c3b47") 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 MockBartDecoder. 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 BartConfig, T5Config, MBartConfig
torch.manual_seed(0)
class MockHParams:
def __init__(self):
self.decoder_model_name = "facebook/bart-base"
self.decoder_name = "facebook/bart-base"
self.decoder_type = "bart"
self.decoder_dropout = 0.1
self.decoder_stack_encoder = True
self.decoder_remove_decoder = False
class MockBartModel(nn.Module):
def __init__(self):
super().__init__()
self.encoder = nn.Linear(4, 3)
self.decoder = nn.Linear(3, 4)
self.shared = nn.Embedding(10, 4)
def num_parameters(self):
return sum(p.numel() for p in self.parameters())
class MockBartDecoder(nn.Module):
def __init__(self):
super().__init__()
self.model = MockBartModel()
self.lm_head = nn.Linear(4, 10)
self.config = type('Config', (), {'max_length': 100})()
def num_parameters(self):
return sum(p.numel() for p in self.parameters())
@classmethod
def from_pretrained(cls, model_name, dropout=0.1, activation_dropout=0.1):
return cls()
class MockT5Model(nn.Module):
def __init__(self):
super().__init__()
self.encoder = nn.Linear(4, 3)
self.decoder = nn.Linear(3, 4)
self.shared = nn.Embedding(10, 4)
def num_parameters(self):
return sum(p.numel() for p in self.parameters())
class MockT5Decoder(nn.Module):
def __init__(self):
super().__init__()
self.encoder = nn.Linear(4, 3)
self.decoder = nn.Linear(3, 4)
self.shared = nn.Embedding(10, 4)
self.lm_head = nn.Linear(4, 10)
self.config = type('Config', (), {'max_length': 100})()
def num_parameters(self):
return sum(p.numel() for p in self.parameters())
@classmethod
def from_pretrained(cls, model_name):
return cls()
import transformers.models.bart.modeling_bart as bart_module
import transformers.models.t5.modeling_t5 as t5_module
original_bart_from_pretrained = bart_module.BartForConditionalGeneration.from_pretrained
original_t5_from_pretrained = t5_module.T5ForConditionalGeneration.from_pretrained
def mock_bart_from_pretrained(cls, model_name, **kwargs):
return MockBartDecoder()
def mock_t5_from_pretrained(cls, model_name, **kwargs):
return MockT5Decoder()
bart_module.BartForConditionalGeneration.from_pretrained = classmethod(lambda cls, model_name, **kwargs: MockBartDecoder())
t5_module.T5ForConditionalGeneration.from_pretrained = classmethod(lambda cls, model_name, **kwargs: MockT5Decoder())
from transformers import BartForConditionalGeneration, T5ForConditionalGeneration
BartForConditionalGeneration.from_pretrained = classmethod(lambda cls, model_name, **kwargs: MockBartDecoder())
T5ForConditionalGeneration.from_pretrained = classmethod(lambda cls, model_name, **kwargs: MockT5Decoder())
hparams = MockHParams()
ARGS = {
"hparams": hparams
}
- 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 MockBartDecoder — a MockBartDecoder output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockBartDecoder 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_audiofile |
Ran ran; our contract draft was wrong, not the code |
idiap/translation-aided-slu/dataloader.py code served (permissive licence) · get_code("6bc062e8e9560b15") 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 BytesIO. 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
import tempfile
import zipfile
import io
# Create a temporary directory structure for testing
temp_dir = tempfile.mkdtemp()
sub_dir_name = "audio_data"
sub_dir_path = os.path.join(temp_dir, sub_dir_name)
os.makedirs(sub_dir_path, exist_ok=True)
# Create a test audio file with .flac suffix
test_filename = "sample_001_abc_defg.flac"
test_file_path = os.path.join(sub_dir_path, test_filename)
with open(test_file_path, 'wb') as f:
f.write(b"fake audio data")
# Also create a zip file alternative for testing the zipfile path
zip_path = os.path.join(temp_dir, sub_dir_name + '.zip')
with zipfile.ZipFile(zip_path, 'w') as zf:
zf.writestr(test_filename, b"fake audio data from zip")
ARGS = {
"datadir": temp_dir,
"sub_dir": sub_dir_name,
"name": "sample_001_abc_defg"
}
- 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 BytesIO — a BytesIO 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
|
| get_audiofile_spec |
Ran ran on a synthesized input |
idiap/translation-aided-slu/dataloader.py code served (permissive licence) · get_code("537bc17db309f75e") 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 BufferedReader. 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 io
import os
import zipfile
import tempfile
import shutil
# Create a temporary directory for testing
test_dir = tempfile.mkdtemp()
# Create subdirectories and files for testing
datadir = test_dir
sub_dir = "audio_data"
os.makedirs(os.path.join(datadir, sub_dir), exist_ok=True)
# Create a test audio file
test_filename = "sample_001_file.wav"
test_file_path = os.path.join(datadir, sub_dir, test_filename)
with open(test_file_path, 'wb') as f:
f.write(b"fake audio data")
# Test case 1: Direct file in subdirectory
ARGS = {
"datadir": datadir,
"sub_dir": sub_dir,
"name": test_filename
}
- 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 BufferedReader — a BufferedReader 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
|
| is_weight_decayed |
Ran ran on a synthesized input |
idiap/translation-aided-slu/models/model.py code served (permissive licence) · get_code("a0ad3496d9b49bfc") 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 bool, 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 torch.nn as nn
torch.manual_seed(0)
# The function is_weight_decayed takes a parameter 'n' which is a string
# It splits the string by '.' and checks the last and second-to-last parts
# A typical use case would be parameter names from a neural network model
# Create sample parameter names that would be used with this function
param_name_1 = "layer.0.weight" # Should be weight decayed
param_name_2 = "layer.0.bias" # Should NOT be weight decayed (ends with bias)
param_name_3 = "layer_norm.weight" # Should NOT be weight decayed (second-to-last is layer_norm)
# The function takes a single parameter 'n' which is a string
ARGS = {
"n": "layer.0.weight"
}
- 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 bool, 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
|
| learning_rate_schedule |
Ran ran on a synthesized input |
idiap/translation-aided-slu/models/model.py code served (permissive licence) · get_code("2ae3cdbae25787c9") 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 int, ndim 0, dtype family int, 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
torch.manual_seed(0)
class HyperparameterConfig:
def __init__(self):
self.reset_period = 1000
self.reset_times = 3
self.warmup_steps = 100
self.plateau_steps = 200
self.decay_steps = 300
self.decay_type = 'linear'
self.max_lr = 0.001
self.min_lr = 0.0001
self.final_lr = 0.00001
hp = HyperparameterConfig()
global_step = 250
ARGS = {
'global_step': global_step,
'hp': hp
}
- 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 int, ndim 0, dtype family int, 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
|
| normalize |
Ran ran on a synthesized input |
idiap/translation-aided-slu/corpora/gigawords.py code served (permissive licence) · get_code("068c70006f05aa82") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import re
def normalize(text):
text = text.replace('-lrb-', '(').replace('-rrb-', ')').replace('-lsb-', '[').replace('-rsb-', ']').replace('-lcb-', '{').replace('-rcb-', '}').replace('&', '&').replace('{ ndash }', '--').replace('/ {', '').replace('/ }', '').replace('{ rsquo }', "'").replace('{ lsquo }', "'").replace('{ ldquo }', '"').replace('{ rdquo }', '"').replace('{ emdash }', '--').replace('–', '--')
text = (' ' + text + ' ').replace(" ' s ", "'s ").replace(" ' t ", "'t ").replace(" ' m ", "'m ").replace(" ' ve ", "'ve ").replace(" ' re ", "'re ").replace(" ' d ", "'d ").replace(" ' ll ", "'ll ")
text = text.replace(" n't ", "n't ").replace(" 's", "'s").replace(" 'd ", "'d ").replace(" 'll ", "'ll ").replace(" 'm ", "'m ").replace(" 've ", "'ve ").replace(" 're ", "'re ")
text = text.replace('\\', '').replace('_', ' ').replace('``', "''").replace('`', "'").replace('~', '').replace('^', '')
for ch in ',.!?:;)':
text = text.replace(' ' + ch, ch)
text = text.replace('( ', '(')
text = text.replace('port-au - prince', 'port-au-prince')
text = (' ' + text + ' ').replace(' skorea', ' south korea').replace(' nkorea', ' north korea').replace(' aa ', ' AA ').replace(' aaa ', ' AAA ').replace('u.s.', 'US').replace('u.s', 'US').replace('u.n.', 'UN').replace('u.n', 'UN').replace('u.k.', 'UK').replace('u.k', 'UK').replace('at&t', 'AT&T')
for word in ['un', 'us', 'eu', 'au', 'roc']:
text = re.sub('\\b%s\\b' % word, word.upper(), text)
text = text.replace('í', 'i')
text = text.replace('+ postponed indefinitely +', 'postponed indefinitely').replace('+ speculative +', 'speculative').replace('+ the people +', 'the people').replace('+ iran +', 'iran').replace('+ the star +', 'the star')
text = text.replace('port-AU-prince', 'port-au-prince')
while '---' in text:
text = text.replace('---', '--')
text = re.sub('\\s+', ' ', text)
return text.strip().strip('*').strip()
ARGS = {
'text': "Hello -lrb- world -rrb- ! This is a test with u.s. and & symbols. The text has multiple spaces and should be normalized properly."
}
- 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
|
| normalize |
Ran ran on a synthesized input |
idiap/translation-aided-slu/corpora/mustc.py code served (permissive licence) · get_code("6d0ce37650057628") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import re
import unicodedata
# The function takes a single parameter 'text' which should be a string
# Test with various text inputs to demonstrate the function works
ARGS = {
'text': "Hello Ō world with ∞ & ′ characters (Swahili) [test]"
}
- 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
|
| to_long_nonneg |
Ran ran on a synthesized input |
idiap/translation-aided-slu/models/model.py code served (permissive licence) · get_code("8208905c59cd78a1") 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 (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 torch
import numpy as np
torch.manual_seed(0)
# Test case 1: torch.Tensor input
tensor_input = torch.tensor([[-1.5, 0.3, 2.7, -0.1], [1.2, -3.8, 0.0, 4.9]])
# Test case 2: numpy.ndarray input
numpy_input = np.array([[-1.5, 0.3, 2.7, -0.1], [1.2, -3.8, 0.0, 4.9]])
# Test case 3: scalar input (int or float)
scalar_input = 3.7
ARGS = {
"r": tensor_input
}
- 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 (2, 4) — shape (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
|
| normalize |
Not yet run unverified (harvested, no recorded run) |
idiap/translation-aided-slu/corpora/covost2.py code served (permissive licence) · get_code("2d04e37fb39df9f3") How it ran |