Skip to content

Commit

Permalink
deploy: 7f0c36c
Browse files Browse the repository at this point in the history
  • Loading branch information
lostmygithubaccount committed Oct 6, 2023
1 parent 150d4d5 commit c8654b6
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 64 deletions.
12 changes: 6 additions & 6 deletions posts.html
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ <h1 class="title">Posts</h1>
</div>
</div>
<div class="list grid quarto-listing-cols-3">
<div class="g-col-1" data-index="0" data-categories="LLMs and data" data-listing-date-sort="1697414400000" data-listing-file-modified-sort="1696396422541" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="3" data-listing-word-count-sort="435">
<div class="g-col-1" data-index="0" data-categories="LLMs and data" data-listing-date-sort="1697414400000" data-listing-file-modified-sort="1696622567277" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="3" data-listing-word-count-sort="435">
<a href="./posts/llms-and-data-pt4/index.html" class="quarto-grid-link">
<div class="quarto-grid-item card h-100 card-left">
<p class="card-img-top"><img src="posts/llms-and-data-pt4/images/figure1.png" style="height: 150px;" class="thumbnail-image card-img"/></p>
Expand Down Expand Up @@ -309,7 +309,7 @@ <h5 class="no-anchor card-title listing-title">
</div>
</a>
</div>
<div class="g-col-1" data-index="1" data-categories="LLMs and data" data-listing-date-sort="1697328000000" data-listing-file-modified-sort="1696396422541" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="3" data-listing-word-count-sort="444">
<div class="g-col-1" data-index="1" data-categories="LLMs and data" data-listing-date-sort="1697328000000" data-listing-file-modified-sort="1696622567277" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="3" data-listing-word-count-sort="444">
<a href="./posts/llms-and-data-pt3/index.html" class="quarto-grid-link">
<div class="quarto-grid-item card h-100 card-left">
<p class="card-img-top"><img src="images/logo.png" style="height: 150px;" class="thumbnail-image card-img"/></p>
Expand Down Expand Up @@ -337,13 +337,13 @@ <h5 class="no-anchor card-title listing-title">
</div>
</a>
</div>
<div class="g-col-1" data-index="2" data-categories="LLMs and data" data-listing-date-sort="1697241600000" data-listing-file-modified-sort="1696396422541" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="4" data-listing-word-count-sort="725">
<div class="g-col-1" data-index="2" data-categories="LLMs and data" data-listing-date-sort="1697241600000" data-listing-file-modified-sort="1696622567277" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="4" data-listing-word-count-sort="725">
<a href="./posts/llms-and-data-pt2/index.html" class="quarto-grid-link">
<div class="quarto-grid-item card h-100 card-left">
<p class="card-img-top"><img src="images/logo.png" style="height: 150px;" class="thumbnail-image card-img"/></p>
<div class="card-body post-contents">
<h5 class="no-anchor card-title listing-title">
Context, calls, and computations
Computations and control flow: it’s just programming
</h5>
<div class="listing-categories">
<div class="listing-category" onclick="window.quartoListingCategory('LLMs and data'); return false;">
Expand All @@ -365,7 +365,7 @@ <h5 class="no-anchor card-title listing-title">
</div>
</a>
</div>
<div class="g-col-1" data-index="3" data-categories="LLMs and data" data-listing-date-sort="1697155200000" data-listing-file-modified-sort="1696396422541" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="7" data-listing-word-count-sort="1298">
<div class="g-col-1" data-index="3" data-categories="LLMs and data" data-listing-date-sort="1697155200000" data-listing-file-modified-sort="1696622567277" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="7" data-listing-word-count-sort="1298">
<a href="./posts/llms-and-data-pt1/index.html" class="quarto-grid-link">
<div class="quarto-grid-item card h-100 card-left">
<p class="card-img-top"><img src="images/logo.png" style="height: 150px;" class="thumbnail-image card-img"/></p>
Expand Down Expand Up @@ -393,7 +393,7 @@ <h5 class="no-anchor card-title listing-title">
</div>
</a>
</div>
<div class="g-col-1" data-index="4" data-categories="LLMs and data" data-listing-date-sort="1697068800000" data-listing-file-modified-sort="1696396422541" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="5" data-listing-word-count-sort="822">
<div class="g-col-1" data-index="4" data-categories="LLMs and data" data-listing-date-sort="1697068800000" data-listing-file-modified-sort="1696622567277" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="5" data-listing-word-count-sort="822">
<a href="./posts/llms-and-data-pt0/index.html" class="quarto-grid-link">
<div class="quarto-grid-item card h-100 card-left">
<p class="card-img-top"><img src="images/logo.png" style="height: 150px;" class="thumbnail-image card-img"/></p>
Expand Down
14 changes: 7 additions & 7 deletions posts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ Important
<pubDate>Sun, 15 Oct 2023 00:00:00 GMT</pubDate>
</item>
<item>
<title>Context, calls, and computations</title>
<title>Computations and control flow: it’s just programming</title>
<dc:creator>Cody Peterson</dc:creator>
<link>https://ibis-project.github.io/posts/llms-and-data-pt2/</link>
<description><![CDATA[
Expand All @@ -281,7 +281,7 @@ Important
<h2 class="anchored" data-anchor-id="introduction">Introduction</h2>
<p>The recent Generative AI hype cycle has led to a lot of new terminology to understand. In this post, we’ll cover some key concepts from the groud up and explain the basics of working with LLMs in the context of data.</p>
<p>This post assumes <a href="../llms-and-data-pt0">basic familiarity with Marvin and Ibis</a> and <a href="../llms-and-data-pt1">three approaches to applying LLMs to data</a>.</p>
<div id="7bf65911" class="cell" data-execution_count="1">
<div id="675d651b" class="cell" data-execution_count="1">
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="annotated-cell-1" style="background: #f1f3f5;"><pre class="sourceCode python code-annotation-code code-with-copy code-annotated"><code class="sourceCode python"><button class="code-annotation-anchor" data-target-cell="annotated-cell-1" data-target-annotation="1">1</button><span id="annotated-cell-1-1" class="code-annotation-target"><span class="im" style="color: #00769E;
Expand Down Expand Up @@ -337,7 +337,7 @@ font-style: inherit;">True</span>)</span><div class="code-annotation-gutter-bg">
</div>
</div>
<p>First, we’ll setup Ibis and Marvin with some simple example data:</p>
<div id="acdb1f03" class="cell" data-execution_count="2">
<div id="297c21b2" class="cell" data-execution_count="2">
<div class="sourceCode cell-code" id="annotated-cell-2" style="background: #f1f3f5;"><pre class="sourceCode python code-annotation-code code-with-copy code-annotated"><code class="sourceCode python"><button class="code-annotation-anchor" data-target-cell="annotated-cell-2" data-target-annotation="1">1</button><span id="annotated-cell-2-1" class="code-annotation-target"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> ibis</span>
Expand Down Expand Up @@ -413,7 +413,7 @@ font-style: inherit;">"penguins"</span>)</span><div class="code-annotation-gutte
<h2 class="anchored" data-anchor-id="retrieval-augmented-generation-rag">Retrieval augmented generation (RAG)</h2>
<p>Instead of you typing out context for the bot, we can <strong>retrieve</strong> context from somewhere, <strong>augment</strong> our strings sent to the bot with this context, and then <strong>generate</strong> a response from the bot.</p>
<p>As a contrived example, instead of saying “The capitol of foo is bar”, we can retrieve the capitol of foo from a database, augment it with our context, and then generate a response from the bot. You may notice that <a href="../llms-and-data-pt0">we already did this in the firt post in the series – let’s review that code again</a>:</p>
<div id="a2500d07" class="cell" data-execution_count="3">
<div id="1e60f7bd" class="cell" data-execution_count="3">
<div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> ibis.expr.schema <span class="im" style="color: #00769E;
Expand Down Expand Up @@ -462,15 +462,15 @@ font-style: inherit;">=</span> sql_select(query).strip(<span class="st" style="c
background-color: null;
font-style: inherit;">";"</span>)</span>
<span id="cb1-14">sql</span></code></pre></div>
<div class="cell-output cell-output-display" data-execution_count="7">
<div class="cell-output cell-output-display" data-execution_count="3">
<pre><code>'SELECT DISTINCT species, island FROM penguins'</code></pre>
</div>
</div>
<p>Notice that we <strong>retrieved</strong> the table name and schema with calls to the Ibis table (<code>t.get_name()</code> and <code>t.schema()</code>). We then <strong>augment</strong> our context (the query in natural language) with this information and <strong>generate</strong> a response from the bot.</p>
<p>This works reasonably well for simple SQL queries:</p>
<div id="95337292" class="cell" data-execution_count="4">
<div id="07c59dc8" class="cell" data-execution_count="4">
<div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1">t.sql(sql)</span></code></pre></div>
<div class="cell-output cell-output-display" data-execution_count="8">
<div class="cell-output cell-output-display" data-execution_count="4">
<pre style="white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace">┏━━━━━━━━━━━┳━━━━━━━━━━━┓
┃<span style="font-weight: bold"> species </span>┃<span style="font-weight: bold"> island </span>┃
┡━━━━━━━━━━━╇━━━━━━━━━━━┩
Expand Down
18 changes: 9 additions & 9 deletions posts/llms-and-data-pt2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<meta name="author" content="Cody Peterson">
<meta name="dcterms.date" content="2023-10-14">

<title>Ibis Birdbrain - Context, calls, and computations</title>
<title>Ibis Birdbrain - Computations and control flow: it’s just programming</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
Expand Down Expand Up @@ -107,7 +107,7 @@


<link rel="stylesheet" href="../../styles.css">
<meta name="twitter:title" content="Ibis Birdbrain - Context, calls, and computations">
<meta name="twitter:title" content="Ibis Birdbrain - Computations and control flow: it’s just programming">
<meta name="twitter:description" content="AI for your data project">
<meta name="twitter:card" content="summary">
</head>
Expand Down Expand Up @@ -232,7 +232,7 @@
<header id="title-block-header" class="quarto-title-block default page-columns page-full">
<div class="quarto-title-banner page-columns page-full">
<div class="quarto-title column-body">
<h1 class="title">Context, calls, and computations</h1>
<h1 class="title">Computations and control flow: it’s just programming</h1>
<div class="quarto-categories">
<div class="quarto-category">LLMs and data</div>
</div>
Expand Down Expand Up @@ -289,7 +289,7 @@ <h2 id="toc-title">On this page</h2>
<h2 class="anchored" data-anchor-id="introduction">Introduction</h2>
<p>The recent Generative AI hype cycle has led to a lot of new terminology to understand. In this post, we’ll cover some key concepts from the groud up and explain the basics of working with LLMs in the context of data.</p>
<p>This post assumes <a href="../llms-and-data-pt0">basic familiarity with Marvin and Ibis</a> and <a href="../llms-and-data-pt1">three approaches to applying LLMs to data</a>.</p>
<div id="7bf65911" class="cell" data-execution_count="1">
<div id="675d651b" class="cell" data-execution_count="1">
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="annotated-cell-1"><pre class="sourceCode python code-annotation-code code-with-copy code-annotated"><code class="sourceCode python"><button class="code-annotation-anchor" data-target-cell="annotated-cell-1" data-target-annotation="1">1</button><span id="annotated-cell-1-1" class="code-annotation-target"><a href="#annotated-cell-1-1" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> ibis</span>
Expand Down Expand Up @@ -321,7 +321,7 @@ <h2 class="anchored" data-anchor-id="introduction">Introduction</h2>
</div>
</div>
<p>First, we’ll setup Ibis and Marvin with some simple example data:</p>
<div id="acdb1f03" class="cell" data-execution_count="2">
<div id="297c21b2" class="cell" data-execution_count="2">
<div class="sourceCode cell-code" id="annotated-cell-2"><pre class="sourceCode python code-annotation-code code-with-copy code-annotated"><code class="sourceCode python"><button class="code-annotation-anchor" data-target-cell="annotated-cell-2" data-target-annotation="1">1</button><span id="annotated-cell-2-1" class="code-annotation-target"><a href="#annotated-cell-2-1" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> ibis</span>
<span id="annotated-cell-2-2"><a href="#annotated-cell-2-2" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> marvin</span>
<span id="annotated-cell-2-3"><a href="#annotated-cell-2-3" aria-hidden="true" tabindex="-1"></a></span>
Expand Down Expand Up @@ -367,7 +367,7 @@ <h2 class="anchored" data-anchor-id="computations">Computations</h2>
<h2 class="anchored" data-anchor-id="retrieval-augmented-generation-rag">Retrieval augmented generation (RAG)</h2>
<p>Instead of you typing out context for the bot, we can <strong>retrieve</strong> context from somewhere, <strong>augment</strong> our strings sent to the bot with this context, and then <strong>generate</strong> a response from the bot.</p>
<p>As a contrived example, instead of saying “The capitol of foo is bar”, we can retrieve the capitol of foo from a database, augment it with our context, and then generate a response from the bot. You may notice that <a href="../llms-and-data-pt0">we already did this in the firt post in the series – let’s review that code again</a>:</p>
<div id="a2500d07" class="cell" data-execution_count="3">
<div id="1e60f7bd" class="cell" data-execution_count="3">
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> ibis.expr.schema <span class="im">import</span> Schema</span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> ibis.expr.types.relations <span class="im">import</span> Table</span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a></span>
Expand All @@ -382,15 +382,15 @@ <h2 class="anchored" data-anchor-id="retrieval-augmented-generation-rag">Retriev
<span id="cb1-12"><a href="#cb1-12" aria-hidden="true" tabindex="-1"></a>query <span class="op">=</span> <span class="st">"the unique combination of species and islands"</span></span>
<span id="cb1-13"><a href="#cb1-13" aria-hidden="true" tabindex="-1"></a>sql <span class="op">=</span> sql_select(query).strip(<span class="st">";"</span>)</span>
<span id="cb1-14"><a href="#cb1-14" aria-hidden="true" tabindex="-1"></a>sql</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="7">
<div class="cell-output cell-output-display" data-execution_count="3">
<pre><code>'SELECT DISTINCT species, island FROM penguins'</code></pre>
</div>
</div>
<p>Notice that we <strong>retrieved</strong> the table name and schema with calls to the Ibis table (<code>t.get_name()</code> and <code>t.schema()</code>). We then <strong>augment</strong> our context (the query in natural language) with this information and <strong>generate</strong> a response from the bot.</p>
<p>This works reasonably well for simple SQL queries:</p>
<div id="95337292" class="cell" data-execution_count="4">
<div id="07c59dc8" class="cell" data-execution_count="4">
<div class="sourceCode cell-code" id="cb3"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a>t.sql(sql)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="8">
<div class="cell-output cell-output-display" data-execution_count="4">
<pre style="white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace">┏━━━━━━━━━━━┳━━━━━━━━━━━┓
<span style="font-weight: bold"> species </span><span style="font-weight: bold"> island </span>
┡━━━━━━━━━━━╇━━━━━━━━━━━┩
Expand Down
2 changes: 1 addition & 1 deletion reference/code.html
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ <h1>python_function_to_udf</h1>
<section id="ibis_birdbrain.tools.code.run_python_code" class="level1">
<h1>run_python_code</h1>
<p><code>tools.code.run_python_code(code)</code></p>
<p>Execute Python code as a string and return the output</p>
<p>Execute Python code as a string and return the output and time to run</p>


</section>
Expand Down
6 changes: 0 additions & 6 deletions reference/eda.html
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ <h2 id="toc-title">On this page</h2>

<ul>
<li><a href="#eda" id="toc-eda" class="nav-link active" data-scroll-target="#eda">eda</a></li>
<li><a href="#ibis_birdbrain.tools.eda.query_tables" id="toc-ibis_birdbrain.tools.eda.query_tables" class="nav-link" data-scroll-target="#ibis_birdbrain.tools.eda.query_tables">query_tables</a></li>
<li><a href="#ibis_birdbrain.tools.eda.read_excel_file" id="toc-ibis_birdbrain.tools.eda.read_excel_file" class="nav-link" data-scroll-target="#ibis_birdbrain.tools.eda.read_excel_file">read_excel_file</a></li>
<li><a href="#ibis_birdbrain.tools.eda.read_delta_table" id="toc-ibis_birdbrain.tools.eda.read_delta_table" class="nav-link" data-scroll-target="#ibis_birdbrain.tools.eda.read_delta_table">read_delta_table</a></li>
<li><a href="#ibis_birdbrain.tools.eda.list_tables" id="toc-ibis_birdbrain.tools.eda.list_tables" class="nav-link" data-scroll-target="#ibis_birdbrain.tools.eda.list_tables">list_tables</a></li>
Expand All @@ -214,11 +213,6 @@ <h2 id="toc-title">On this page</h2>
<h1>eda</h1>
<p>EDA tools</p>
</section>
<section id="ibis_birdbrain.tools.eda.query_tables" class="level1">
<h1>query_tables</h1>
<p><code>tools.eda.query_tables(question)</code></p>
<p>Queries the tables in the database to answer the question</p>
</section>
<section id="ibis_birdbrain.tools.eda.read_excel_file" class="level1">
<h1>read_excel_file</h1>
<p><code>tools.eda.read_excel_file(filepath, sheet_name='Sheet1')</code></p>
Expand Down
Loading

0 comments on commit c8654b6

Please sign in to comment.