diff --git a/dbgpt_hub/eval/evaluation.py b/dbgpt_hub/eval/evaluation.py index 41cf314..7e1223b 100644 --- a/dbgpt_hub/eval/evaluation.py +++ b/dbgpt_hub/eval/evaluation.py @@ -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 @@ -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", @@ -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