Update README.md
Browse files
README.md
CHANGED
@@ -1,26 +1 @@
|
|
1 |
-
#
|
2 |
-
|
3 |
-
This is the checkpoint for [t5_wikisql_SQL2en](https://huggingface.co/dbernsohn/t5_wikisql_SQL2en) after being fune-tunedon the wikisql dataset on t5-small.
|
4 |
-
|
5 |
-
The model can be loaded like so:
|
6 |
-
|
7 |
-
```python
|
8 |
-
from transformers import AutoModelWithLMHead, AutoTokenizer
|
9 |
-
|
10 |
-
tokenizer = AutoTokenizer.from_pretrained("t5-small")
|
11 |
-
model = AutoModelWithLMHead.from_pretrained("/content/model")
|
12 |
-
```
|
13 |
-
|
14 |
-
You can then use this model to translate SQL queries into plain english.
|
15 |
-
|
16 |
-
```python
|
17 |
-
input_text = f"translate English to SQL: {query} </s>"
|
18 |
-
features = tokenizer([input_text], return_tensors='pt')
|
19 |
-
|
20 |
-
output = model.generate(input_ids=features['input_ids'],
|
21 |
-
attention_mask=features['attention_mask'])
|
22 |
-
|
23 |
-
tokenizer.decode(output[0])
|
24 |
-
```
|
25 |
-
|
26 |
-
The whole training process and hyperparameters are in my []GitHub repo] (https://github.com/DorBernsohn)
|
|
|
1 |
+
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|