Views
No views yet
t5-large1from transformers import T5Tokenizer, T5ForConditionalGeneration
2
3# Load model and tokenizer
4model_name = "ThotaBhanu/t5_sql_askdb"
5tokenizer = T5Tokenizer.from_pretrained(model_name)
6model = T5ForConditionalGeneration.from_pretrained(model_name)
7
8# Function to convert query to SQL
9def generate_sql(query):
10 input_text = f"Convert to SQL: {query}"
11 inputs = tokenizer(input_text, return_tensors="pt")
12 output = model.generate(**inputs)
13 return tokenizer.decode(output[0], skip_special_tokens=True)
14
15# Example usage
16query = "Find all employees who joined in 2020"
17sql_query = generate_sql(query)
18
19print(f"📝 Query: {query}")
20print(f"🛠 Generated SQL: {sql_query}")
21
22
23## Training Details
24
25### Training Data
26
27Dataset: WikiSQL
28Size: 80,654 pairs of natural language questions and SQL queries
29Preprocessing: Tokenization using T5Tokenizer, max length 128
30
31
32### Training Procedure
33
34Training framework: Hugging Face Transformers + PyTorch
35Hardware used: NVIDIA V100 GPU
36Optimizer: AdamW
37Learning rate: 5e-5
38Batch size: 8
39Epochs: 5
40
41#### Training Hyperparameters
42
43Training precision: Mixed precision (fp16)
44Gradient accumulation: Yes (to handle large batch sizes)
45
46#### Speeds, Sizes, Times [optional]
47
48<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
49
50[More Information Needed]
51
52## Evaluation
53
54<!-- This section describes the evaluation protocols and provides the results. -->
55
56### Testing Data, Factors & Metrics
57
58#### Testing Data
59
60<!-- This should link to a Dataset Card if possible. -->
61
62[More Information Needed]
63
64#### Factors
65
66<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
67
68[More Information Needed]
69
70#### Metrics
71
72<!-- These are the evaluation metrics being used, ideally with a description of why. -->
73
74[More Information Needed]
75
76### Results
77
78[More Information Needed]
79
80#### Summary
81
82
83
84## Model Examination [optional]
85
86<!-- Relevant interpretability work for the model goes here -->
87
88[More Information Needed]
89
90## Environmental Impact
91
92<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
93
94Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
95
96- **Hardware Type:** [More Information Needed]
97- **Hours used:** [More Information Needed]
98- **Cloud Provider:** [More Information Needed]
99- **Compute Region:** [More Information Needed]
100- **Carbon Emitted:** [More Information Needed]
101
102## Technical Specifications [optional]
103
104### Model Architecture and Objective
105
106[More Information Needed]
107
108### Compute Infrastructure
109
110[More Information Needed]
111
112#### Hardware
113
114[More Information Needed]
115
116#### Software
117
118[More Information Needed]
119
120## Citation [optional]
121
122@misc{t5_sql_askdb,
123 author = {Bhanu Prasad Thota},
124 title = {T5-SQL AskDB Model},
125 year = {2025},
126 publisher = {Hugging Face},
127 howpublished = {\url{https://huggingface.co/ThotaBhanu/t5_sql_askdb}}
128}
129
130
131**BibTeX:**
132
133[More Information Needed]
134
135**APA:**
136
137[More Information Needed]
138
139## Glossary [optional]
140
141<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
142
143[More Information Needed]
144
145## More Information [optional]
146
147[More Information Needed]
148
149## Model Card Authors [optional]
150
151[More Information Needed]
152
153## Model Card Contact
154
155[More Information Needed]