ysharma HF staff commited on
Commit
162a61b
1 Parent(s): 0f291ad
Files changed (1) hide show
  1. app.py +9 -5
app.py CHANGED
@@ -32,12 +32,14 @@ A: Let’s think step by step.
32
 
33
 
34
 
35
- def text_generate(prompt, input_prompt_sql):
36
 
37
  print(f"*****Inside poem_generate - Prompt is :{prompt}")
38
  if input_prompt_sql != '':
39
  prompt = "Instruction: Given an input question, respond with syntactically correct PostgreSQL\nInput: " +input_prompt_sql + "\nPostgreSQL query: "
40
-
 
 
41
  json_ = {"inputs": prompt,
42
  "parameters":
43
  {
@@ -81,9 +83,11 @@ with demo:
81
  )
82
  with gr.Row():
83
  #example_prompt = gr.Radio( ["Q: A juggler can juggle 16 balls. Half of the balls are golf balls, and half of the golf balls are blue. How many blue golf balls are there?\nA: Let’s think step by step.\n"], label= "Choose a sample Prompt")
84
- example_prompt = gr.Radio( ["Instruction: Given an input question, respond with syntactically correct PostgreSQL\nInput: how many users signed up in the past month?\nPostgreSQL query: ", "Prompt: Cyberwave vaporpunk art of a kneeling figure, looking up at a glowing neon book icon, smoke and mist, pink and blue lighting, cybernetic sci-fi render\nPrompt: " ], label= "Choose a sample Prompt")
 
85
  input_prompt_sql = gr.Textbox(label="Or Write text to get SQL commands...")
86
-
 
87
  #input_word = gr.Textbox(placeholder="Enter a word here to generate text ...")
88
  generated_txt = gr.Textbox(lines=7)
89
  #output_image = gr.Image(type="filepath", shape=(256,256))
@@ -91,7 +95,7 @@ with demo:
91
  b1 = gr.Button("Generate SQL")
92
  #b2 = gr.Button("Generate Image")
93
 
94
- b1.click(text_generate,inputs=[example_prompt, input_prompt_sql], outputs=generated_txt) #input_word
95
  #b2.click(poem_to_image, poem_txt, output_image)
96
  #examples=examples
97
 
 
32
 
33
 
34
 
35
+ def text_generate(prompt, input_prompt_sql, input_prompt_dalle2):
36
 
37
  print(f"*****Inside poem_generate - Prompt is :{prompt}")
38
  if input_prompt_sql != '':
39
  prompt = "Instruction: Given an input question, respond with syntactically correct PostgreSQL\nInput: " +input_prompt_sql + "\nPostgreSQL query: "
40
+ else if input_prompt_dalle2 !='':
41
+ prompt = "Dalle Prompt: " + input_prompt_dalle2 + "\nNew Dalle Prompt: "
42
+
43
  json_ = {"inputs": prompt,
44
  "parameters":
45
  {
 
83
  )
84
  with gr.Row():
85
  #example_prompt = gr.Radio( ["Q: A juggler can juggle 16 balls. Half of the balls are golf balls, and half of the golf balls are blue. How many blue golf balls are there?\nA: Let’s think step by step.\n"], label= "Choose a sample Prompt")
86
+ example_prompt = gr.Radio( ["Instruction: Given an input question, respond with syntactically correct PostgreSQL\nInput: how many users signed up in the past month?\nPostgreSQL query: ", "Dalle Prompt: Cyberwave vaporpunk art of a kneeling figure, looking up at a glowing neon book icon, smoke and mist, pink and blue lighting, cybernetic sci-fi render\nNew Dalle Prompt: " ], label= "Choose a sample Prompt")
87
+
88
  input_prompt_sql = gr.Textbox(label="Or Write text to get SQL commands...")
89
+ input_prompt_dalle2 = gr.Textbox(label="Or Write sample Dalle2 prompts to get more Prompt ideas...")
90
+
91
  #input_word = gr.Textbox(placeholder="Enter a word here to generate text ...")
92
  generated_txt = gr.Textbox(lines=7)
93
  #output_image = gr.Image(type="filepath", shape=(256,256))
 
95
  b1 = gr.Button("Generate SQL")
96
  #b2 = gr.Button("Generate Image")
97
 
98
+ b1.click(text_generate,inputs=[example_prompt, input_prompt_sql, input_prompt_dalle2], outputs=generated_txt) #input_word
99
  #b2.click(poem_to_image, poem_txt, output_image)
100
  #examples=examples
101