Skip to content

Commit e4c24df

Browse files
committed
Fix all linting errors for CI
1 parent 7559c30 commit e4c24df

11 files changed

+55
-22
lines changed

config_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44

55
from pathlib import Path
6-
from typing import Any, Dict, List, Optional
6+
from typing import List, Optional
77

88
from pydantic import BaseModel, Field, field_validator, model_validator
99

data_loader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import json
66
from pathlib import Path
7-
from typing import Any, Dict, List, Optional
7+
from typing import Any, Dict, List
88

99
import os
1010

error_handling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import asyncio
66
import time
77
from functools import wraps
8-
from typing import Any, Callable, Optional, TypeVar
8+
from typing import Any, Callable, TypeVar
99

1010
T = TypeVar('T')
1111

inspect_eval.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Inspect AI evaluation integration with Tinker sampling.
33
"""
44

5-
from typing import Any, Dict, List, Optional
5+
from typing import Any, List
66

77
try:
88
from inspect_ai import Task, task, eval_async

mock_tinker.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
import asyncio
88
import json
99
from pathlib import Path
10-
from typing import Any, Dict, List, Optional
11-
import numpy as np
10+
from typing import Any, List, Optional
1211

1312

1413
class MockTokenizer:

runs/20251001_190318/metrics.jsonl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{"timestamp": "2025-10-01T19:03:18.098341", "run_id": "20251001_190318", "event": "config", "base_model": "test-model", "train_file": "/private/var/folders/1s/sm2bn6kd64gdnv757t9qshcm0000gn/T/pytest-of-jonathanhaas/pytest-42/test_early_stopping_on_thresho0/train.jsonl", "eval_tasks": [], "renderer_name": "default", "learning_rate": 0.0001, "eval_threshold": 0.8, "max_rounds": 5, "lr_decay": 0.8, "evalops_enabled": false, "evalops_test_suite_id": null, "evalops_api_url": null, "steps_per_round": 1, "batch_size": 8, "max_seq_length": 2048, "lora_rank": 16, "warmup_steps": 100, "max_steps": 1000, "min_lr": 1e-06, "use_recommended_lr": false}
2+
{"timestamp": "2025-10-01T19:03:18.098969", "run_id": "20251001_190318", "event": "checkpoint", "round": 1, "checkpoint_uri": "<MagicMock name='mock.create_lora_training_client().save_weights_for_sampler().result().path' id='4432954096'>"}
3+
{"timestamp": "2025-10-01T19:03:18.099294", "run_id": "20251001_190318", "event": "evaluation", "round": 1, "score": 0.85, "threshold": 0.8, "passed": true, "metrics": {}}
4+
{"timestamp": "2025-10-01T19:03:18.101804", "run_id": "20251001_190318", "event": "config", "base_model": "test-model", "train_file": "/private/var/folders/1s/sm2bn6kd64gdnv757t9qshcm0000gn/T/pytest-of-jonathanhaas/pytest-42/test_full_rounds_below_thresho0/train.jsonl", "eval_tasks": [], "renderer_name": "default", "learning_rate": 0.0001, "eval_threshold": 0.9, "max_rounds": 3, "lr_decay": 0.5, "evalops_enabled": false, "evalops_test_suite_id": null, "evalops_api_url": null, "steps_per_round": 1, "batch_size": 8, "max_seq_length": 2048, "lora_rank": 16, "warmup_steps": 100, "max_steps": 1000, "min_lr": 1e-06, "use_recommended_lr": false}
5+
{"timestamp": "2025-10-01T19:03:18.102345", "run_id": "20251001_190318", "event": "checkpoint", "round": 1, "checkpoint_uri": "<MagicMock name='mock.create_lora_training_client().save_weights_for_sampler().result().path' id='4432958464'>"}
6+
{"timestamp": "2025-10-01T19:03:18.102699", "run_id": "20251001_190318", "event": "evaluation", "round": 1, "score": 0.7, "threshold": 0.9, "passed": false, "metrics": {}}
7+
{"timestamp": "2025-10-01T19:03:18.102840", "run_id": "20251001_190318", "event": "checkpoint", "round": 2, "checkpoint_uri": "<MagicMock name='mock.create_lora_training_client().save_weights_for_sampler().result().path' id='4432958464'>"}
8+
{"timestamp": "2025-10-01T19:03:18.102992", "run_id": "20251001_190318", "event": "evaluation", "round": 2, "score": 0.7, "threshold": 0.9, "passed": false, "metrics": {}}
9+
{"timestamp": "2025-10-01T19:03:18.103112", "run_id": "20251001_190318", "event": "checkpoint", "round": 3, "checkpoint_uri": "<MagicMock name='mock.create_lora_training_client().save_weights_for_sampler().result().path' id='4432958464'>"}
10+
{"timestamp": "2025-10-01T19:03:18.103254", "run_id": "20251001_190318", "event": "evaluation", "round": 3, "score": 0.7, "threshold": 0.9, "passed": false, "metrics": {}}
11+
{"timestamp": "2025-10-01T19:03:18.107130", "run_id": "20251001_190318", "event": "config", "base_model": "test-model", "train_file": "/private/var/folders/1s/sm2bn6kd64gdnv757t9qshcm0000gn/T/pytest-of-jonathanhaas/pytest-42/test_evalops_integration_calle0/train.jsonl", "eval_tasks": [], "renderer_name": "default", "learning_rate": 0.0001, "eval_threshold": 0.8, "max_rounds": 1, "lr_decay": 0.8, "evalops_enabled": true, "evalops_test_suite_id": "suite-123", "evalops_api_url": null, "steps_per_round": 1, "batch_size": 8, "max_seq_length": 2048, "lora_rank": 16, "warmup_steps": 100, "max_steps": 1000, "min_lr": 1e-06, "use_recommended_lr": false}
12+
{"timestamp": "2025-10-01T19:03:18.107583", "run_id": "20251001_190318", "event": "checkpoint", "round": 1, "checkpoint_uri": "<MagicMock name='mock.create_lora_training_client().save_weights_for_sampler().result().path' id='4428275328'>"}
13+
{"timestamp": "2025-10-01T19:03:18.107842", "run_id": "20251001_190318", "event": "evaluation", "round": 1, "score": 0.9, "threshold": 0.8, "passed": true, "metrics": {}}
14+
{"timestamp": "2025-10-01T19:03:18.110235", "run_id": "20251001_190318", "event": "config", "base_model": "test-model", "train_file": "/private/var/folders/1s/sm2bn6kd64gdnv757t9qshcm0000gn/T/pytest-of-jonathanhaas/pytest-42/test_lr_decay_across_rounds0/train.jsonl", "eval_tasks": [], "renderer_name": "default", "learning_rate": 1.0, "eval_threshold": 0.99, "max_rounds": 3, "lr_decay": 0.5, "evalops_enabled": false, "evalops_test_suite_id": null, "evalops_api_url": null, "steps_per_round": 1, "batch_size": 8, "max_seq_length": 2048, "lora_rank": 16, "warmup_steps": 0, "max_steps": 1000, "min_lr": 1e-06, "use_recommended_lr": false}
15+
{"timestamp": "2025-10-01T19:03:18.110732", "run_id": "20251001_190318", "event": "checkpoint", "round": 1, "checkpoint_uri": "<MagicMock name='mock.create_lora_training_client().save_weights_for_sampler().result().path' id='4432955104'>"}
16+
{"timestamp": "2025-10-01T19:03:18.110961", "run_id": "20251001_190318", "event": "evaluation", "round": 1, "score": 0.7, "threshold": 0.99, "passed": false, "metrics": {}}
17+
{"timestamp": "2025-10-01T19:03:18.111106", "run_id": "20251001_190318", "event": "checkpoint", "round": 2, "checkpoint_uri": "<MagicMock name='mock.create_lora_training_client().save_weights_for_sampler().result().path' id='4432955104'>"}
18+
{"timestamp": "2025-10-01T19:03:18.111363", "run_id": "20251001_190318", "event": "evaluation", "round": 2, "score": 0.7, "threshold": 0.99, "passed": false, "metrics": {}}
19+
{"timestamp": "2025-10-01T19:03:18.111497", "run_id": "20251001_190318", "event": "checkpoint", "round": 3, "checkpoint_uri": "<MagicMock name='mock.create_lora_training_client().save_weights_for_sampler().result().path' id='4432955104'>"}
20+
{"timestamp": "2025-10-01T19:03:18.111667", "run_id": "20251001_190318", "event": "evaluation", "round": 3, "score": 0.7, "threshold": 0.99, "passed": false, "metrics": {}}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"round_idx": 3,
3+
"global_step": 3,
4+
"learning_rate": 0.25,
5+
"checkpoint_uri": "<MagicMock name='mock.create_lora_training_client().save_weights_for_sampler().result().path' id='4432955104'>",
6+
"config": {
7+
"base_model": "test-model",
8+
"train_file": "/private/var/folders/1s/sm2bn6kd64gdnv757t9qshcm0000gn/T/pytest-of-jonathanhaas/pytest-42/test_lr_decay_across_rounds0/train.jsonl",
9+
"eval_tasks": [],
10+
"renderer_name": "default",
11+
"learning_rate": 1.0,
12+
"eval_threshold": 0.99,
13+
"max_rounds": 3,
14+
"lr_decay": 0.5,
15+
"evalops_enabled": false,
16+
"evalops_test_suite_id": null,
17+
"evalops_api_url": null,
18+
"steps_per_round": 1,
19+
"batch_size": 8,
20+
"max_seq_length": 2048,
21+
"lora_rank": 16,
22+
"warmup_steps": 0,
23+
"max_steps": 1000,
24+
"min_lr": 1e-06,
25+
"use_recommended_lr": false
26+
},
27+
"timestamp": "2025-10-01T19:03:18.111574"
28+
}

tests/test_config_schema.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
Unit tests for configuration schema validation.
33
"""
44

5-
import tempfile
6-
from pathlib import Path
75

86
import pytest
97
from pydantic import ValidationError

tests/test_data_loader.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@
22
Unit tests for data loader.
33
"""
44

5-
import json
65
import sys
7-
import tempfile
8-
from pathlib import Path
9-
from unittest.mock import MagicMock, Mock
6+
from unittest.mock import Mock
107

118
import pytest
129

tests/test_training_loop.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
import sys
66
from unittest.mock import AsyncMock, MagicMock, Mock, patch
7-
import tempfile
8-
from pathlib import Path
97

108
import pytest
119

0 commit comments

Comments
 (0)