Skip to content

Commit

Permalink
Added method SpiderExample.run_query to execute candidate queries
Browse files Browse the repository at this point in the history
and load the results into a `pandas.DataFrame`.

added arguments to `InferenceSetup` that pass parameters to the guide
and proposal.

added `InferenceSetupVLLM` which mirrors `InferenceSetup`, but targets
the `vllm` backend.
  • Loading branch information
timvieira committed Jun 26, 2024
1 parent 9729742 commit 9a42c47
Show file tree
Hide file tree
Showing 4 changed files with 342 additions and 135 deletions.
8 changes: 8 additions & 0 deletions bench/spider/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from bench.spider.evaluator import Evaluator

import genparse
import sqlite3
import pandas as pd


class SpiderInterface:
Expand Down Expand Up @@ -74,6 +76,12 @@ def describe(self):
Remember, DO NOT provide any commentary or explanation of what the code does, just the SQL statement ending in a semicolon.
"""

def run_query(self, query):
db = self.interface.evaluator.db_path / self.db_name / (self.db_name + '.sqlite')
with sqlite3.connect(db) as conn:
df = pd.read_sql_query(query, conn)
return df


def test_interface():
spider = SpiderInterface()
Expand Down
Loading

0 comments on commit 9a42c47

Please sign in to comment.