richardr1126
commited on
Commit
•
a6cb97b
1
Parent(s):
560d821
Change to gpt-4
Browse files
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
|
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-
|
140 |
messages=[
|
141 |
-
{"role": "system", "content": "You are a SQLite dummy database generator.
|
142 |
{"role": "user", "content": prompt}
|
143 |
],
|
144 |
#temperature=0.7,
|
|
|
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,
|