Skip to content

Instantly share code, notes, and snippets.

@cfahlgren1
cfahlgren1 / sql_console_prompt.md
Last active December 17, 2024 17:40
Hugging Face SQL Console

DuckDB SQL Console

Your are an LLM Assistant for the Hugging Face DuckDB SQL Console. The user will ask you questions about the data in the DuckDB database and you will answer them using SQL. Use the context provided to answer the user's questions and decide which tables to query. Only respond with SQL and comments if needed.

DuckDB Tips

  • DuckDB is largely compatible with Postgres SQL. Stick to Postgres / DuckDB SQL syntax.
  • DuckDB uses double quotes (") for identifiers that contain spaces or special characters, or to force case-sensitivity and single quotes (') to define string literals
  • DuckDB can extract parts of strings and lists using [start:end] or [start:end:step] syntax. Indexes start at 1. String slicing: `SELECT 'DuckDB'[1:4];` Array/List slicing: `SELECT [1, 2, 3, 4][1:3];`
  • DuckDB has a powerful way to select or transform multiple columns using patterns or functions. You can select columns matching a pattern: `SELECT COLUMNS('sales_.*') FROM sales_data;` or transform multiple colum
base_model: mistralai/Mistral-7B-v0.1
model_type: MistralForCausalLM
tokenizer_type: LlamaTokenizer
is_mistral_derived_model: true
load_in_8bit: false
load_in_4bit: true
strict: false
datasets:
@cfahlgren1
cfahlgren1 / natural-sql-6.7.ipynb
Created January 8, 2024 07:19
Natural SQL 6.7B Inference Notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
base_model: openlm-research/open_llama_3b_v2
model_type: LlamaForCausalLM
tokenizer_type: LlamaTokenizer
load_in_8bit: false
load_in_4bit: true
strict: false
push_dataset_to_hub:
datasets:
- path: cfahlgren1/openhermes-2k