| bucket |
Ran ran; our contract draft was wrong, not the code |
microsoft/dp-few-shot-generation/lmapi/src/lmapi/async_tools/asyncitertools.py code served (permissive licence) · get_code("44638cce82907058") 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 coroutine. 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 asyncio
from typing import AsyncGenerator, Iterable
async def sample_async_generator() -> AsyncGenerator[int, None]:
"""Simple async generator that yields integers 0-4"""
for i in range(5):
yield i
def sample_process(item: int) -> Iterable[tuple[int, str]]:
"""Process function that routes items to buckets and transforms them"""
bucket_idx = item % 3
transformed = f"item_{item}"
yield (bucket_idx, transformed)
ARGS = {
"num_buckets": 3,
"it": sample_async_generator(),
"process": sample_process,
}
- 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 coroutine — a coroutine output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a coroutine 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
|
| construct_prompt_same |
Ran ran; our contract draft was wrong, not the code |
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/run_exp_agnews.py code served (permissive licence) · get_code("0bf84d7908b72654") 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
label_dict = {0: ['World'], 1: ['Sports'], 2: ['Business'], 3: ['Technology']}
train_examples = [
{'text': 'International summit discusses climate change', 'label': 0},
{'text': 'Local team wins championship match', 'label': 1},
]
test_example = {
'text': 'New merger announced in tech sector',
'label': 2
}
ARGS = {
'train_examples': train_examples,
'test_example': test_example,
}
- 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
|
| construct_prompt_same |
Ran ran; our contract draft was wrong, not the code |
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/run_exp_dbpedia.py code served (permissive licence) · get_code("fa8cab36e1361d87") 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 numpy as np
labels = ['Company', 'School', 'Artist', 'Ath', 'Polit', 'Transportation', 'Building', 'Nature', 'Village', 'Animal', 'Plant', 'Album', 'Film', 'Book']
label_dict = {0: ['Company'], 1: ['School'], 2: ['Artist'], 3: ['Ath'], 4: ['Polit'], 5: ['Transportation'], 6: ['Building'], 7: ['Nature'], 8: ['Village'], 9: ['Animal'], 10: ['Plant'], 11: ['Album'], 12: ['Film'], 13: ['Book']}
# Create sample training examples
train_examples = [
{
'content': 'Apple Inc. is a technology company founded in 1976.',
'label': 0
},
{
'content': 'Harvard University is a prestigious school in Cambridge.',
'label': 1
}
]
# Create sample test example
test_example = {
'content': 'The Beatles was a famous music band.',
'label': 11
}
ARGS = {
'train_examples': train_examples,
'test_example': test_example
}
- 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 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
|
| construct_prompt_same |
Ran ran; our contract draft was wrong, not the code |
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/run_exp_movie.py code served (permissive licence) · get_code("5b5e01e114acc5e6") 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
# Construct train_examples: list of dicts with 'content' and 'label' keys
train_examples = [
{
'content': 'This movie was great',
'label': 'positive'
},
{
'content': 'I did not like this film',
'label': 'negative'
}
]
# Construct test_example: dict with 'content' and 'label' keys
test_example = {
'content': 'The acting was superb',
'label': None # Will be filled by the prompt construction
}
# Construct field_name: string
field_name = 'Sentiment'
ARGS = {
'train_examples': train_examples,
'test_example': test_example,
'field_name': field_name
}
- 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
|
| construct_prompt_same |
Ran ran; our contract draft was wrong, not the code |
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/run_exp_trec.py code served (permissive licence) · get_code("eecf2939e2cad740") 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
label_dict = {0: ['Ab'], 1: ['Entity'], 2: ['Description'], 3: ['Person'], 4: ['Location'], 5: ['Number']}
def construct_prompt_same(train_examples, test_example):
prompt = 'Classify the questions based on whether their answer type is a Number, Location, Person, Description, Entity, or Abbreviation.\n\n'
for train_example in train_examples:
prompt += 'Question: ' + train_example['text'] + '\n'
prompt += 'Answer Type: ' + label_dict[train_example['coarse_label']][0] + '\n\n'
prompt += 'Question: ' + test_example['text'] + '\n'
prompt += 'Answer Type:'
return prompt
train_examples = [
{'text': 'What is the capital of France?', 'coarse_label': 4},
{'text': 'How many planets are in the solar system?', 'coarse_label': 5}
]
test_example = {'text': 'Who is the president of the United States?', 'coarse_label': 3}
ARGS = {
'train_examples': train_examples,
'test_example': test_example
}
- 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
|
| densify |
Ran ran, honoured the contract we drafted |
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/prob_utils.py code served (permissive licence) · get_code("5c7d9873d8d10f37") 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 1, dtype family float, shape (10,) 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
# Based on the function signature and body:
# - vocab_size: int - used to create array of shape (vocab_size,)
# - logprobs: dict[int, float] - dict with int keys and float values, must be non-empty
# The function iterates over items and uses k as index and v as value
vocab_size = 10
logprobs = {0: -2.5, 3: -1.2, 7: -0.8, 9: -3.1}
ARGS = {
"vocab_size": vocab_size,
"logprobs": logprobs,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 1, dtype family float, shape (10,) — shape (10,) 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
|
| format_full_datum_for_prompt |
Ran ran; our contract draft was wrong, not the code |
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/run_exp_agnews.py code served (permissive licence) · get_code("1adc0f8de046bd4b") 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
labels = ['World', 'Sport', 'Business', 'Technology']
def format_full_datum_for_prompt(labels, datum: dict[str, str]):
return f'''News Type: "{labels[datum['label']]}"\nText: "{datum['text'] + ' END'}"\n'''
# Construct the datum dictionary
datum = {
'label': 0,
'text': 'Breaking news from around the globe'
}
# Define ARGS mapping all parameters
ARGS = {
'labels': labels,
'datum': datum
}
- 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
|
| format_full_datum_for_prompt |
Ran ran; our contract draft was wrong, not the code |
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/run_exp_dbpedia.py code served (permissive licence) · get_code("5ccd170c8c25a1a9") 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
labels = ['Company', 'School', 'Artist', 'Ath', 'Polit', 'Transportation', 'Building', 'Nature', 'Village', 'Animal', 'Plant', 'Album', 'Film', 'Book']
datum = {
'label': 0,
'content': 'This is a test document about a company'
}
ARGS = {
'labels': labels,
'datum': datum
}
- 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
|
| format_full_datum_for_prompt |
Ran ran; our contract draft was wrong, not the code |
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/run_exp_movie.py code served (permissive licence) · get_code("b6fe1bbe225ef52b") 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
# Construct arguments for format_full_datum_for_prompt
field_name = "label_field"
datum = {
"label": "positive",
"content": "This is a great product"
}
ARGS = {
"field_name": field_name,
"datum": datum
}
- 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
|
| format_full_datum_for_prompt |
Ran ran; our contract draft was wrong, not the code |
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/run_exp_trec.py code served (permissive licence) · get_code("9c8615eda7477f90") 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
labels = ['Ab', 'Entity', 'Description', 'Person', 'Location', 'Number']
datum = {
'coarse_label': 1,
'text': 'This is a test entity'
}
ARGS = {
'labels': labels,
'datum': datum
}
- 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
|
| format_test_input_for_prompt |
Ran ran; our contract draft was wrong, not the code |
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/run_exp_agnews.py code served (permissive licence) · get_code("34f0eccbe92abf73") 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.
labels = ['World', 'Sport', 'Business', 'Technology']
def format_test_input_for_prompt(labels, test_input: int):
return f'News Type: "{labels[test_input]}"\nText: "'
ARGS = {
'labels': labels,
'test_input': 0
}
- 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
|
| format_test_input_for_prompt |
Ran ran; our contract draft was wrong, not the code |
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/run_exp_dbpedia.py code served (permissive licence) · get_code("52e0b351e17a4c5b") 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.
labels = ['Company', 'School', 'Artist', 'Ath', 'Polit', 'Transportation', 'Building', 'Nature', 'Village', 'Animal', 'Plant', 'Album', 'Film', 'Book']
test_input = 3
ARGS = {
'labels': labels,
'test_input': test_input
}
- 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
|
| format_test_input_for_prompt |
Ran ran; our contract draft was wrong, not the code |
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/run_exp_movie.py code served (permissive licence) · get_code("1eb0215575d63ba9") 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
def format_test_input_for_prompt(field_name, test_input: str):
return f'{field_name}: "{test_input}"\nSentence: "'
torch.manual_seed(0)
field_name = "question"
test_input = "What is the capital of France?"
ARGS = {
"field_name": field_name,
"test_input": test_input,
}
- 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
|
| format_test_input_for_prompt |
Ran ran; our contract draft was wrong, not the code |
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/run_exp_trec.py code served (permissive licence) · get_code("4d172e7132a9045a") 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.
labels = ['Ab', 'Entity', 'Description', 'Person', 'Location', 'Number']
ARGS = {
'labels': labels,
'test_input': 0
}
- 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
|
| log_max_normalize |
Ran ran; our contract draft was wrong, not the code |
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/prob_utils.py code served (permissive licence) · get_code("ccccd602b13c9a9f") 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
# Set random seed for reproducibility
torch.manual_seed(0)
# Create a simple log probability distribution as a dictionary
# The function expects a dict mapping token IDs (or any hashable type) to log probabilities
logprobs = {
0: -0.5,
1: -1.2,
2: -2.3,
3: -0.1,
}
ARGS = {
"logprobs": logprobs
}
- 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
|
| log_normalize |
Ran ran; our contract draft was wrong, not the code |
microsoft/dp-few-shot-generation/src/dp_few_shot_generation/prob_utils.py code served (permissive licence) · get_code("33a763306ed859f8") 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
import scipy.special
# log_normalize takes a dict mapping from token IDs (type T) to log probabilities (float)
# The function calls list(logprobs.values()) and scipy.special.logsumexp on it
# Then it iterates over k, v pairs in the dict
# Construct a simple logprobs dictionary
logprobs = {
0: -0.5,
1: -1.2,
2: -2.1,
3: -0.8
}
ARGS = {
'logprobs': logprobs
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, scipy, 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
|
| openai_token_to_bytes |
Ran ran; our contract draft was wrong, not the code |
microsoft/dp-few-shot-generation/lmapi/src/lmapi/openai.py code served (permissive licence) · get_code("dbda3623619056cc") 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 bytes. 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 ast
def openai_token_to_bytes(token: str) -> bytes:
if token.startswith('bytes:'):
return ast.literal_eval(f"b'{token[6:]}'")
else:
return token.encode('utf-8')
# Test case 1: regular string token
token_1 = "hello world"
# Test case 2: bytes-prefixed token
token_2 = "bytes:hello"
ARGS = {
"token": token_1
}
- 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 bytes — a bytes output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a bytes 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
|