Skip to content

Commit 1caf0ef

Browse files
committed
fixes
1 parent 1403be3 commit 1caf0ef

File tree

17 files changed

+59
-32
lines changed

17 files changed

+59
-32
lines changed

.github/workflows/validation.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ jobs:
2727
- name: Sync all dependencies (including dev)
2828
run: uv sync --dev --extra torch --extra onnx
2929

30-
- name: Lint with Ruff
31-
run: uv run ruff src/
30+
- name: Lint with Ruff (GitHub annotations)
31+
uses: astral-sh/ruff-action@v3
32+
with:
33+
src: "./src ./app"
3234

3335
- name: Check formatting with Black
3436
run: uv run black --check src/

src/data/data.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
from pydantic import BaseModel, field_validator
21
from typing import List
32

3+
from pydantic import BaseModel, field_validator
4+
5+
46
class BatchInput(BaseModel):
57
features: List[List[float]] # Batch of input samples
68

src/inference_onnx/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from .onnx_engine import ONNXInferenceEngine
21
from .config import EngineParams
2+
from .onnx_engine import ONNXInferenceEngine
33

44
__all__ = ["ONNXInferenceEngine", "EngineParams"]

src/inference_onnx/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
from pydantic_settings import BaseSettings
21
from typing import Literal
2+
33
import onnxruntime as ort
4+
from pydantic_settings import BaseSettings
5+
46

57
class EngineParams(BaseSettings):
68
device: Literal["cpu", "cuda"] = "cuda"

src/inference_onnx/onnx_engine.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
import onnxruntime as ort
2-
import numpy as np
3-
from concurrent.futures import ThreadPoolExecutor
41
import asyncio
5-
from typing import List, Dict, Any
2+
from concurrent.futures import ThreadPoolExecutor
3+
from typing import Any, Dict, List
4+
5+
import numpy as np
6+
import onnxruntime as ort
7+
68

79
class ONNXInferenceEngine:
810
def __init__(self, onnx_path: str, providers: List[str], num_threads: int = 4):

src/inference_torch/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from .torch_engine import TorchInferenceEngine
21
from .config import EngineParams
2+
from .torch_engine import TorchInferenceEngine
33

44
__all__ = ["TorchInferenceEngine", "EngineParams"]

src/inference_torch/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
from pydantic_settings import BaseSettings
21
from typing import Literal
2+
33
import torch
44
from loguru import logger
5+
from pydantic_settings import BaseSettings
6+
57

68
class EngineParams(BaseSettings):
79
device: Literal["cpu", "cuda"] = "cuda"

src/inference_torch/torch_engine.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
import torch
2-
from torch import nn
3-
from concurrent.futures import ThreadPoolExecutor
41
import asyncio
5-
from typing import List, Dict, Any
2+
from concurrent.futures import ThreadPoolExecutor
3+
from typing import Any, Dict, List
4+
65
import numpy as np
6+
import torch
7+
from torch import nn
8+
79

810
class TorchInferenceEngine:
911
def __init__(self, model: nn.Module, device: torch.device, num_threads: int = 4):

src/log_config/log_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from loguru import logger
22
from pydantic_settings import BaseSettings
33

4+
45
def setup_logging(
56
log_file: str = "app.log",
67
level: str = "DEBUG",

src/models/iris.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import torch.nn as nn
21
import torch
2+
import torch.nn as nn
3+
34

45
class IrisDL(nn.Module):
56
def __init__(

0 commit comments

Comments
 (0)