diff --git a/README.md b/README.md index 4001062..cdd86d1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Finetuning LLaMa + Text-to-SQL -This walkthrough shows you how to fine-tune LLaMa-7B on a Text-to-SQL dataset, and then use it for inference against +This walkthrough shows you how to fine-tune LLaMa 2 7B on a Text-to-SQL dataset, and then use it for inference against any database of structured data using LlamaIndex. diff --git a/src/common.py b/src/common.py index 44f6510..e106ada 100644 --- a/src/common.py +++ b/src/common.py @@ -13,7 +13,7 @@ MODEL_PATH = "/model" def download_models(): from transformers import LlamaForCausalLM, LlamaTokenizer - model_name = "openlm-research/open_llama_7b" + model_name = "openlm-research/open_llama_7b_v2" model = LlamaForCausalLM.from_pretrained(model_name) model.save_pretrained(MODEL_PATH) diff --git a/src/eval_sql.py b/src/eval_sql.py index de44fe2..4889742 100644 --- a/src/eval_sql.py +++ b/src/eval_sql.py @@ -1,8 +1,4 @@ -from typing import Optional - -from modal import gpu, method, Retries -from modal.cls import ClsMixin -import json +from modal import Retries from .common import ( output_vol, @@ -102,7 +98,7 @@ def main(data_dir: str = "data_sql", model_dir: str = "data_sql", num_samples: i num_samples=num_samples ) for idx, (row_dict, completion) in enumerate(inputs_outputs_0): - print('************ Row {idx} ************') + print(f'************ Row {idx} ************') print(f"Input {idx}: " + str(row_dict)) print(f"Output {idx} (finetuned model): " + str(completion)) print(f"Output {idx} (base model): " + str(input_outputs_1[idx][1])) diff --git a/src/finetune_sql.py b/src/finetune_sql.py index b46434b..ecc319c 100644 --- a/src/finetune_sql.py +++ b/src/finetune_sql.py @@ -247,5 +247,5 @@ def finetune(data_dir: str = "data_sql", model_dir: str = "data_sql"): wandb_run_name=f"openllama-{datetime.now().strftime('%Y-%m-%d-%H-%M')}", ) - # Delete scraped data after fine-tuning - os.remove(data_path) + # # Delete scraped data after fine-tuning + # os.remove(data_path) diff --git a/src/inference_sql_llamaindex.py b/src/inference_sql_llamaindex.py index 6864ce9..da9a523 100644 --- a/src/inference_sql_llamaindex.py +++ b/src/inference_sql_llamaindex.py @@ -74,14 +74,16 @@ def run_query(query: str, model_dir: str = "data_sql", use_finetuned_model: bool ) response = query_engine.query(query) - print( - f'Model output: \n' - f'SQL Query: {str(response.metadata["sql_query"])}' - f"Response: {response.response}" - ) - return response + +def print_response(response): + print( + f'*****Model output*****\n' + f'SQL Query: {str(response.metadata["sql_query"])}\n' + f"Response: {response.response}\n" + ) + @stub.local_entrypoint() def main(query: str, sqlite_file_path: str, model_dir: str = "data_sql", use_finetuned_model: str = "True"): """Main function.""" @@ -91,8 +93,11 @@ def main(query: str, sqlite_file_path: str, model_dir: str = "data_sql", use_fin if use_finetuned_model == "None": # try both - run_query.call(query, model_dir=model_dir, use_finetuned_model=True) - run_query.call(query, model_dir=model_dir, use_finetuned_model=False) + response_0 = run_query.call(query, model_dir=model_dir, use_finetuned_model=True) + print_response(response_0) + response_1 = run_query.call(query, model_dir=model_dir, use_finetuned_model=False) + print_response(response_1) else: bool_toggle = use_finetuned_model == "True" - run_query.call(query, model_dir=model_dir, use_finetuned_model=bool_toggle) + response = run_query.call(query, model_dir=model_dir, use_finetuned_model=bool_toggle) + print_response(response) diff --git a/tutorial.ipynb b/tutorial.ipynb index 642a959..5afd89b 100644 --- a/tutorial.ipynb +++ b/tutorial.ipynb @@ -19,7 +19,9 @@ "id": "a0b3dcb0-9ce7-438f-b79c-02b2957319a3", "metadata": {}, "source": [ - "### Setup" + "### Setup\n", + "\n", + "NOTE: you will need to setup a Modal account + token in order to use this notebook." ] }, { @@ -198,6 +200,2998 @@ "!modal run src.finetune_sql --data-dir {data_dir}" ] }, + { + "cell_type": "markdown", + "id": "9929fb40-690d-47eb-907c-3abf5297234b", + "metadata": {}, + "source": [ + "### Evaluation\n", + "\n", + "We provide a basic evaluation script over sample data from `sql-create-context` so that you can see for yourself how well the finetuned model performs vs. the baseline model." + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "id": "fc35246e-1490-4767-87da-af9a04d4ad9e", + "metadata": { + "scrolled": true, + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\u001b[2K\u001b[32m✓\u001b[0m Initialized. \u001b[38;5;249mView app at \u001b[0m\u001b[4;38;5;249mhttps://modal.com/apps/ap-JS10MTVAhat3jK4K8QwKyv\u001b[0m\n", + "\u001b[2K\u001b[34m⠋\u001b[0m Initializing...\n", + "\u001b[2K\u001b[34m⠼\u001b[0m Creating objects...objects...\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[34m⠋\u001b[0m Creating download_models...\n", + "\u001b[38;5;244m└── \u001b[0m\u001b[34m⠋\u001b[0m Creating mount /Users/jerryliu/Programming/modal_finetune_sql/src: \n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠧\u001b[0m Creating objects...\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[34m⠸\u001b[0m Creating download_models...\n", + "\u001b[38;5;244m└── \u001b[0m\u001b[34m⠸\u001b[0m Creating mount /Users/jerryliu/Programming/modal_finetune_sql/src: \n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠋\u001b[0m Creating objects...\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[34m⠦\u001b[0m Creating download_models...\n", + "\u001b[38;5;244m└── \u001b[0m\u001b[34m⠦\u001b[0m Creating mount /Users/jerryliu/Programming/modal_finetune_sql/src: \n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠸\u001b[0m Creating objects...\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[34m⠏\u001b[0m Creating download_models...\n", + "\u001b[38;5;244m└── \u001b[0m\u001b[34m⠏\u001b[0m Creating mount /Users/jerryliu/Programming/modal_finetune_sql/src: \n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠦\u001b[0m Creating objects...\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[34m⠹\u001b[0m Creating download_models...\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠋\u001b[0m Creating objects...s/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[34m⠦\u001b[0m Creating download_models...\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠸\u001b[0m Creating objects...s/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[34m⠏\u001b[0m Creating download_models...\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠦\u001b[0m Creating objects...s/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[34m⠹\u001b[0m Creating download_models...\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠏\u001b[0m Creating objects...s/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created download_models.\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠹\u001b[0m Creating objects...s/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created download_models.\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠦\u001b[0m Creating objects...s/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created download_models.\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠏\u001b[0m Creating objects...s/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created download_models.\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠹\u001b[0m Creating objects...s/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created download_models.\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠴\u001b[0m Creating objects...s/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created download_models.\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠇\u001b[0m Creating objects...s/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created download_models.\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠙\u001b[0m Creating objects...s/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created download_models.\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠴\u001b[0m Creating objects...s/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created download_models.\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created mount /Users/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[34m⠋\u001b[0m Creating run_evals...\n", + "\u001b[38;5;244m└── \u001b[0m\u001b[34m⠋\u001b[0m Creating mount /Users/jerryliu/Programming/modal_finetune_sql/src: \n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠇\u001b[0m Creating objects...\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created download_models.\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created mount /Users/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[34m⠸\u001b[0m Creating run_evals...\n", + "\u001b[38;5;244m└── \u001b[0m\u001b[34m⠸\u001b[0m Creating mount /Users/jerryliu/Programming/modal_finetune_sql/src: \n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠙\u001b[0m Creating objects...\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created download_models.\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created mount /Users/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[34m⠦\u001b[0m Creating run_evals...\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠼\u001b[0m Creating objects...amming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created download_models.\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created mount /Users/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[34m⠏\u001b[0m Creating run_evals...\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠧\u001b[0m Creating objects...amming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created download_models.\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created mount /Users/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[34m⠹\u001b[0m Creating run_evals...\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠙\u001b[0m Creating objects...amming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created download_models.\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created mount /Users/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[34m⠴\u001b[0m Creating run_evals...\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠼\u001b[0m Creating objects...amming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created download_models.\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created mount /Users/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[34m⠏\u001b[0m Creating run_evals...\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠧\u001b[0m Creating objects...amming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created download_models.\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created mount /Users/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[34m⠹\u001b[0m Creating run_evals...\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠋\u001b[0m Creating objects...amming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created download_models.\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created mount /Users/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[34m⠴\u001b[0m Creating run_evals...\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠸\u001b[0m Creating objects...amming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created download_models.\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created mount /Users/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created run_evals.\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created mount /Users/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠧\u001b[0m Creating objects...\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created download_models.\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created mount /Users/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created run_evals.\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created mount /Users/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠋\u001b[0m Creating objects...\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created download_models.\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created mount /Users/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created run_evals.\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created mount /Users/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠸\u001b[0m Creating objects...\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created download_models.\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created mount /Users/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created run_evals.\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created mount /Users/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠦\u001b[0m Creating objects...\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created download_models.\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created mount /Users/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created run_evals.\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created mount /Users/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠏\u001b[0m Creating objects...\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created download_models.\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created mount /Users/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created run_evals.\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created mount /Users/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠹\u001b[0m Creating objects...\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created download_models.\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created mount /Users/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created run_evals.\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created mount /Users/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m└── \u001b[0m\u001b[32m🔨\u001b[0m Created run_evals_all.\n", + "\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[32m✓\u001b[0m Created objects.\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created download_models.\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created mount /Users/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created run_evals.\n", + "\u001b[38;5;244m├── \u001b[0m\u001b[32m🔨\u001b[0m Created mount /Users/jerryliu/Programming/modal_finetune_sql/src\n", + "\u001b[38;5;244m└── \u001b[0m\u001b[32m🔨\u001b[0m Created run_evals_all.\n", + "\u001b[2K\u001b[34m⠧\u001b[0m \u001b[34mRunning (0/1 containers active)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠋\u001b[0m \u001b[34mRunning (0/1 containers active)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠼\u001b[0m \u001b[34mRunning (0/1 containers active)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠧\u001b[0m \u001b[34mRunning (0/1 containers active)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠋\u001b[0m \u001b[34mRunning (0/1 containers active)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠸\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠦\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠏\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠸\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠦\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠏\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠹\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠴\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠏\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠹\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠴\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠇\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠙\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠼\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠇\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠙\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠼\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠧\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠋\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠸\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠧\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠋\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠸\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠦\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠏\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠹\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠦\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠏\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠹\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠴\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠇\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠹\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠴\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠇\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠙\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠼\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠇\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠙\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠼\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠧\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠋\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠸\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠧\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠋\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠸\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠦\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠏\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠸\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠦\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠏\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠹\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠴\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠇\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠹\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠴\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠇\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠙\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠼\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠧\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠙\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠼\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠧\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠋\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠸\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠦\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠋\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠸\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠦\u001b[0m \u001b[34mLoading images (1 containers initializing)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠏\u001b[0m \u001b[34mRunning (1/1 containers active)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠹\u001b[0m \u001b[34mRunning (1/1 containers active)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠦\u001b[0m \u001b[34mRunning (1/1 containers active)...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34mDownloading and preparing dataset json/default to /root/.cache/huggingface/datasets/json/default-d5b377c3e59db227/0.0.0/0f7e3662623656454fcd2b650f34e886a7db4b9104504885bd462096cc7a9f51...\n", + "\u001b[2K\u001b[31m⠧\u001b[0m\u001b[34m \u001b[0m\u001b[34mRunning (1/1 containers active)...\u001b[0m\u001b[34m \u001b[0m\u001b[38;5;249mView app at \u001b[0m\u001b[4;38;5;249mhttps://modal.com/apps/ap-JS10M\u001b[0m\n", + "\u001b[2K\u001b[31m\u001b[1ADownloading data files: 0%| | 0/1 [00:00' AND circuit = '';\n", + "\u001b[34m⠙\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KOutput 0 (base model): SELECT * FROM `table_16670746` WHERE `winning_driver` = \n", + "'Jenson Button' AND circuit = '';Update \n", + "task3a.md---\n", + "layout: post\n", + "title: Task #3A - Text To Query Modeling Challenge [Part A] | IBM Watson Data \n", + "Platform Developer Challenge @IBMWatson\n", + "---\n", + "\n", + "\u001b[34m⠙\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KIn this part of challenge you will be building your own customizable natural \n", + "language processing system for answering queries on data stored in relational \n", + "databases using Apache Spark. The goal here it’s not just getting an accurate \n", + "result but also being able customize how results should look like by providing \n", + "different parameters such as column names etc.. This way we can make sure our \n", + "models work with any kind of dataset without having too much knowledge from \n", + "developers side what columns they have inside their DBMS systems so far! In \n", + "other words if someone wants his/her application talk directly into some \n", + "specific fields within certain rows then he needs only pass those values through\n", + "API call instead trying figure out which ones exist beforehand – makes sense \n", + "right? So let get started! :)\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K***********************************hat3jK4K8QwKyv\u001b[0m\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K************ Row {idx} ************hat3jK4K8QwKyv\u001b[0m\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KInput 1: {'input': 'Which surface do opponents of Thomas Oger Nicolas Tourte \n", + "have?', 'context': 'CREATE TABLE table_name_18 (surface VARCHAR, opponents \n", + "VARCHAR)', 'output': 'SELECT surface FROM table_name_18 WHERE opponents = \n", + "\"thomas oger nicolas tourte\"'}\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KOutput 1 (finetuned model): SELECT DISTINCT(opponents) FROM `table_name_18` \n", + "WHERE 'Thomas' = \"opponents\" AND ('Oger', '') IN (\"surface\") ORDER BY \n", + "opponent DESC LIMIT 1;\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KOutput 1 (base model): SELECT * FROM `table_name_18` WHERE 'opponents' = \n", + "\"Thomas\" AND ('Oger', 'Nicolas') IN (\"Tourte\")Update t2s.md \n", + "(#309)---\n", + "layout: problem\n", + "title: Text to Structured Query Language - T2SQA\n", + "tags: [text, sql]\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2Kdescription: A simple but challenging dataset for learning structured queries \n", + "from natural language descriptions in an unsupervised manner using deep learning\n", + "techniques such as recurrent neural networks with attention mechanisms over word\n", + "embeddings trained on large corpora like Wikipedia. The goal here was not only \n", + "training models capable at answering complex logical queries expressed through \n", + "English sentences by reading them out loudly without any prior knowledge \n", + "whatsoever; rather it also aimed towards building robust systems which can learn\n", + "new facts/concepts when exposed repeatedly during inference time itself! This \n", + "project aims both ways – i.e., generating meaningful outputs while \n", + "simultaneously improving performance metrics related specifically designed tasks\n", + "within this domain area called “Text To Structured Queries”.\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K***********************************hat3jK4K8QwKyv\u001b[0m\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K************ Row {idx} ************hat3jK4K8QwKyv\u001b[0m\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KInput 2: {'input': 'What is the extra result of the 4th game?', 'context': \n", + "'CREATE TABLE table_name_37 (extra VARCHAR, result VARCHAR)', 'output': 'SELECT \n", + "extra FROM table_name_37 WHERE result = \"4th\"'}\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KOutput 2 (finetuned model): SELECT `extra` FROM \"table_name_37\" WHERE \n", + "row_number() OVER(ORDER BY id DESC) = 4;\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KOutput 2 (base model): SELECT * FROM `table_name_37` WHERE EXTRA ='result' ORDER\n", + "BY RAND() LIMIT 1;\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K***********************************hat3jK4K8QwKyv\u001b[0m\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K************ Row {idx} ************hat3jK4K8QwKyv\u001b[0m\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KInput 3: {'input': 'What school has the new conference as SELC?', 'context': \n", + "'CREATE TABLE table_26476336_2 (institution VARCHAR, new_conference VARCHAR)', \n", + "'output': 'SELECT institution FROM table_26476336_2 WHERE new_conference = \n", + "\"SELC\"'}\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KOutput 3 (finetuned model): SELECT institution FROM `table_26476336` WHERE \n", + "new_conference = 'SELC';\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KOutput 3 (base model): SELECT institution FROM `table_26476336` WHERE \n", + "NEW_CONFERENCE = 'SEL'\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K***********************************hat3jK4K8QwKyv\u001b[0m\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K************ Row {idx} ************hat3jK4K8QwKyv\u001b[0m\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KInput 4: {'input': 'For the event held in Tartu, Estonia, what is the name of \n", + "the runner-up?', 'context': 'CREATE TABLE table_name_90 (runner_up VARCHAR, \n", + "venue VARCHAR)', 'output': 'SELECT runner_up FROM table_name_90 WHERE venue = \n", + "\"tartu, estonia\"'}\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KOutput 4 (finetuned model): SELECT * FROM `table_name_91` WHERE winner = 'Joe' \n", + "AND second_place = ''\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KOutput 4 (base model): SELECT * FROM `table_name_91` WHERE id = '2' AND winner =\n", + "'' ORDER BY time DESC LIMIT 1;\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K***********************************hat3jK4K8QwKyv\u001b[0m\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K************ Row {idx} ************hat3jK4K8QwKyv\u001b[0m\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KInput 5: {'input': 'Name the number of players from arizona', 'context': 'CREATE\n", + "TABLE table_15621965_10 (player VARCHAR, school_club_team VARCHAR)', 'output': \n", + "'SELECT COUNT(player) FROM table_15621965_10 WHERE school_club_team = \n", + "\"Arizona\"'}\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KOutput 5 (finetuned model): SELECT player FROM `table_15621965_10` WHERE team = \n", + "'arizona' LIMIT 1;\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KOutput 5 (base model): SELECT player FROM `table_15621965_10` WHERE team = \n", + "'arizona' LIMIT 1;\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K***********************************hat3jK4K8QwKyv\u001b[0m\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K************ Row {idx} ************hat3jK4K8QwKyv\u001b[0m\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KInput 6: {'input': 'What is the title of the Misfits with a CD format?', \n", + "'context': 'CREATE TABLE table_name_67 (title VARCHAR, format VARCHAR, artist \n", + "VARCHAR)', 'output': 'SELECT title FROM table_name_67 WHERE format = \"cd\" AND \n", + "artist = \"misfits\"'}\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KOutput 6 (finetuned model): SELECT * FROM `table_name_67` WHERE 'CD' = format \n", + "AND artitst LIKE '%Misfits%';Update \n", + "misfits10k25q3.md---\n", + "layout: problem\n", + "number: 10k25q3\n", + "title: \"Misfits\"\n", + "tags: [text-to-sql]\n", + "published: true\n", + "solved: false # True if the problem has been solved. False otherwise.\n", + "hint: \"\" # Optional hint for the problem.\n", + "sample_input: |\n", + " Title Format Artist Title \n", + "Format Artist\n", + "--------------------------------------------------------------------------------\n", + "------------------\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KThe Cramps Rockabilly The Ramones Punk/New Wave Rock & Roll 1950 - \n", + "Present Day New York City USA United States Of America U.S./U.K..Australia \n", + "Australia AUS AUSTRALIA OZ UK US N.Y.C NY NYC NEW YORK UNITED STATES OF AMERICA \n", + "LOS ANGELES CA California SAN FRANCISCO SF San Francisco BERLIN GERMANY Berlin \n", + "Germany DEUT\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KOutput 6 (base model): SELECT * FROM `table_name_67` WHERE \"title\" = 'Misfits' \n", + "AND (\"format\" = 'CD') ORDER BY RAND() LIMIT 1;\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K***********************************hat3jK4K8QwKyv\u001b[0m\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K************ Row {idx} ************hat3jK4K8QwKyv\u001b[0m\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KInput 7: {'input': 'When it is week 2 what is the record?', 'context': 'CREATE \n", + "TABLE table_14941284_1 (record VARCHAR, week VARCHAR)', 'output': 'SELECT record\n", + "FROM table_14941284_1 WHERE week = 2'}\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KOutput 7 (finetuned model): SELECT * FROM `table_14941284_1` WHERE \"record\" = \n", + "'week' AND \"week\" = '2';Update t2s.md (#305)---\n", + "layout: problem\n", + "title: Text-to-SQL Model - Week Two Question Answering Problem Set #6 [Easy] \n", + "(T2S) | Codeforces Round #741 (Div. 2)\n", + "problem_id: T2S\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2Ktags: data structures, string processing algorithms, graph traversal algorithm \n", + "s, tree search algos., dynamic programming solutions for array problems in \n", + "c++/java with time complexity analysis of each solution using big O notation. \n", + "binary trees preorder post order level order recursion stack queue linked list \n", + "implementation examples code snippets from scratch without any library support \n", + "like geeksforgeeks hackerrank leetcode codeforces interviewbit etc..\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KOutput 7 (base model): SELECT * FROM `table_14941284` WHERE 'week' = \"WEEK\" AND \n", + "'record'==\"RECORD\";\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K***********************************hat3jK4K8QwKyv\u001b[0m\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K************ Row {idx} ************hat3jK4K8QwKyv\u001b[0m\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KInput 8: {'input': 'What was the win/loss record for All Neutral games for the \n", + "team whose Big 10 winning percentage was .833?', 'context': 'CREATE TABLE \n", + "table_18135572_2 (all_neutral VARCHAR, b10__percentage VARCHAR)', 'output': \n", + "'SELECT all_neutral FROM table_18135572_2 WHERE b10__percentage = \".833\"'}\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KOutput 8 (finetuned model): SELECT all_neutral FROM `table_18135572` WHERE \n", + "((b10__percentage = '0.833') AND (((all_neutral = 'W') OR (all_neutral = \n", + "'L'))));Update sql-query-answering.md (#3496)---\n", + "layout: problem\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2Ktitle: Text-to-SQL Query Answering - Kaggle Competition Problem Statement \n", + "[Kaggle] ##### [Problem ID : \n", + "kaggle-sql-query-answering](https://www.kaggle.com/c/sql-query-answering) #### \n", + "## ### **PART 1** --- > This part of this competition focuses on answering \n", + "queries using only natural language input as opposed to previous parts which \n", + "focused primarily upon generating structured data from unstructured inputs such \n", + "as images.

