txtsql / app.py
davidmezzetti's picture
Create app.py
29622e1
raw
history blame
276 Bytes
import streamlit as st
from transformers import pipeline
query = st.text_input("Query")
nlp = pipeline("text2text-generation", model="t5-small-txtsql")
text = nlp(f"translate English to SQL: {query}", max_length=512)[0]["generated_text"]
st.write(text.replace("$=", "<="))