Skip to content

Commit 356ac1e

Browse files
committed
small bug in synthesis
1 parent d0b4a25 commit 356ac1e

2 files changed

Lines changed: 7 additions & 10 deletions

File tree

scratch/scripts/synthesize_contexts.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
from datasmith.scrape.utils import _parse_commit_url
2222

2323
# configure_agent_backends(PORTKEY_MODEL_NAME="@anthropic/claude-3-5-sonnet-latest")
24-
configure_agent_backends(PORTKEY_MODEL_NAME="@togetherai/meta-llama/Llama-3.3-70B-Instruct-Turbo")
25-
24+
# configure_agent_backends(PORTKEY_MODEL_NAME="@togetherai/meta-llama/Llama-3.3-70B-Instruct-Turbo")
25+
configure_agent_backends(PORTKEY_MODEL_NAME="@togetherai/deepseek-ai/DeepSeek-V3")
2626

2727
# logger = configure_logging(level=10)
2828
logger = configure_logging(level=10, stream=open(Path(__file__).with_suffix(".tiny.log"), "w")) # noqa: SIM115
@@ -98,7 +98,7 @@ def process_inputs(args: argparse.Namespace) -> dict[tuple[str, str], set[tuple[
9898
sha = row["sha"]
9999
has_asv = row.get("has_asv", True)
100100
if not has_asv:
101-
logger.debug(f"Skipping {repo_name} commit {sha} as it does not have ASV benchmarks.")
101+
logger.debug("Skipping %s commit %s as it does not have ASV benchmarks.", repo_name, sha)
102102
continue
103103
owner, repo = repo_name.split("/")
104104
commit_date_unix: float = (
@@ -117,13 +117,10 @@ def prepare_tasks(
117117
all_states: dict[tuple[str, str], set[tuple[str, float]]], limit_per_repo: int, context_registry: ContextRegistry
118118
) -> list[Task]:
119119
all_tasks: list[Task] = []
120-
for (owner, repo), uniq in all_states.items():
121-
tasks = [Task(owner, repo, sha, commit_date=date) for sha, date in uniq]
120+
for (owner, repo), tup in all_states.items():
121+
tasks = list({Task(owner, repo, sha, commit_date=date) for sha, date in tup})
122122
tasks = list(filter(lambda t: t not in context_registry, tasks))
123-
if limit_per_repo < 0:
124-
limit_per_repo = len(tasks)
125-
else:
126-
# randomly choose limit_per_repo tasks from tasks
123+
if limit_per_repo > 0:
127124
tasks = random.sample(tasks, min(limit_per_repo, len(tasks)))
128125
all_tasks.extend(tasks)
129126
return all_tasks

src/datasmith/agents/context_synthesis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ def build_once_with_context(
405405
pull: bool = False,
406406
force: bool = False,
407407
) -> BuildResult:
408-
logger.info("build_once_with_context: registering context key=%s", task.get_image_name())
408+
# logger.info("build_once_with_context: registering context key=%s", task.get_image_name())
409409
logger.debug(
410410
"build_once_with_context: build args: REPO_URL=%s, COMMIT_SHA=%s, timeout_s=%s, tail_chars=%s, pull=%s",
411411
repo_url,

0 commit comments

Comments
 (0)