Commit
·
d38e8bf
1
Parent(s):
26ce881
Update README.md
Browse files
README.md
CHANGED
@@ -5,10 +5,10 @@ from transformers import BartTokenizer, BartForConditionalGeneration, BartConfig
|
|
5 |
model = BartForConditionalGeneration.from_pretrained('shahrukhx01/distilbart-cnn-12-6-text2sql')
|
6 |
tokenizer = BartTokenizer.from_pretrained('shahrukhx01/distilbart-cnn-12-6-text2sql')
|
7 |
|
8 |
-
|
9 |
-
inputs = tokenizer([
|
10 |
|
11 |
-
# Generate
|
12 |
-
|
13 |
-
print([tokenizer.decode(g, skip_special_tokens=True, clean_up_tokenization_spaces=False) for g in
|
14 |
```
|
|
|
5 |
model = BartForConditionalGeneration.from_pretrained('shahrukhx01/distilbart-cnn-12-6-text2sql')
|
6 |
tokenizer = BartTokenizer.from_pretrained('shahrukhx01/distilbart-cnn-12-6-text2sql')
|
7 |
|
8 |
+
TEXT_QUERY = "what is the temperature of berlin "
|
9 |
+
inputs = tokenizer([TEXT_QUERY], max_length=1024, return_tensors='pt')
|
10 |
|
11 |
+
# Generate SQL
|
12 |
+
text_query_ids = model.generate(inputs['input_ids'], num_beams=4, max_length=5, early_stopping=True)
|
13 |
+
print([tokenizer.decode(g, skip_special_tokens=True, clean_up_tokenization_spaces=False) for g in text_query_ids])
|
14 |
```
|