Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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
|
| 12 |
)
|
| 13 |
|
| 14 |
if len(prompt) == 0:
|
| 15 |
prompt = input_prompt_sql
|
| 16 |
|
| 17 |
model_args= {
|
| 18 |
-
"max_length":
|
| 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=
|
| 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)
|