ysharma HF staff commited on
Commit
510f936
·
1 Parent(s): 4d09f3b
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -60,7 +60,7 @@ def text_generate(prompt, input_prompt_sql, input_prompt_dalle2):
60
  print(f"output_tmp is: {output_tmp}")
61
  solution = output_tmp.split("\nQ:")[0] #output[0]['generated_text'].split("Q:")[0] # +"."
62
  print(f"Final response after splits is: {solution}")
63
- final_solution = solution.split("\nOutput::")[0]
64
  print(f"Response after removing output is: {final_solution}")
65
 
66
  #if "\n\n" not in output_tmp:
@@ -74,7 +74,7 @@ def text_generate(prompt, input_prompt_sql, input_prompt_dalle2):
74
  # poem = output_tmp.split("\n\n")[0] # +"."
75
  #poem = poem.replace('?','')
76
  #print(f"Poem being returned is: {poem}")
77
- return solution #output #response #output_tmp #poem
78
 
79
 
80
  demo = gr.Blocks()
@@ -91,8 +91,8 @@ with demo:
91
  "Instruction: Given an input question, respond with syntactically correct PostgreSQL. Only use tables called 'employees'.\nInput: List name of all the employees whose name ends with 'r'?\nPostgreSQL query: ",
92
  "Instruction: Given an input question, respond with syntactically correct PostgreSQL. Only use tables called 'employees' and 'department'.\nInput: What is the number of employees in each department?\nPostgreSQL query: ",
93
  "Instruction: Given an input question, respond with syntactically correct PostgreSQL. Only use table called 'employees'.\nInput: select the name of the employees whose name's 3rd charactor is 't'.\nPostgreSQL query: ",
94
- "Instruction: Given an input question, respond with syntactically correct PostgreSQL. Only use table called 'employees'.\nInput: Select the name of all the employee who are working under 'Peter'\nPostgreSQL query: ",
95
- "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")
96
 
97
  input_prompt_sql = gr.Textbox(label="Or Write text to get SQL commands...")
98
  input_prompt_dalle2 = gr.Textbox(label="Or Write sample Dalle2 prompts to get more Prompt ideas...")
 
60
  print(f"output_tmp is: {output_tmp}")
61
  solution = output_tmp.split("\nQ:")[0] #output[0]['generated_text'].split("Q:")[0] # +"."
62
  print(f"Final response after splits is: {solution}")
63
+ final_solution = solution.split("\nOutput:")[0]
64
  print(f"Response after removing output is: {final_solution}")
65
 
66
  #if "\n\n" not in output_tmp:
 
74
  # poem = output_tmp.split("\n\n")[0] # +"."
75
  #poem = poem.replace('?','')
76
  #print(f"Poem being returned is: {poem}")
77
+ return final_solution #solution #output #response #output_tmp #poem
78
 
79
 
80
  demo = gr.Blocks()
 
91
  "Instruction: Given an input question, respond with syntactically correct PostgreSQL. Only use tables called 'employees'.\nInput: List name of all the employees whose name ends with 'r'?\nPostgreSQL query: ",
92
  "Instruction: Given an input question, respond with syntactically correct PostgreSQL. Only use tables called 'employees' and 'department'.\nInput: What is the number of employees in each department?\nPostgreSQL query: ",
93
  "Instruction: Given an input question, respond with syntactically correct PostgreSQL. Only use table called 'employees'.\nInput: select the name of the employees whose name's 3rd charactor is 't'.\nPostgreSQL query: ",
94
+ "Instruction: Given an input question, respond with syntactically correct PostgreSQL. Only use table called 'employees'.\nInput: Select the name of all the employee who are working under 'Peter'\nPostgreSQL query: ", ], label= "Choose a sample Prompt")
95
+ #"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")
96
 
97
  input_prompt_sql = gr.Textbox(label="Or Write text to get SQL commands...")
98
  input_prompt_dalle2 = gr.Textbox(label="Or Write sample Dalle2 prompts to get more Prompt ideas...")