Update app.py
Browse files
app.py
CHANGED
@@ -9,6 +9,7 @@ You can also use efog 🌬️🌁🌫️SqlCoder by cloning this space. 🧬🔬
|
|
9 |
Join us : 🌟TeamTonic🌟 is always making cool demos! Join our active builder's🛠️community 👻[](https://discord.gg/GWpVpekp) On 🤗Huggingface: [TeamTonic](https://huggingface.co/TeamTonic) & [MultiTransformer](https://huggingface.co/MultiTransformer) On 🌐Github: [Polytonic](https://github.com/tonic-ai) & contribute to 🌟 [Poly](https://github.com/tonic-ai/poly) 🤗Big thanks to Yuvi Sharma and all the folks at huggingface for the community grant 🤗
|
10 |
"""
|
11 |
|
|
|
12 |
class SQLQueryGenerator:
|
13 |
def __init__(self, model_name, prompt_file="prompt.md", metadata_file="metadata.sql"):
|
14 |
self.tokenizer, self.model = self.get_tokenizer_model(model_name)
|
@@ -65,7 +66,6 @@ class SQLQueryGenerator:
|
|
65 |
)
|
66 |
return generated_query
|
67 |
|
68 |
-
@spaces.GPU # Decorate this function to use GPU
|
69 |
def generate_sql(question, sql_query_generator):
|
70 |
return sql_query_generator.run_inference(question)
|
71 |
|
|
|
9 |
Join us : 🌟TeamTonic🌟 is always making cool demos! Join our active builder's🛠️community 👻[](https://discord.gg/GWpVpekp) On 🤗Huggingface: [TeamTonic](https://huggingface.co/TeamTonic) & [MultiTransformer](https://huggingface.co/MultiTransformer) On 🌐Github: [Polytonic](https://github.com/tonic-ai) & contribute to 🌟 [Poly](https://github.com/tonic-ai/poly) 🤗Big thanks to Yuvi Sharma and all the folks at huggingface for the community grant 🤗
|
10 |
"""
|
11 |
|
12 |
+
@spaces.GPU
|
13 |
class SQLQueryGenerator:
|
14 |
def __init__(self, model_name, prompt_file="prompt.md", metadata_file="metadata.sql"):
|
15 |
self.tokenizer, self.model = self.get_tokenizer_model(model_name)
|
|
|
66 |
)
|
67 |
return generated_query
|
68 |
|
|
|
69 |
def generate_sql(question, sql_query_generator):
|
70 |
return sql_query_generator.run_inference(question)
|
71 |
|