Update app.py
Browse files
app.py
CHANGED
|
@@ -25,16 +25,7 @@ pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
|
| 25 |
|
| 26 |
def text_to_sql(text):
|
| 27 |
# Load Model with PEFT adapter
|
| 28 |
-
|
| 29 |
-
"jinhybr/code-llama-7b-text-to-sql",
|
| 30 |
-
device="cuda" if torch.cuda.is_available() else "cpu",
|
| 31 |
-
torch_dtype=torch.float16
|
| 32 |
-
)
|
| 33 |
-
tokenizer = AutoTokenizer.from_pretrained("jinhybr/code-llama-7b-text-to-sql")
|
| 34 |
-
|
| 35 |
-
# load into pipeline
|
| 36 |
-
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
| 37 |
-
|
| 38 |
# Define schema and user question
|
| 39 |
#schema = "CREATE TABLE table_17429402_7 (school VARCHAR, last_occ_championship VARCHAR)"
|
| 40 |
schema = 'You are an text to SQL query translator. Users will ask you questions in English and you will generate a SQL query based on the provided SCHEMA.\nSCHEMA:\nCREATE TABLE table_17429402_7 (school VARCHAR, last_occ_championship VARCHAR)'
|
|
|
|
| 25 |
|
| 26 |
def text_to_sql(text):
|
| 27 |
# Load Model with PEFT adapter
|
| 28 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
# Define schema and user question
|
| 30 |
#schema = "CREATE TABLE table_17429402_7 (school VARCHAR, last_occ_championship VARCHAR)"
|
| 31 |
schema = 'You are an text to SQL query translator. Users will ask you questions in English and you will generate a SQL query based on the provided SCHEMA.\nSCHEMA:\nCREATE TABLE table_17429402_7 (school VARCHAR, last_occ_championship VARCHAR)'
|