(improvement)add corrector additional information switch and evalution time cost (#743)

This commit is contained in:
mainmain
2024-02-23 15:05:13 +08:00
committed by GitHub
parent 61316e939c
commit f50a3157d5
6 changed files with 39 additions and 11 deletions

View File

@@ -65,12 +65,19 @@ def get_pred_result():
questions=read_query(input_path)
pred_sql_list=[]
default_sql="select * from tablea "
time_cost=[]
for i in range(0,len(questions)):
start_time = time.time()
pred_sql=get_pred_sql(questions[i],url,agent_id,chat_id,authorization,default_sql)
end_time = time.time()
cost='%.3f'%(end_time-start_time)
time_cost.append(cost)
pred_sql_list.append(pred_sql)
time.sleep(60)
write_sql(pred_sql_path, pred_sql_list)
return [float(cost) for cost in time_cost]
if __name__ == "__main__":
print("pred")