Update README.md
Browse files
README.md
CHANGED
@@ -41,6 +41,11 @@ T5-SQL-Translator is a fine-tuned version of the Google T5-small model, speciali
|
|
41 |
```
|
42 |
## Inference
|
43 |
```python
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
def translate_to_sql_select(english_query):
|
46 |
input_text = "translate English to SQL: "english_query
|
@@ -52,7 +57,7 @@ def translate_to_sql_select(english_query):
|
|
52 |
# Example usage
|
53 |
english_query = "Show all employees with salary greater than $50000"
|
54 |
sql_query = translate_to_sql_select(english_query)
|
55 |
-
print("SQL
|
56 |
```
|
57 |
|
58 |
|
|
|
41 |
```
|
42 |
## Inference
|
43 |
```python
|
44 |
+
# Load model directly
|
45 |
+
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
46 |
+
|
47 |
+
tokenizer = AutoTokenizer.from_pretrained("suriya7/t5-base-text-to-sql")
|
48 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("suriya7/t5-base-text-to-sql")
|
49 |
|
50 |
def translate_to_sql_select(english_query):
|
51 |
input_text = "translate English to SQL: "english_query
|
|
|
57 |
# Example usage
|
58 |
english_query = "Show all employees with salary greater than $50000"
|
59 |
sql_query = translate_to_sql_select(english_query)
|
60 |
+
print("SQL Query:", sql_query)
|
61 |
```
|
62 |
|
63 |
|