Mustehson commited on
Commit
11dc9b2
·
1 Parent(s): 4fd7636

Clear Function

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -73,8 +73,7 @@ def get_table_schema(table):
73
  return ddl_create
74
 
75
  # Get Prompt
76
- def get_prompt(schema, query_input, parent_database):
77
- schema = schema.replace()
78
  text = f"""
79
  ### Instruction:
80
  Your task is to generate valid duckdb SQL query to answer the following question.
@@ -107,9 +106,9 @@ def text2sql(table, query_input):
107
  result_output:pd.DataFrame([{"error": f"❌ Unable to get the SQL query based on the text. {e}"}])
108
  }
109
 
110
- schema, parent_database = get_table_schema(table)
111
  print(f'Schema Generated...')
112
- prompt = get_prompt(schema, query_input, parent_database)
113
  print(f'Prompt Generated...')
114
  try:
115
  print(f'Generating SQL... {model.device}')
 
73
  return ddl_create
74
 
75
  # Get Prompt
76
+ def get_prompt(schema, query_input):
 
77
  text = f"""
78
  ### Instruction:
79
  Your task is to generate valid duckdb SQL query to answer the following question.
 
106
  result_output:pd.DataFrame([{"error": f"❌ Unable to get the SQL query based on the text. {e}"}])
107
  }
108
 
109
+ schema = get_table_schema(table)
110
  print(f'Schema Generated...')
111
+ prompt = get_prompt(schema, query_input)
112
  print(f'Prompt Generated...')
113
  try:
114
  print(f'Generating SQL... {model.device}')