mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-24 10:27:28 +08:00
* (improvement)(Headless) fix python llm proxy sqlWeight npe --------- Co-authored-by: jolunoluo
This commit is contained in:
@@ -113,6 +113,9 @@ public class OutputFormat {
|
||||
|
||||
public static Map<String, LLMSqlResp> buildSqlRespMap(List<Map<String, String>> sqlExamples,
|
||||
Map<String, Double> sqlMap) {
|
||||
if (sqlMap == null) {
|
||||
return new HashMap<>();
|
||||
}
|
||||
return sqlMap.entrySet().stream()
|
||||
.collect(Collectors.toMap(
|
||||
Map.Entry::getKey,
|
||||
|
||||
@@ -51,7 +51,7 @@ text2sql_agent.reload_setting(sql_ids, sql_exemplars, TEXT2DSL_EXAMPLE_NUM, TEXT
|
||||
if text2sql_agent_autoCoT.count_examples()==0:
|
||||
source_dir_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
example_dir_path = os.path.join(source_dir_path, 'few_shot_example')
|
||||
example_json_file = os.path.join(example_dir_path, 's2sql_exemplar3_transformed.json.json')
|
||||
example_json_file = os.path.join(example_dir_path, 's2sql_exemplar3_transformed.json')
|
||||
with open(example_json_file, 'r', encoding='utf-8') as f:
|
||||
transformed_sql_examplar_list = json.load(f)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user