Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,10 +23,10 @@ def generate_sql_query(text_input_schema:str,text_input_question: str):
|
|
| 23 |
|
| 24 |
try:
|
| 25 |
prompt = f"""<|system|>
|
| 26 |
-
{
|
| 27 |
|
| 28 |
<|user|>
|
| 29 |
-
{
|
| 30 |
|
| 31 |
<|sql|>"""
|
| 32 |
|
|
@@ -37,11 +37,8 @@ def generate_sql_query(text_input_schema:str,text_input_question: str):
|
|
| 37 |
stop=["<end_of_turn>"]
|
| 38 |
)
|
| 39 |
|
| 40 |
-
generated_pattern = completion['choices'][0]['text'].strip()
|
| 41 |
-
|
| 42 |
-
time.sleep(0.5)
|
| 43 |
-
|
| 44 |
-
return result
|
| 45 |
|
| 46 |
except Exception as e:
|
| 47 |
return {"error": e}
|
|
|
|
| 23 |
|
| 24 |
try:
|
| 25 |
prompt = f"""<|system|>
|
| 26 |
+
{text_input_schema}
|
| 27 |
|
| 28 |
<|user|>
|
| 29 |
+
{text_input_question}
|
| 30 |
|
| 31 |
<|sql|>"""
|
| 32 |
|
|
|
|
| 37 |
stop=["<end_of_turn>"]
|
| 38 |
)
|
| 39 |
|
| 40 |
+
generated_pattern = completion['choices'][0]['text'].strip()
|
| 41 |
+
return generated_pattern
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
except Exception as e:
|
| 44 |
return {"error": e}
|