Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -13,10 +13,10 @@ nl2sql_pipeline = pipeline("text2text-generation", model=model, tokenizer=tokeni
|
|
13 |
spider_dataset = load_dataset("spider", split='train[:5]')
|
14 |
|
15 |
def generate_sql(query):
|
16 |
-
#
|
17 |
-
|
18 |
# Run the pipeline
|
19 |
-
results = nl2sql_pipeline(
|
20 |
# Extract the SQL query
|
21 |
sql_query = results[0]['generated_text']
|
22 |
return sql_query
|
|
|
13 |
spider_dataset = load_dataset("spider", split='train[:5]')
|
14 |
|
15 |
def generate_sql(query):
|
16 |
+
# Format the input for the model
|
17 |
+
input_text = f"translate English to SQL: {query}"
|
18 |
# Run the pipeline
|
19 |
+
results = nl2sql_pipeline(input_text)
|
20 |
# Extract the SQL query
|
21 |
sql_query = results[0]['generated_text']
|
22 |
return sql_query
|