dbernsohn commited on
Commit
7eb6316
·
1 Parent(s): 5ce0610

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +8 -8
README.md CHANGED
@@ -1,26 +1,26 @@
1
  # t5_wikisql_SQL2en
2
 
3
- This is the checkpoint for [t5_wikisql_SQL2en](https://huggingface.co/dbernsohn/t5_wikisql_SQL2en) after being fine-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
  # t5_wikisql_SQL2en
2
 
3
+ This is t5_wikisql_SQL2en , a t5-small fine-tuned version on the wikisql dataset.
4
 
5
  The model can be loaded like so:
6
 
7
  ```python
8
+ from transformers import AutoTokenizer, AutoModelWithLMHead
9
+ tokenizer = AutoTokenizer.from_pretrained("dbernsohn/t5_wikisql_SQL2en")
10
+ model = AutoModelWithLMHead.from_pretrained("dbernsohn/t5_wikisql_SQL2en")
 
11
  ```
12
 
13
  You can then use this model to translate SQL queries into plain english.
14
 
15
  ```python
16
+ query = "SELECT COUNT Params from model where location=HF-Hub"
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'].cuda(),
21
+ attention_mask=features['attention_mask'].cuda())
22
 
23
  tokenizer.decode(output[0])
24
  ```
25
 
26
+ The whole training process and hyperparameters are in my [GitHub repo] (https://github.com/DorBernsohn)