Update README.md
Browse files
README.md
CHANGED
@@ -92,18 +92,18 @@ Addressing the power of LLM in fintuned downstream task. Implemented as a person
|
|
92 |
|
93 |
# Load model directly
|
94 |
```python
|
95 |
-
|
|
|
96 |
|
97 |
-
|
98 |
|
99 |
-
model = AutoModelForSeq2SeqLM.from_pretrained("SwastikM/bart-large-nl2sql")
|
100 |
|
101 |
query_question_with_context = """sql_prompt: Which economic diversification efforts in
|
102 |
the 'diversification' table have a higher budget than the average budget for all economic diversification efforts in the 'budget' table?
|
103 |
sql_context: CREATE TABLE diversification (id INT, effort VARCHAR(50), budget FLOAT); CREATE TABLE
|
104 |
budget (diversification_id INT, diversification_effort VARCHAR(50), amount FLOAT);"""
|
105 |
|
106 |
-
sql =
|
107 |
|
108 |
print(sql)
|
109 |
```
|
|
|
92 |
|
93 |
# Load model directly
|
94 |
```python
|
95 |
+
# Use a pipeline as a high-level helper
|
96 |
+
from transformers import pipeline
|
97 |
|
98 |
+
sql_generator = pipeline("text2text-generation", model="SwastikM/bart-large-nl2sql")
|
99 |
|
|
|
100 |
|
101 |
query_question_with_context = """sql_prompt: Which economic diversification efforts in
|
102 |
the 'diversification' table have a higher budget than the average budget for all economic diversification efforts in the 'budget' table?
|
103 |
sql_context: CREATE TABLE diversification (id INT, effort VARCHAR(50), budget FLOAT); CREATE TABLE
|
104 |
budget (diversification_id INT, diversification_effort VARCHAR(50), amount FLOAT);"""
|
105 |
|
106 |
+
sql = sql_generator(text)[0]['generated_text']
|
107 |
|
108 |
print(sql)
|
109 |
```
|