fokyoum9 commited on
Commit
883b2bf
1 Parent(s): c3a39b2

Create README.md

Browse files

def 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

Files changed (1) hide show
  1. README.md +7 -0
README.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ datasets:
4
+ - b-mc2/sql-create-context
5
+ language:
6
+ - en
7
+ ---