anindya64 commited on
Commit
dc0e528
·
verified ·
1 Parent(s): fd83f4b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +23 -1
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
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/637b0075806b18943e4ba357/_5rdIQZwyaUFb84xKW_AV.png)
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