Create README.md
Browse filesdef make_inference(instruction):
prompt = f""" You are a powerful text-to-SQL model. Your job is to answer questions about a sqllite database only on the basis of the question's contents. You are given a question and context regarding one or
more tables. You must output the SQL query that answers the question
### question: {instruction}
### context:CREATE TABLE table_28281704_1 (country VARCHAR, city VARCHAR) # in the context , you should describe your schema, field
### answer:"""
inputs = tokenizer(prompt, return_tensors="pt", return_token_type_ids=False).to("cuda:0")
length = int(inputs.input_ids.size(1))
streamer=TextStreamer(tokenizer)
outputs = base_model.generate(**inputs,streamer=streamer, max_new_tokens=350,temperature=0.1, repetition_penalty=1.5, do_sample=False)
generated_text=tokenizer.decode(outputs[0], skip_special_tokens=True).replace("\n\n","")
return generated_text