mlnsio/text2sql
0
1import replicate2 3 4class Text2SQLModel:5 """6 A class representing a Text-to-SQL model for generating SQL queries from LLM.7 """8 9 def __init__(self):10 pass11 12 def load_model(self):13 """Loads the machine learning model for Text-to-SQL processing."""14 pass15 16 def generate_query(self, prompt):17 output = replicate.run(18 "ns-dev-sentience/sqlcoder:18bcabd866a64547daf3c6044cdebbd47a1f489571110087b80722848eb09398",19 input={"prompt": prompt},20 )21 return (22 output.split("```PostgresSQL")[-1].split("```")[0].split(";")[0].strip()23 + ";"24 )25 