Update app.py
Browse files
app.py
CHANGED
@@ -64,9 +64,8 @@ class SQLQueryGenerator:
|
|
64 |
)
|
65 |
return generated_query
|
66 |
|
67 |
-
|
68 |
@spaces.GPU # Decorate this function to use GPU
|
69 |
-
def generate_sql(question):
|
70 |
return sql_query_generator.run_inference(question)
|
71 |
|
72 |
def main():
|
@@ -78,7 +77,7 @@ def main():
|
|
78 |
question = gr.Textbox(label="Enter your question")
|
79 |
submit = gr.Button("Generate SQL Query")
|
80 |
output = gr.Textbox(label="🌬️🌁🌫️SqlCoder-2")
|
81 |
-
submit.click(fn=generate_sql, inputs=question, outputs=output)
|
82 |
|
83 |
demo.launch()
|
84 |
|
|
|
64 |
)
|
65 |
return generated_query
|
66 |
|
|
|
67 |
@spaces.GPU # Decorate this function to use GPU
|
68 |
+
def generate_sql(question, sql_query_generator):
|
69 |
return sql_query_generator.run_inference(question)
|
70 |
|
71 |
def main():
|
|
|
77 |
question = gr.Textbox(label="Enter your question")
|
78 |
submit = gr.Button("Generate SQL Query")
|
79 |
output = gr.Textbox(label="🌬️🌁🌫️SqlCoder-2")
|
80 |
+
submit.click(fn=generate_sql, inputs=[question, gr.State(sql_query_generator)], outputs=output)
|
81 |
|
82 |
demo.launch()
|
83 |
|