tweaking prompt a little further so it only outputs SQL more consistently
Browse files
test.py
CHANGED
@@ -18,7 +18,7 @@ model = AutoModelForCausalLM.from_pretrained("./deepseek-coder-1.3b-instruct", t
|
|
18 |
#tokenizer = AutoTokenizer.from_pretrained("../deepseek-coder-7b-instruct-v1.5")
|
19 |
#model = AutoModelForCausalLM.from_pretrained("../deepseek-coder-7b-instruct-v1.5").cuda()
|
20 |
|
21 |
-
input_text = 'If I have a SQL table called "game" with schema: CREATE TABLE IF NOT EXISTS "game" ("season_id" TEXT,"team_id_home" TEXT, "team_abbreviation_home" TEXT, "team_name_home" TEXT, "game_id" TEXT, "game_date" TIMESTAMP, "matchup_home" TEXT, "wl_home" TEXT, "min" INTEGER, "fgm_home" REAL, "fga_home" REAL, "fg_pct_home" REAL, "fg3m_home" REAL, "fg3a_home" REAL, "fg3_pct_home" REAL, "ftm_home" REAL, "fta_home" REAL, "ft_pct_home" REAL, "oreb_home" REAL, "dreb_home" REAL, "reb_home" REAL, "ast_home" REAL, "stl_home" REAL, "blk_home" REAL, "tov_home" REAL, "pf_home" REAL, "pts_home" REAL, "plus_minus_home" INTEGER, "video_available_home" INTEGER, "team_id_away" TEXT, "team_abbreviation_away" TEXT, "team_name_away" TEXT, "matchup_away" TEXT, "wl_away" TEXT, "fgm_away" REAL, "fga_away" REAL, "fg_pct_away" REAL, "fg3m_away" REAL, "fg3a_away" REAL, "fg3_pct_away" REAL, "ftm_away" REAL, "fta_away" REAL, "ft_pct_away" REAL, "oreb_away" REAL, "dreb_away" REAL, "reb_away" REAL, "ast_away" REAL, "stl_away" REAL, "blk_away" REAL, "tov_away" REAL, "pf_away" REAL, "pts_away" REAL, "plus_minus_away" INTEGER, "video_available_away" INTEGER, "season_type" TEXT ); and another table that can be used to get the team names and ids called team with schema: CREATE TABLE IF NOT EXISTS "team" ("id" TEXT, "full_name" TEXT, "abbreviation" TEXT, "nickname" TEXT, "city" TEXT, "state" TEXT, "year_founded" REAL ); How can I create a SQL query to obtain the maximum number of points the Los Angeles Lakers have at home? I need to get the team id from the team table. Output only the SQL Query as plain text and no other explanation or text, do not use any special characters around the SQL Query.'
|
22 |
|
23 |
messages=[
|
24 |
{ 'role': 'user', 'content': input_text}
|
|
|
18 |
#tokenizer = AutoTokenizer.from_pretrained("../deepseek-coder-7b-instruct-v1.5")
|
19 |
#model = AutoModelForCausalLM.from_pretrained("../deepseek-coder-7b-instruct-v1.5").cuda()
|
20 |
|
21 |
+
input_text = 'If I have a SQL table called "game" with schema: CREATE TABLE IF NOT EXISTS "game" ("season_id" TEXT,"team_id_home" TEXT, "team_abbreviation_home" TEXT, "team_name_home" TEXT, "game_id" TEXT, "game_date" TIMESTAMP, "matchup_home" TEXT, "wl_home" TEXT, "min" INTEGER, "fgm_home" REAL, "fga_home" REAL, "fg_pct_home" REAL, "fg3m_home" REAL, "fg3a_home" REAL, "fg3_pct_home" REAL, "ftm_home" REAL, "fta_home" REAL, "ft_pct_home" REAL, "oreb_home" REAL, "dreb_home" REAL, "reb_home" REAL, "ast_home" REAL, "stl_home" REAL, "blk_home" REAL, "tov_home" REAL, "pf_home" REAL, "pts_home" REAL, "plus_minus_home" INTEGER, "video_available_home" INTEGER, "team_id_away" TEXT, "team_abbreviation_away" TEXT, "team_name_away" TEXT, "matchup_away" TEXT, "wl_away" TEXT, "fgm_away" REAL, "fga_away" REAL, "fg_pct_away" REAL, "fg3m_away" REAL, "fg3a_away" REAL, "fg3_pct_away" REAL, "ftm_away" REAL, "fta_away" REAL, "ft_pct_away" REAL, "oreb_away" REAL, "dreb_away" REAL, "reb_away" REAL, "ast_away" REAL, "stl_away" REAL, "blk_away" REAL, "tov_away" REAL, "pf_away" REAL, "pts_away" REAL, "plus_minus_away" INTEGER, "video_available_away" INTEGER, "season_type" TEXT ); and another table that can be used to get the team names and ids called team with schema: CREATE TABLE IF NOT EXISTS "team" ("id" TEXT, "full_name" TEXT, "abbreviation" TEXT, "nickname" TEXT, "city" TEXT, "state" TEXT, "year_founded" REAL ); How can I create a SQL query to obtain the maximum number of points the Los Angeles Lakers have at home? I need to get the team id from the team table. Output only the SQL Query as plain text and no other explanation or text, do not use any special characters around the SQL Query, do not explain what the SQL Query is doing. Output only the SQL Query as plaintext'
|
22 |
|
23 |
messages=[
|
24 |
{ 'role': 'user', 'content': input_text}
|