richardr1126 commited on
Commit
b7ec18f
1 Parent(s): a6cb97b

New prompt

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -130,15 +130,15 @@ def extract_db_code(text):
130
  return [match.strip() for match in matches]
131
 
132
  def generate_dummy_db(db_info, question):
133
- pre_prompt = "Generate a SQLite database with dummy data for this database from the DB Layout and make sure to add dummy data relevent to the question."
134
  prompt = pre_prompt + "\n\nDB Layout:" + db_info + "\n\nQuestion: " + question
135
 
136
  while True:
137
  try:
138
  response = openai.ChatCompletion.create(
139
- model="gpt-4",
140
  messages=[
141
- {"role": "system", "content": "You are a SQLite dummy database generator.\n\n1. You will create the specified dummy database with the same exact table and column names used in the DB Layout.\n2. Insert the dummy data.\n3. Output the only the code in a SQL code block.\n\nMake sure you add dummy data relevant to the Question, don't write any SELECT statements or actual queries, and do not change any of the table or column names. "},
142
  {"role": "user", "content": prompt}
143
  ],
144
  #temperature=0.7,
@@ -152,8 +152,8 @@ def generate_dummy_db(db_info, question):
152
 
153
  except Exception as e:
154
  print(f'Error occurred: {str(e)}')
155
- print('Waiting for 20 seconds before retrying...')
156
- time.sleep(20)
157
 
158
  def test_query_on_dummy_db(db_code, query):
159
  try:
 
130
  return [match.strip() for match in matches]
131
 
132
  def generate_dummy_db(db_info, question):
133
+ pre_prompt = "Generate a SQLite database with dummy data for this database from the DB Layout."
134
  prompt = pre_prompt + "\n\nDB Layout:" + db_info + "\n\nQuestion: " + question
135
 
136
  while True:
137
  try:
138
  response = openai.ChatCompletion.create(
139
+ model="gpt-3.5-turbo",
140
  messages=[
141
+ {"role": "system", "content": "You are a SQLite dummy database generator.\n1. You will create the specified dummy database.\n2. Use the same exact table and column names used from the DB Layout.\n3. Insert dummy data relevant to the Question.\n4. Output the only the datbase code in a code block."},
142
  {"role": "user", "content": prompt}
143
  ],
144
  #temperature=0.7,
 
152
 
153
  except Exception as e:
154
  print(f'Error occurred: {str(e)}')
155
+ print('Waiting for 10 seconds before retrying...')
156
+ time.sleep(10)
157
 
158
  def test_query_on_dummy_db(db_code, query):
159
  try: