Update README.md
Browse files
README.md
CHANGED
|
@@ -101,8 +101,30 @@ responses = generator.generate_and_save_results(
|
|
| 101 |
print(responses)
|
| 102 |
```
|
| 103 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
You can also fine-tune Prem-1B-SQL using HuggingFace Transformers and with [PremSQL Tuners](https://docs.premai.io/premsql/tuners) as well.
|
| 105 |
-
Please [check out our documentation](https://docs.premai.io/premsql) to know about more about PremSQL and all the features
|
| 106 |
we provide.
|
| 107 |
|
| 108 |
|
|
|
|
| 101 |
print(responses)
|
| 102 |
```
|
| 103 |
|
| 104 |
+
### Using Execution guided Decoding
|
| 105 |
+
|
| 106 |
+
This strategy executes the generated SQL against the DB and, if it fails, uses the error message for correction, repeating until it gets a valid result or the retries run out.
|
| 107 |
+
|
| 108 |
+
|
| 109 |
+

|
| 110 |
+
|
| 111 |
+
```python
|
| 112 |
+
from premsql.executors import SQLiteExecutor
|
| 113 |
+
|
| 114 |
+
executor = SQLiteExecutor()
|
| 115 |
+
response = generator.generate_and_save_results(
|
| 116 |
+
dataset=bird_dataset,
|
| 117 |
+
temperature=0.1,
|
| 118 |
+
max_new_tokens=256,
|
| 119 |
+
force=True,
|
| 120 |
+
executor=executor,
|
| 121 |
+
max_retries=5 # this is optional (default is already set to 5)
|
| 122 |
+
)
|
| 123 |
+
```
|
| 124 |
+
|
| 125 |
+
|
| 126 |
You can also fine-tune Prem-1B-SQL using HuggingFace Transformers and with [PremSQL Tuners](https://docs.premai.io/premsql/tuners) as well.
|
| 127 |
+
Please [check out our documentation](https://docs.premai.io/premsql/introduction) to know about more about PremSQL and all the features
|
| 128 |
we provide.
|
| 129 |
|
| 130 |
|