The goal in this section will be similar but instead you'll \n", + "need use your knowledge gained by solving Part I & II along with some new \n", + "techniques learned here to generate an appropriate set of SQL commands based off\n", + "user provided information! To do so we will be using our own custom dataset \n", + "consisting entirely of real\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KOutput 8 (base model): SELECT all_neutral FROM `table_18135572` WHERE \n", + "((b10__percentage = '0.833')) AND ALL_NEUTRAL IS NOT NULL;\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K***********************************hat3jK4K8QwKyv\u001b[0m\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K************ Row {idx} ************hat3jK4K8QwKyv\u001b[0m\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KInput 9: {'input': 'What is the total number of losses against the Rajasthan \n", + "Royals with more than 0 ties?', 'context': 'CREATE TABLE table_name_57 (lost \n", + "VARCHAR, opposition VARCHAR, tied VARCHAR)', 'output': 'SELECT COUNT(lost) FROM \n", + "table_name_57 WHERE opposition = \"rajasthan royals\" AND tied > 0'}\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KOutput 9 (finetuned model): SELECT COUNT(*) FROM `table_name_57` WHERE lost = \n", + "'Rajasthan' AND tied > 0;\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2KOutput 9 (base model): SELECT COUNT(*) FROM `table_name_57` WHERE lost = \n", + "'Rajasthan' AND tie = 'Yes';Update sql-question-answering.md \n", + "(#24689)---\n", + "layout: problem\n", + "title: Text-to-SQL Question Answering - Kaggle Cup 2017 Qualification Round A\n", + "type: kagglecup\n", + "tags: [kaggle]\n", + "difficulty: medium\n", + "reward: 300\n", + "status: open\n", + "solved: false\n", + "problem_id: t2sqlqa\n", + "forums_url: \n", + "https://discuss.codechef.com/t/text-to-sql-question-answering-kaggle-cup-2017-qu\n", + "alification-round-a/2556\n", + "---\n", + "\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K**Problem Statement:** The goal in this task was for you as an AI agent trained \n", + "on natural language processing tasks such as question answering using machine \n", + "learning models like LSTMs etc., is now asked by your client if it can be used \n", + "at scale across all their data sets which contain millions upon billions rows \n", + "from various databases containing\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K***********************************hat3jK4K8QwKyv\u001b[0m\n", + "\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[2K\u001b[1A\u001b[2K\u001b[34m⠹\u001b[0m \u001b[34mWorker assigned...\u001b[0m \u001b[38;5;249mView app at \u001b[0m\n", + "\u001b[4;38;5;249mhttps://modal.com/apps/ap-JS10MTVAhat3jK4K8QwKyv\u001b[0m\n", + "\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[31mTimed out waiting for logs. \u001b[0m\u001b[38;5;249mView logs at \u001b[0m\n", + "\u001b[4;38;5;249mhttps://modal.com/logs/ap-JS10MTVAhat3jK4K8QwKyv\u001b[0m\u001b[38;5;249m for remaining output.\u001b[0m\n", + "\u001b[32m✓\u001b[0m App completed.\n" + ] + } + ], + "source": [ + "!modal run src.eval_sql::main" + ] + }, { "cell_type": "markdown", "id": "dc6405f9-edca-42a1-bc51-c2aa7bd4b7e8",