From 34f2dd146877d68a6a4287962a15d91b41e08014 Mon Sep 17 00:00:00 2001 From: Rishabh Srivastava Date: Fri, 18 Aug 2023 10:39:37 +0000 Subject: [PATCH] changed metadata.txt to metadata.sql for easier formatting --- inference.py | 4 ++-- metadata.txt => metadata.sql | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) rename metadata.txt => metadata.sql (80%) diff --git a/inference.py b/inference.py index 18689d4..b164dfb 100644 --- a/inference.py +++ b/inference.py @@ -3,7 +3,7 @@ import torch from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline -def generate_prompt(question, prompt_file="prompt.md", metadata_file="metadata.txt"): +def generate_prompt(question, prompt_file="prompt.md", metadata_file="metadata.sql"): with open(prompt_file, "r") as f: prompt = f.read() @@ -27,7 +27,7 @@ def get_tokenizer_model(model_name): ) return tokenizer, model -def run_inference(question, prompt_file="prompt.md", metadata_file="metadata.txt"): +def run_inference(question, prompt_file="prompt.md", metadata_file="metadata.sql"): tokenizer, model = get_tokenizer_model("defog/starcoder-finetune-v3") prompt = generate_prompt(question, prompt_file, metadata_file) diff --git a/metadata.txt b/metadata.sql similarity index 80% rename from metadata.txt rename to metadata.sql index dc58df2..0d45b8f 100644 --- a/metadata.txt +++ b/metadata.sql @@ -32,9 +32,7 @@ CREATE TABLE product_suppliers ( supply_price DECIMAL(10,2) -- Unit price charged by supplier ); -=== -Joinable table/column combinations: -- sales.product_id can be joined with products.product_id -- sales.customer_id can be joined with customers.customer_id -- sales.salesperson_id can be joined with salespeople.salesperson_id -- product_suppliers.product_id can be joined with products.product_id +-- sales.product_id can be joined with products.product_id +-- sales.customer_id can be joined with customers.customer_id +-- sales.salesperson_id can be joined with salespeople.salesperson_id +-- product_suppliers.product_id can be joined with products.product_id