Spaces:
Runtime error
Runtime error
update examples
Browse files
app.py
CHANGED
@@ -13,8 +13,8 @@ def sql_generate(prompt, input_prompt_sql ):
|
|
13 |
print(f"*****Inside SQL_generate - Prompt is :{prompt}")
|
14 |
print(f"length of input_prompt_sql is {len(input_prompt_sql)}")
|
15 |
print(f"length of prompt is {len(prompt)}")
|
16 |
-
if len(
|
17 |
-
prompt =
|
18 |
|
19 |
json_ = {"inputs": prompt,
|
20 |
"parameters":
|
@@ -66,7 +66,7 @@ with demo:
|
|
66 |
"Instruction: Given an input question, respond with syntactically correct PostgreSQL. Only use table called 'employees'.\nInput: Select names of all the employees who are working under 'Peter'.\nPostgreSQL query: ", ], label= "Choose a sample Prompt")
|
67 |
|
68 |
#with gr.Column:
|
69 |
-
input_prompt_sql = gr.Textbox(label="Or Write text following the example pattern given below, to get SQL commands...", value="Use table called 'department'.\nInput: Select names of all the departments in descending alphabetical order.\nPostgreSQL query: ", lines=
|
70 |
|
71 |
with gr.Row():
|
72 |
generated_txt = gr.Textbox(lines=3)
|
|
|
13 |
print(f"*****Inside SQL_generate - Prompt is :{prompt}")
|
14 |
print(f"length of input_prompt_sql is {len(input_prompt_sql)}")
|
15 |
print(f"length of prompt is {len(prompt)}")
|
16 |
+
if len(prompt) == 0:
|
17 |
+
prompt = input_prompt_sql
|
18 |
|
19 |
json_ = {"inputs": prompt,
|
20 |
"parameters":
|
|
|
66 |
"Instruction: Given an input question, respond with syntactically correct PostgreSQL. Only use table called 'employees'.\nInput: Select names of all the employees who are working under 'Peter'.\nPostgreSQL query: ", ], label= "Choose a sample Prompt")
|
67 |
|
68 |
#with gr.Column:
|
69 |
+
input_prompt_sql = gr.Textbox(label="Or Write text following the example pattern given below, to get SQL commands...", value="Instruction: Given an input question, respond with syntactically correct PostgreSQL. Use table called 'department'.\nInput: Select names of all the departments in their descending alphabetical order.\nPostgreSQL query: ", lines=6)
|
70 |
|
71 |
with gr.Row():
|
72 |
generated_txt = gr.Textbox(lines=3)
|