Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"

Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,35 @@ on:
pull_request:

jobs:
lint:
# `pre-commit run --all-files` is not enforced anywhere, so `ruff check llmsql`
# has been failing on main. Run the same ruff version as .pre-commit-config.yaml
# (v0.8.4) on every supported interpreter: the lint rules include `UP`
# (pyupgrade), whose findings depend on the target Python version.
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install ruff
run: pip install "ruff==0.8.4"

- name: Lint
run: ruff check llmsql

- name: Check formatting
run: ruff format --check llmsql

test:
runs-on: ubuntu-latest

Expand Down
4 changes: 3 additions & 1 deletion llmsql/_cli/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ def _add_args(self) -> None:
# COMMON BENCHMARK ARGS
# =========================
def add_common_benchmark_args(parser: argparse.ArgumentParser) -> None:
parser.add_argument("--version", default="2.0", choices=get_available_versions())
parser.add_argument(
"--version", default="2.0", choices=get_available_versions()
)
parser.add_argument("--output-file", default="llm_sql_predictions.jsonl")
parser.add_argument(
"--workdir-path",
Expand Down
3 changes: 2 additions & 1 deletion llmsql/_cli/llmsql_cli.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import argparse
import textwrap

from llmsql._cli.inference import Inference
from llmsql._cli.evaluate import Evaluate
from llmsql._cli.inference import Inference


class ParserCLI:
"""Main CLI parser that manages all subcommands."""
Expand Down
5 changes: 3 additions & 2 deletions llmsql/inference/inference_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ async def _inference_api_async(
write_lock = asyncio.Lock()

async with aiohttp.ClientSession(headers=headers) as session:

# Pre-build all prompts using the shared function
prompts = build_all_requests(questions, tables, prompt_builder)

Expand Down Expand Up @@ -152,7 +151,9 @@ async def process_question(q: dict[str, Any], prompt: str) -> dict[str, str]:

return result

tasks = [process_question(q, p) for q, p in zip(questions, prompts)]
tasks = [
process_question(q, p) for q, p in zip(questions, prompts, strict=True)
]
for coro in tqdm(
asyncio.as_completed(tasks),
total=len(tasks),
Expand Down
Loading