Change code style to use absolute imports - #33
Conversation
| main_message += f"[usage] Tokens used so far: {sample_total_tokens():,}/{state.token_limit:,}." | ||
| main_message += f"[usage] Tokens used so far: {state.token_usage:,}/{state.token_limit:,}." |
There was a problem hiding this comment.
See inspect_ai/solver/_task_state.py - this method is now exposed via a public API.
| relative_usage = sample_total_tokens() / state.token_limit | ||
| relative_usage = state.token_usage / state.token_limit |
There was a problem hiding this comment.
See preceding comment
| ) -> inspect_ai.scorer.Score: | ||
| tools = list[inspect_ai.tool.ToolInfo]() | ||
| for event in reversed(inspect_ai.log.transcript().events): | ||
| if isinstance(event, inspect_ai.event.ModelEvent): |
There was a problem hiding this comment.
Note that this was moved from the inspect.log package to the inspect.event package, see here
There was a problem hiding this comment.
Not sure that the infra is using a version of inspect from before or after the move
There was a problem hiding this comment.
I believe we’re on 0.3.147 (at least that’s the version my eval sets were using this morning), so after the move
|
BTW, "absolute imports" a different thing from importing modules instead of functions/classes |
Ah, I see - reread the Google style guide and some docs on absolute vs relative imports and now understand. Thanks! |
Think it's best to do this before we move triframe into this repo, so that everything's consistent.