Spaces:
Sleeping
Sleeping
Melika Kheirieh
commited on
Commit
Β·
6004317
1
Parent(s):
a38f7c7
feat(pipeline): enable SQL-only repair + log-only repair for early stages with full traces/metrics
Browse files- nl2sql/pipeline.py +2 -5
nl2sql/pipeline.py
CHANGED
|
@@ -29,15 +29,14 @@ class FinalResult:
|
|
| 29 |
traces: List[dict]
|
| 30 |
|
| 31 |
|
| 32 |
-
SQL_REPAIR_STAGES = {"safety", "executor", "verifier"}
|
| 33 |
-
|
| 34 |
-
|
| 35 |
class Pipeline:
|
| 36 |
"""
|
| 37 |
NL2SQL Copilot pipeline:
|
| 38 |
detector β planner β generator β safety β executor β verifier β (optional repair loop).
|
| 39 |
"""
|
| 40 |
|
|
|
|
|
|
|
| 41 |
def __init__(
|
| 42 |
self,
|
| 43 |
*,
|
|
@@ -377,7 +376,6 @@ class Pipeline:
|
|
| 377 |
repair_input_builder=self._sql_repair_input_builder,
|
| 378 |
max_attempts=1,
|
| 379 |
sql=sql,
|
| 380 |
-
schema_preview=schema_preview,
|
| 381 |
traces=traces,
|
| 382 |
)
|
| 383 |
dt = (time.perf_counter() - t0) * 1000.0
|
|
@@ -411,7 +409,6 @@ class Pipeline:
|
|
| 411 |
max_attempts=1,
|
| 412 |
sql=sql,
|
| 413 |
traces=traces,
|
| 414 |
-
schema_preview=schema_preview,
|
| 415 |
)
|
| 416 |
dt = (time.perf_counter() - t0) * 1000.0
|
| 417 |
stage_duration_ms.labels("executor").observe(dt)
|
|
|
|
| 29 |
traces: List[dict]
|
| 30 |
|
| 31 |
|
|
|
|
|
|
|
|
|
|
| 32 |
class Pipeline:
|
| 33 |
"""
|
| 34 |
NL2SQL Copilot pipeline:
|
| 35 |
detector β planner β generator β safety β executor β verifier β (optional repair loop).
|
| 36 |
"""
|
| 37 |
|
| 38 |
+
SQL_REPAIR_STAGES = {"safety", "executor", "verifier"}
|
| 39 |
+
|
| 40 |
def __init__(
|
| 41 |
self,
|
| 42 |
*,
|
|
|
|
| 376 |
repair_input_builder=self._sql_repair_input_builder,
|
| 377 |
max_attempts=1,
|
| 378 |
sql=sql,
|
|
|
|
| 379 |
traces=traces,
|
| 380 |
)
|
| 381 |
dt = (time.perf_counter() - t0) * 1000.0
|
|
|
|
| 409 |
max_attempts=1,
|
| 410 |
sql=sql,
|
| 411 |
traces=traces,
|
|
|
|
| 412 |
)
|
| 413 |
dt = (time.perf_counter() - t0) * 1000.0
|
| 414 |
stage_duration_ms.labels("executor").observe(dt)
|