Skip to content

Commit dae3165

Browse files
committed
autoflake import fix
1 parent 03e488d commit dae3165

28 files changed

Lines changed: 30 additions & 75 deletions

File tree

.pre-commit-config.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,15 @@ repos:
1010
- id: check-json
1111
- id: check-merge-conflict
1212
- id: detect-private-key
13+
14+
15+
16+
- repo: https://github.com/myint/autoflake
17+
rev: v2.2.0
18+
hooks:
19+
- id: autoflake
20+
args: [
21+
--in-place,
22+
--remove-all-unused-imports,
23+
--ignore-init-module-imports
24+
]

ajet/backbone/main_vllm.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import atexit
21
import os
32
import sys
43
from types import SimpleNamespace
@@ -83,7 +82,7 @@ def submit_chat_completions(self, messages, sampling_params, request_id, tools=[
8382
"content": message["content"],
8483
"tool_calls": message.get("tool_calls", None),
8584
"tokens": [
86-
TokenAndProbVllmDebug(t) for t in completion.choices[0].logprobs.content # type: ignore
85+
TokenAndProbVllmDebug(t) for t in completion.choices[0].logprobs.content # type: ignore
8786
],
8887
}
8988
)
@@ -131,7 +130,7 @@ async def submit_chat_completions_async(self, messages, sampling_params, request
131130
"content": message["content"],
132131
"tool_calls": message.get("tool_calls", None),
133132
"tokens": [
134-
TokenAndProbVllmDebug(t) for t in completion.choices[0].logprobs.content # type: ignore
133+
TokenAndProbVllmDebug(t) for t in completion.choices[0].logprobs.content # type: ignore
135134
],
136135
}
137136
)

ajet/backbone/trainer_trinity.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ def __init__(
6565
)
6666

6767
def convert_task(self, task: TrinityTask):
68-
from ajet.schema.task import Task
6968
assert isinstance(task.raw_task, dict)
7069
return dict_to_ajet_task(task.raw_task)
7170

ajet/context_tracker/base_tracker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from typing import List, Tuple, Union
2-
from typing import List, Union, Tuple, Dict, Optional, Any
2+
from typing import List, Union, Tuple, Dict, Optional
33
from ajet.schema.task import WorkflowTask
44

55
from ajet.schema.extended_msg import (

ajet/context_tracker/timeline_merging/timeline_merging.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from typing import List
22

3-
from beast_logger import print_listofdict
43

54
from ajet.context_tracker.basic_tracker import ExtendedMessage
65

ajet/schema/convertion.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
from openai.types.chat.chat_completion_message import ChatCompletionMessage
55
from agentscope.model import ChatResponse as AgentScopeChatResponse
66
from openai.types.completion_usage import CompletionUsage
7-
from typing import Any, Callable, Dict, List, Literal, Type, Union
7+
from typing import List, Type
88
from agentscope.message import TextBlock, ToolUseBlock
99
from agentscope._utils._common import _json_loads_with_repair
1010
from pydantic import BaseModel
11-
from agentscope.model import ChatResponse
1211

1312

1413
def convert_llm_proxy_response_to_oai_response(llm_proxy_response):

ajet/task_rollout/async_llm_bridge.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
import json
44
import time
55
import uuid
6-
from typing import Any, Callable, Dict, List, Literal, Type, Union
6+
from typing import Any, Callable, Dict, List, Literal, Union
77

88

99

1010
from loguru import logger
1111
from omegaconf import DictConfig
1212
from pydantic import BaseModel
13-
from transformers.tokenization_utils import PreTrainedTokenizer
1413
from vllm.entrypoints.openai.tool_parsers.hermes_tool_parser import Hermes2ProToolParser
1514
from vllm.outputs import RequestOutput as VerlVllmRequestOutput
1615

ajet/task_runner/base_runner.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from threading import Lock
44
from typing import Any, Callable, Union, Type
55
from multiprocessing import Process, Queue
6-
from unittest import result
76

87
from ajet.context_tracker.basic_tracker import BaseContextTracker
98
from ajet.schema.task import WorkflowOutput, WorkflowTask

ajet/task_runner/general_runner.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
from venv import logger
21

32
from ajet import AjetTuner
4-
from ajet import Workflow, WorkflowOutput
3+
from ajet import WorkflowOutput
54
from ajet.context_tracker.multiagent_tracking import (
65
MultiAgentContextTracker,
76
)

ajet/tuner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import TYPE_CHECKING, Any, Literal, Callable, Union, Type
1+
from typing import TYPE_CHECKING, Callable, Union, Type
22

33
from ajet.context_tracker.multiagent_tracking import (
44
MultiAgentContextTracker,

0 commit comments

Comments
 (0)