Skip to content

Commit

Permalink
Merge pull request #87 from eosphoros-ai/refactor
Browse files Browse the repository at this point in the history
fix eval  bug
  • Loading branch information
zhanghy-sketchzh authored Oct 7, 2023
2 parents 4fcec76 + dee3211 commit 1dd8b21
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions dbgpt_hub/eval/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
--db
"""
import os
import json
import sys
ROOT_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(ROOT_PATH)
import sqlite3
import argparse
import subprocess
Expand Down Expand Up @@ -1166,7 +1168,7 @@ def build_foreign_key_map_from_json(table):
dest="db",
type=str,
help="the directory that contains all the databases and test suites",
default="./data/spider/database",
default="./dbgpt_hub/data/spider/database",
)
parser.add_argument(
"--table",
Expand Down Expand Up @@ -1218,13 +1220,13 @@ def build_foreign_key_map_from_json(table):
output_file_path = (
args.input.rsplit(".", 1)[0] + "2sql." + args.input.rsplit(".", 1)[1]
)
args.gold = "./data/eval/gold_natsql2sql.txt"
args.table = "./data/eval/tables_for_natsql2sql.json"
args.gold = "./dbgpt_hub/data/eval_data/gold_natsql2sql.txt"
args.table = "./dbgpt_hub/data/eval_data/tables_for_natsql2sql.json"
else:
output_file_path = args.input
# args.gold = "./eval/data/gold.txt"
args.gold = "./data/eval/gold.txt"
args.table = "./data/eval/tables.json"
args.gold = "./dbgpt_hub/data/eval_data/gold.txt"
args.table = "./dbgpt_hub/data/eval_data/tables.json"
args.pred = output_file_path

# only evaluating exact match needs this argument
Expand Down

0 comments on commit 1dd8b21

Please sign in to comment.