nikravan commited on
Commit
f4d7079
1 Parent(s): a30dbe3

decrease sample

Browse files
Files changed (1) hide show
  1. app.py +3 -12
app.py CHANGED
@@ -26,7 +26,7 @@ def sql_generate(prompt, input_prompt_sql ):
26
  "return_full_text": False,
27
  },
28
  "options":
29
- {"use_cache": True,
30
  "wait_for_model": True,
31
  },}
32
  response = requests.post(API_URL, json=json_)
@@ -57,23 +57,14 @@ with demo:
57
  )
58
  with gr.Row():
59
 
60
- example_prompt = gr.Radio( [
61
- "Instruction: Given an input question, respond with syntactically correct PostgreSQL\nInput: How many users signed up in the past month?\nPostgreSQL query: ",
62
- "Instruction: Given an input question, respond with syntactically correct PostgreSQL\nInput: Create a query that displays empfname, emplname, deptid, deptname, location from employee table. Results should be in the ascending order based on the empfname and location.\nPostgreSQL query: ",
63
- "Instruction: Given an input question, respond with syntactically correct PostgreSQL. Only use table called 'employees'.\nInput: What is the total salary paid to all the employees?\nPostgreSQL query: ",
64
- "Instruction: Given an input question, respond with syntactically correct PostgreSQL. Only use table called 'employees'.\nInput: List names of all the employees whose name end with 'r'.\nPostgreSQL query: ",
65
- "Instruction: Given an input question, respond with syntactically correct PostgreSQL. Only use table called 'employees'.\nInput: What are the number of employees in each department?\nPostgreSQL query: ",
66
- "Instruction: Given an input question, respond with syntactically correct PostgreSQL. Only use table called 'employees'.\nInput: Select names of all theemployees who have third character in their name as 't'.\nPostgreSQL query: ",
67
- "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")
68
-
69
- #with gr.Column:
70
  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)
71
 
72
  with gr.Row():
73
  generated_txt = gr.Textbox(lines=3)
74
 
75
  b1 = gr.Button("Generate SQL")
76
- b1.click(sql_generate,inputs=[example_prompt, input_prompt_sql], outputs=generated_txt)
77
 
78
 
79
  demo.launch(enable_queue=True, debug=True)
 
26
  "return_full_text": False,
27
  },
28
  "options":
29
+ {"use_cache": False,
30
  "wait_for_model": True,
31
  },}
32
  response = requests.post(API_URL, json=json_)
 
57
  )
58
  with gr.Row():
59
 
60
+
 
 
 
 
 
 
 
 
 
61
  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)
62
 
63
  with gr.Row():
64
  generated_txt = gr.Textbox(lines=3)
65
 
66
  b1 = gr.Button("Generate SQL")
67
+ b1.click(sql_generate,inputs=[input_prompt_sql], outputs=generated_txt)
68
 
69
 
70
  demo.launch(enable_queue=True, debug=True)