chanukool commited on
Commit
64041f8
·
1 Parent(s): 5329b0e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -8,14 +8,14 @@ def sql_generate(prompt,input_prompt_sql):
8
  model=BloomForCausalLM.from_pretrained(checkpoint)
9
 
10
  text_generator = pipeline(
11
- "text-generation", model=model, tokenizer=tokenizer, device=0 if torch.cuda.is_available() else -1
12
  )
13
 
14
  if len(prompt) == 0:
15
  prompt = input_prompt_sql
16
 
17
  model_args= {
18
- "max_length":50,
19
  "top_p": 0.9,
20
  "temperature": 1.1,
21
  "return_full_text": False,
@@ -44,7 +44,7 @@ with demo:
44
  "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")
45
 
46
  #with gr.Column:
47
- input_prompt_sql = gr.Textbox(label="Or Write text following the example pattern given below, to get SQL commands...", value=example_prompt, lines=6)
48
 
49
  with gr.Row():
50
  generated_txt = gr.Textbox(lines=3)
 
8
  model=BloomForCausalLM.from_pretrained(checkpoint)
9
 
10
  text_generator = pipeline(
11
+ "text-generation", model=model, tokenizer=tokenizer
12
  )
13
 
14
  if len(prompt) == 0:
15
  prompt = input_prompt_sql
16
 
17
  model_args= {
18
+ "max_length":40,
19
  "top_p": 0.9,
20
  "temperature": 1.1,
21
  "return_full_text": False,
 
44
  "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")
45
 
46
  #with gr.Column:
47
+ 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\nInput: How many users signed up in the past month?\nPostgreSQL query: ", lines=6)
48
 
49
  with gr.Row():
50
  generated_txt = gr.Textbox(lines=3)