Latest / Talk Python To Me / #410: The Intersection of Tabular Data and Generative AI
Transcript
- 0:00AI has taken the world by storm.
- 0:01It's gone from near zero to amazing in just a few years.
- 0:05We have chat GDP, we have stable diffusion.
- 0:07What about Jupyter Notebooks and Pandas?
- 0:10In this episode, we meet Justin Wagg, the creator of Sketch.
- 0:13Sketch adds the ability to have conversational AI interactions
- 0:18about your Pandas' data frames, code, and data
- 0:21right inside of your notebook.
- 0:23It's pretty powerful, and I know you'll enjoy the conversation.
- 0:26This is Talk Python To Me, episode 410, recorded April 2nd, 2023.
- 0:31Welcome to Talk Python To Me, a weekly podcast on Python.
- 0:47This is your host, Michael Kennedy.
- 0:49Follow me on Mastodon, where I'm @mkennedy,
- 0:52and follow the podcast using @talkpython,
- 0:55both on fosstodon.org.
- 0:57Be careful with impersonating accounts on other instances.
- 0:59There are many.
- 1:00Keep up with the show and listen to over seven years
- 1:03of past episodes at talkpython.fm.
- 1:05We've started streaming most of our episodes live on YouTube.
- 1:09Subscribe to our YouTube channel over at talkpython.fm
- 1:12slash YouTube to get notified about upcoming shows
- 1:15and be part of that episode.
- 1:17This episode is brought to you by Brilliant.org
- 1:20and us with our online courses over at Talk Python Training.
- 1:24Justin, welcome to Talk Python To Me.
- 1:27Thanks for having me.
- 1:28It's great to have you here.
- 1:29I'm a little suspicious.
- 1:30I got to know, I really know how to test
- 1:32whether you're actually Justin or an AI speaking as Justin.
- 1:37What's the deal here?
- 1:40Yeah, there's no way to know now.
- 1:41No, there's not.
- 1:42Well, apparently I've recently learned from you
- 1:44that I can give you a bunch of Xs
- 1:46and other arbitrary characters.
- 1:47This is like the test.
- 1:49It's like asking the Germans to say squirrel
- 1:52in World War II sort of thing.
- 1:54Like it's the test.
- 1:55It's the tell.
- 1:56There's always going to be something.
- 1:58It's some sort of adversarial attack.
- 1:59Exactly.
- 2:01It's only going to get more interesting
- 2:03with this kind of stuff for sure.
- 2:05So we're going to talk about using generative AI
- 2:10and large language models paired with things like Pandas
- 2:13or consumed with straight Python
- 2:15with a couple of your projects,
- 2:16which are super exciting.
- 2:18I think it's going to empower a lot of people
- 2:21in ways that it hasn't really been done yet.
- 2:24So awesome on that.
- 2:25But before we get to it, let's start with your story.
- 2:27How did you get into programming in Python and AI?
- 2:30Let's see.
- 2:30I got into programming in just like when I was a kid,
- 2:34TI-83, learning to code on that.
- 2:36And then sort of just kept it up as a side hobby
- 2:39my whole life.
- 2:40Didn't ever sort of choose it as my career path
- 2:43or anything for a while.
- 2:44It chose you.
- 2:44Yeah, it chose me.
- 2:46It just, I dragged it along with me everywhere.
- 2:47It's just like the toolkit.
- 2:49I got a, went to undergrad
- 2:52and for physics, electrical engineering,
- 2:54then did a physics PhD, experimental physics.
- 2:57During that, I did a lot of non-traditional languages,
- 3:00things like LabVIEW, Igor Pro,
- 3:02just weird Windows, Windows hotkey
- 3:06for like just trying to like automate things.
- 3:08Yeah, sure.
- 3:08So just was sort of dragging that along.
- 3:11But along that path,
- 3:12sort of came across GPUs
- 3:14and used it for accelerating processing,
- 3:16specifically like particle detection.
- 3:17So it was doing some like electron counting
- 3:20in some just detector experiments.
- 3:23Is this like CUDA cores on NVIDIA type thing?
- 3:25Precisely.
- 3:26Stuff like that.
- 3:26Okay.
- 3:27And was that with Python
- 3:28or was that with C++ or what?
- 3:29At the time it was C++
- 3:31and I made like a DLL
- 3:32and then called it from LabVIEW.
- 3:33Wow, that's some crazy integration.
- 3:35It's like drag and drop programming too
- 3:37on the memory GPU.
- 3:39Exactly.
- 3:40It was all over the place.
- 3:41Also had,
- 3:42it was a distributed LabVIEW project.
- 3:43We had multiple machines
- 3:45that were coordinating and doing this
- 3:46all just to move some motors
- 3:49and measure electrons.
- 3:50But it got me into CUDA stuff,
- 3:52which then at the time
- 3:53was around the time
- 3:55that the like AlexNet,
- 3:57some of these like very first neural net stuff
- 3:58was happening.
- 3:59And so those same convolutional kernels
- 4:01were the same exact code
- 4:02that I was trying to write
- 4:03to run like convolutions
- 4:04on these images.
- 4:04And so it's like,
- 4:05oh, look at this like paper.
- 4:06Oh, let me go read it.
- 4:07It seems like it's got so many citations.
- 4:09This is interesting.
- 4:09And then like that sent me down
- 4:11the rabbit hole of like,
- 4:11oh, this AI stuff.
- 4:12Oh, okay.
- 4:13Let me go deep dive into this.
- 4:14And then that just,
- 4:15I'd say that like became
- 4:16the obsession from them.
- 4:18So it's been like eight years
- 4:19of doing that.
- 4:20Then sort of just
- 4:21after I left academia,
- 4:22tried my own startup,
- 4:24then joined multiple others
- 4:26and just sort of have been
- 4:26bouncing around
- 4:27as the sort of like
- 4:29founding engineer,
- 4:30early engineer at startups
- 4:32for a while now.
- 4:32And yeah,
- 4:34Python has been the choice
- 4:35ever since like late grad school
- 4:37and on.
- 4:38I would say it sort of like
- 4:39came through the pandas
- 4:41and NumPy part,
- 4:42but then stuck for the scripting,
- 4:44like just power,
- 4:45just can throw anything together
- 4:46at any time.
- 4:47So it seems like
- 4:48there were two groups
- 4:50that were just
- 4:50hammering GPUs,
- 4:52hammering them,
- 4:53crypto miners
- 4:55and AI people.
- 4:57but the physicists
- 4:58and some of those
- 4:59people doing large scale
- 5:00research like that,
- 5:01they were the OG
- 5:02graphics card users,
- 5:04right?
- 5:04Way before
- 5:05crypto mining existed
- 5:07and really before AI
- 5:08was using graphics cards
- 5:09all that much.
- 5:10When I was like looking
- 5:11at some of the code,
- 5:11like pre-CUDA,
- 5:12there were some like
- 5:13quant traders
- 5:13that were doing
- 5:14some like crazy stuff
- 5:15off of shaders.
- 5:17Like it wasn't even CUDA yet,
- 5:18but it was shaders
- 5:19and they were trying to like
- 5:19extract the compute power
- 5:22out of them from that.
- 5:22So...
- 5:23Look,
- 5:24if we could shave
- 5:24one millisecond off this,
- 5:25we can short them all day,
- 5:27let's do it.
- 5:28But yeah.
- 5:29Yeah.
- 5:29The physicists,
- 5:30I mean,
- 5:31it's always been like,
- 5:32yeah,
- 5:32it's always the get
- 5:33as much compute
- 5:33as you can
- 5:34out of the,
- 5:34you know,
- 5:35devices you have
- 5:35because simulations are slow.
- 5:37Yeah.
- 5:38I remember when I was
- 5:39in grad school
- 5:39studying math,
- 5:40actually senior year,
- 5:41regular college,
- 5:42my bachelor's,
- 5:43the research team
- 5:45that I was on
- 5:45had gotten a used
- 5:47silicon graphics computer
- 5:49for a quarter million dollars
- 5:51and some Onyx workstations
- 5:53that we all were given to.
- 5:54I'm like,
- 5:54this thing is so awesome.
- 5:56A couple years later,
- 5:56like an NVIDIA graphics card
- 5:59and like a simple PC
- 6:00would crush it.
- 6:01Like that's $2,000.
- 6:03It's just,
- 6:03yeah,
- 6:03there's so much power
- 6:04in those things
- 6:05to be able to harness them
- 6:06for whatever,
- 6:07I guess.
- 6:07Yeah.
- 6:07As long as you don't have
- 6:08too much branching,
- 6:09it works really well.
- 6:10Awesome.
- 6:11So let's jump in
- 6:14and start talking about,
- 6:15let's start to talk about
- 6:17ChatGP
- 6:18and some of this AI stuff
- 6:20before we totally get into
- 6:22the projects
- 6:23that you're working on,
- 6:24which brings
- 6:25that type of
- 6:27conversational
- 6:28generative AI
- 6:29to things like Pandas,
- 6:30as you said.
- 6:31But to me,
- 6:33I don't know how,
- 6:34maybe you've been more
- 6:35on the inside than I have,
- 6:36but to me,
- 6:37it looks like
- 6:38AI has been one of those things
- 6:40that's 30 years
- 6:41in the future forever,
- 6:42right?
- 6:42It was like
- 6:43the Turing test
- 6:44and,
- 6:44oh,
- 6:44here's a chat,
- 6:45I'm going to talk to this thing
- 6:46and see if it feels human or not.
- 6:48And then,
- 6:49you know,
- 6:50there was like OCR
- 6:51and then all of a sudden
- 6:53we got self-driving cars,
- 6:55like,
- 6:55wait a minute,
- 6:55that's actually solving
- 6:56real problems.
- 6:57And then we got things
- 6:58like ChatGP
- 6:59where people are like,
- 7:00wait,
- 7:01this can do my job.
- 7:02It seems like it,
- 7:03just in the last couple of years,
- 7:05there's been some inflection point
- 7:07in this world.
- 7:08What do you think?
- 7:09Yeah,
- 7:09I think there's sort of like
- 7:10two key things
- 7:11that have sort of happened
- 7:12in the past,
- 7:12I guess,
- 7:13four or five years,
- 7:14four years,
- 7:15roughly.
- 7:15One is the
- 7:16attention is all you need
- 7:17paper from Google,
- 7:18sort of this transformer
- 7:19architecture came out
- 7:20and it's sort of a good,
- 7:21very hungry model
- 7:23that can just sort of
- 7:23absorb a lot of facts
- 7:24and just like a nice
- 7:26learnable key value store
- 7:27almost that's stuck.
- 7:28So,
- 7:28and then the other thing
- 7:29is,
- 7:30is the GPUs.
- 7:31We were sort of just talking
- 7:31about GPU compute,
- 7:32but this has just been
- 7:34really,
- 7:34GPU compute has really been
- 7:36growing so fast.
- 7:38If you like,
- 7:39look at the like
- 7:39Moore's law equivalent
- 7:40type things,
- 7:41like it's just,
- 7:41it's faster how much
- 7:43we're getting flops
- 7:43out of these things
- 7:44like faster and faster.
- 7:45So,
- 7:45it's been really nice.
- 7:46I mean,
- 7:47obviously there'll be
- 7:47a wall eventually,
- 7:48but it's been good
- 7:50riding this like
- 7:51exponential curve for a bit.
- 7:52Yeah,
- 7:52is the benefit
- 7:53that we're getting
- 7:54from the faster GPUs,
- 7:55is that because
- 7:57people are able
- 7:58to program it better
- 7:59and the frameworks
- 7:59are getting better
- 8:00or because just
- 8:01the raw processing power
- 8:02is getting better?
- 8:03All of the above.
- 8:04Okay.
- 8:04I think that
- 8:05there was a paper
- 8:06that tried to dissect this.
- 8:07I wish I knew
- 8:08the reference,
- 8:08but I believe
- 8:09that their argument
- 8:10was that it was
- 8:11actually more
- 8:11the processing power
- 8:12was getting better.
- 8:13The actual like
- 8:14physical silicon
- 8:14were getting better
- 8:15at making that
- 8:16for specifically
- 8:17this type of stuff.
- 8:17But like
- 8:18on exponentials,
- 8:19but yeah.
- 8:20the power that
- 8:21those things take,
- 8:22I have a gaming system
- 8:24over there
- 8:25and it has a
- 8:26GeForce 2070 Super.
- 8:29I don't know
- 8:29what the Super
- 8:30really gets me,
- 8:31but it's better
- 8:31than the not Super,
- 8:32I guess.
- 8:33Anyway,
- 8:33that one still plugs
- 8:36into the wall normal,
- 8:37but the newer ones,
- 8:39like the 4090s,
- 8:40those things,
- 8:40the amount of power
- 8:42they consume,
- 8:42it's like space heater
- 8:44level of power.
- 8:45Like,
- 8:45I don't know,
- 8:46800 watts or something
- 8:47just for the GPU.
- 8:48You're going to
- 8:50brown out the house
- 8:51if you plug in
- 8:52too many of those.
- 8:53Yeah.
- 8:53Go look at those
- 8:54DGX A100 clusters
- 8:57and they've got
- 8:58like eight of those
- 8:59A100s just stacked
- 9:00right in there.
- 9:00They take really
- 9:02beefy powers of mine.
- 9:03It's built right
- 9:04directly attached
- 9:05to the power plant,
- 9:06electrical power plant.
- 9:08Nuts.
- 9:09Okay,
- 9:09so yeah,
- 9:10so those things
- 9:10are getting really,
- 9:11really massive.
- 9:12Here's the paper
- 9:12Attention is All You Need
- 9:14from Google Research.
- 9:15What was the story of that?
- 9:18How's that play into things?
- 9:19Yeah,
- 9:19so this came up
- 9:21during like machine translation
- 9:22sort of research
- 9:22at Google
- 9:23and the core thing
- 9:26is they present this idea
- 9:28of instead of just stacking
- 9:30these like layers
- 9:31of neural nets
- 9:31like we're sort of used to,
- 9:33they replace the like
- 9:34neural net layer
- 9:35with this concept
- 9:36of a transformer block.
- 9:38A transformer block
- 9:39has this concept inside
- 9:41that's an attention mechanism.
- 9:42The attention mechanism
- 9:44is effectively
- 9:45three matrices
- 9:46that you combine
- 9:48in a specific order
- 9:48and the sort of logic
- 9:50is it
- 9:51is that one of the vectors
- 9:52takes you from some space
- 9:54to keys
- 9:55so it's almost like
- 9:56it's like identifying labels
- 9:57out of your data.
- 9:58Another one is
- 9:59taking you from your data
- 10:01to queries
- 10:01and then it like
- 10:02dot products those
- 10:03to find a weight
- 10:04and then for the one
- 10:05and then another one
- 10:06finds weight values
- 10:08for your things.
- 10:08So it takes this
- 10:09query and key,
- 10:10you get the weights
- 10:11for them
- 10:12and then you take
- 10:13the ones that were
- 10:13sort of the closest
- 10:14to get those values
- 10:15from the third matrix.
- 10:16Just doing it
- 10:18sort of like
- 10:18looks a little bit
- 10:19like accessing an element
- 10:21in a dictionary
- 10:22like key value lookup
- 10:23and it's a differentiable
- 10:26version of that
- 10:26and it did really well
- 10:28on their machine learning
- 10:29sorry,
- 10:29on their machine translation
- 10:31stuff.
- 10:31This was,
- 10:31I think it's
- 10:32like one of the
- 10:33first big one
- 10:34is this BERT model
- 10:35and that paper
- 10:37sort of
- 10:37the architecture
- 10:39of the actual
- 10:40neural net code
- 10:40is effectively
- 10:42unchanged
- 10:43from this
- 10:44to ChatGPT.
- 10:45Like there's
- 10:46a lot of stuff
- 10:46for like
- 10:47milking performance
- 10:48and increasing
- 10:49stability
- 10:50but the actual
- 10:50like core
- 10:51essence of the
- 10:52actual mechanism
- 10:52that drives it
- 10:53it's the same
- 10:54thing since this paper.
- 10:55Interesting.
- 10:55It's funny that
- 10:56Google didn't
- 10:57release something
- 10:57sooner.
- 10:58It's wild
- 11:00that they've had
- 11:00they keep
- 11:01showing off
- 11:02that they've got
- 11:03like equivalent
- 11:04or better things
- 11:05at different times
- 11:05but then not
- 11:06releasing it.
- 11:06When Dolly
- 11:07happened
- 11:08they had Imogen
- 11:08Imagine
- 11:09I guess
- 11:10I don't know
- 11:10how you say it
- 11:11and what was
- 11:12the Party
- 11:13as the two
- 11:13they had two
- 11:14different
- 11:14really good
- 11:15way better
- 11:16than Dolly
- 11:16way better
- 11:17than stable
- 11:17diffusion models
- 11:18like the
- 11:19that had
- 11:19were out
- 11:20and they like
- 11:20showed it
- 11:21demoed it
- 11:21like but
- 11:22never released
- 11:23it to be used
- 11:23so yeah
- 11:25it's one of these
- 11:25who knows
- 11:26what's going to
- 11:26happen with Google
- 11:27if they keep
- 11:28holding on to
- 11:28these things.
- 11:28Yeah well I think
- 11:29there was some
- 11:30hesitation
- 11:30I don't know
- 11:31holds up on
- 11:32accuracy
- 11:33or weird stuff
- 11:34like that.
- 11:34Sure.
- 11:35Yeah now
- 11:37cat's out of the
- 11:37bag now
- 11:38now it's happening.
- 11:38Yeah the cat's
- 11:39out of the bag
- 11:39and people are
- 11:40racing to do
- 11:41the best they
- 11:42can and it's
- 11:43going to have
- 11:44interesting consequences
- 11:45for us both
- 11:46positive and
- 11:47negative I think
- 11:47but you know
- 11:48let's leverage the
- 11:49positive once the
- 11:50cat's out of the
- 11:50bag anyway right?
- 11:51Yeah.
- 11:51Hopefully.
- 11:52Might as well
- 11:52like ask it
- 11:53questions for
- 11:54pandas.
- 11:55so let's play a
- 11:56little bit with
- 11:56chat GDP and
- 11:57maybe another
- 11:58one of these
- 11:58image type
- 12:00things.
- 12:00So I came
- 12:02in here and I
- 12:02stole this example
- 12:03from a blog post
- 12:04that's pretty nice
- 12:05about not using
- 12:06deeply nested
- 12:08codes.
- 12:08You can use a
- 12:09design pattern
- 12:09called a
- 12:11guarding clause
- 12:11that will look
- 12:13and say if the
- 12:14conditions are not
- 12:14right we're going
- 12:15to return early
- 12:16instead of having
- 12:17if something
- 12:18if that also
- 12:19if something else
- 12:20so there's this
- 12:21example that is
- 12:22written in a poor
- 12:23way and it says
- 12:25like it's checking
- 12:25for a platypus
- 12:26so it says if
- 12:27self.ismammal
- 12:29if self.hasfur
- 12:31if self.hasbeak
- 12:32etc.
- 12:32it's all
- 12:34deeply nested
- 12:35and just for people
- 12:36who haven't played
- 12:36with chat GDP
- 12:37like I put that
- 12:38in and I said
- 12:38sure I told her
- 12:39I wanted to call
- 12:40this arrow
- 12:40because it looks
- 12:41like an arrow
- 12:42and it says
- 12:43it tells me a
- 12:44little bit about
- 12:44this so I'm
- 12:45going to ask it
- 12:46please rewrite
- 12:47arrow to be
- 12:49less nested
- 12:51with girding
- 12:52clauses right
- 12:53this is like a
- 12:54machine right
- 12:55if I tell it
- 12:55this what is it
- 12:56going to say
- 12:57let's see
- 12:58it may fail
- 12:59but I think
- 12:59it's going to
- 13:00get it
- 13:00it's thinking
- 13:01I put it
- 13:01I mistakenly
- 13:02put it into
- 13:03chat GDP
- 13:034 which
- 13:04takes longer
- 13:04I might switch
- 13:06it over to
- 13:063 I don't
- 13:06know
- 13:07but the
- 13:08understanding
- 13:09of these
- 13:09things
- 13:10there's a lot
- 13:11of hype
- 13:11about it
- 13:11like I think
- 13:13you kind of
- 13:13agree with me
- 13:14that maybe
- 13:14this hype
- 13:15is worthwhile
- 13:16here we go
- 13:16so look
- 13:18at this
- 13:18it rewrote
- 13:19it said
- 13:20if it's
- 13:20platypus
- 13:21if not
- 13:21self is
- 13:22man
- 13:22will return
- 13:22false
- 13:23if not
- 13:23has fur
- 13:24and there's
- 13:24no more
- 13:25nesting
- 13:25that's pretty
- 13:25cool right
- 13:26yep
- 13:26I mean I'm
- 13:27sure you've
- 13:28you've played
- 13:29with stuff
- 13:29like this
- 13:29right
- 13:29yeah
- 13:30big user
- 13:31of this
- 13:31I mean this
- 13:31is kind
- 13:32of interesting
- 13:32right
- 13:32like it
- 13:33understood
- 13:33there was
- 13:33a structure
- 13:34and it
- 13:34understood
- 13:35what these
- 13:35were
- 13:35and it
- 13:35understood
- 13:36what I
- 13:36said
- 13:36but what's
- 13:37more
- 13:37impressive
- 13:38is like
- 13:38please
- 13:39rewrite
- 13:40the program
- 13:41to check
- 13:42for
- 13:43crocodiles
- 13:45crocodiles
- 13:46and you
- 13:47know it
- 13:48what is it
- 13:49going to do
- 13:49here
- 13:49let's see
- 13:50it says
- 13:51sure no
- 13:51problem
- 13:52writes the
- 13:53function
- 13:53is crocodile
- 13:54if not
- 13:55self.is
- 13:55reptile
- 13:56if not
- 13:57self.has
- 13:57scales
- 13:58if not
- 13:59self.has
- 13:59long snout
- 14:00oh my
- 14:01gosh
- 14:01like it
- 14:03not only
- 14:03remembered
- 14:04oh yeah
- 14:04there's
- 14:05this new
- 14:05version I
- 14:06wrote in
- 14:06the
- 14:06garden
- 14:07clause
- 14:07format
- 14:08but then
- 14:08it
- 14:09rewrote
- 14:09the tests
- 14:10I mean
- 14:11and then
- 14:12it's
- 14:12explaining
- 14:12to me
- 14:13why
- 14:14it wrote
- 14:14it that
- 14:15way
- 14:15it's
- 14:16just
- 14:17it's
- 14:18mind
- 14:18blowing
- 14:18like how
- 14:19how much
- 14:20you can
- 14:21have
- 14:21conversations
- 14:21with this
- 14:22and how
- 14:22much
- 14:22it
- 14:22understands
- 14:23things
- 14:23like
- 14:23code
- 14:24or
- 14:24physics
- 14:25or
- 14:25history
- 14:25what do
- 14:26you think
- 14:26yeah it's
- 14:28really
- 14:28satisfying
- 14:28I love
- 14:29that it's
- 14:30such a
- 14:30powerful
- 14:31generalist
- 14:32at these
- 14:33like things
- 14:33that are found
- 14:34on the
- 14:34internet
- 14:34so if it
- 14:35like if it
- 14:35exists and
- 14:36it's in
- 14:36the training
- 14:36data it
- 14:37can do so
- 14:37good at
- 14:38synthesizing
- 14:39composing
- 14:39bridging
- 14:40between them
- 14:40it's really
- 14:41satisfying
- 14:42so it's
- 14:42really fun
- 14:43asking it
- 14:43to as you're
- 14:44doing rewriting
- 14:44changing
- 14:45language
- 14:45I've been
- 14:46getting into
- 14:47a lot more
- 14:47JavaScript
- 14:47because I'm
- 14:48doing a
- 14:48bunch more
- 14:48like front end
- 14:49stuff and
- 14:49just I
- 14:50sometimes will
- 14:50write a quick
- 14:51one liner in
- 14:51Python
- 14:52that I know
- 14:52how to do
- 14:52with a
- 14:53list
- 14:54comprehension
- 14:54and then I'll
- 14:55be like
- 14:55make this
- 14:55for me
- 14:56in JavaScript
- 14:56because I
- 14:57can't figure
- 14:57out this
- 14:58like how to
- 14:59initialize an
- 14:59array with
- 15:00integers in
- 15:00it
- 15:01it's great
- 15:02for just
- 15:03like really
- 15:03quick spot
- 15:04checks
- 15:04and it also
- 15:05seems to
- 15:05know a lot
- 15:06about like
- 15:06really popular
- 15:07frameworks
- 15:07so you can
- 15:08ask it
- 15:09things that
- 15:09are surprisingly
- 15:10detailed about
- 15:11like a
- 15:11how would you
- 15:12do cores
- 15:13with requests
- 15:14in fast
- 15:15API
- 15:15and it can
- 15:16help you
- 15:17find that
- 15:17exact
- 15:18middleware
- 15:18you know
- 15:19it's like
- 15:19boilerplate-y
- 15:20but it's great
- 15:20that it can
- 15:21just be a
- 15:21source for that
- 15:22this portion
- 15:24of Talk Python
- 15:25to Me is
- 15:25brought to
- 15:26you by
- 15:26brilliant.org
- 15:27you're a
- 15:28curious person
- 15:28who loves
- 15:29to learn
- 15:29about technology
- 15:30I know
- 15:30because you're
- 15:31listening to
- 15:31my show
- 15:32that's why
- 15:32you would
- 15:33also be
- 15:33interested
- 15:34in this
- 15:34episode's
- 15:35sponsor
- 15:35brilliant.org
- 15:36brilliant.org
- 15:38is entertaining
- 15:38engaging
- 15:39and effective
- 15:40if you're
- 15:40like me
- 15:41and feel
- 15:41that binging
- 15:42yet another
- 15:42sitcom series
- 15:43is kind
- 15:44of missing
- 15:44out on life
- 15:45then how
- 15:45about spending
- 15:4630 minutes
- 15:46a day
- 15:47getting better
- 15:47at programming
- 15:48or deepening
- 15:49your knowledge
- 15:50and foundations
- 15:50of topics
- 15:51you've always
- 15:51wanted to
- 15:52learn better
- 15:52like chemistry
- 15:54or biology
- 15:54over on
- 15:55brilliant
- 15:55brilliant
- 15:57has thousands
- 15:57of lessons
- 15:58from foundational
- 15:59and advanced
- 16:00math to data
- 16:01science
- 16:01algorithms
- 16:02neural networks
- 16:03and more
- 16:03with new
- 16:04lessons added
- 16:04monthly
- 16:05when you sign up
- 16:06for a free
- 16:06trial
- 16:07they ask a couple
- 16:08of questions
- 16:08about what
- 16:09you're interested
- 16:09in as well as
- 16:10your background
- 16:10knowledge
- 16:11then you're
- 16:11presented with a
- 16:12cool learning
- 16:13path to get
- 16:13you started
- 16:14right where
- 16:14you should
- 16:15be
- 16:15personally
- 16:16I'm going
- 16:16back to some
- 16:17science foundations
- 16:18I love chemistry
- 16:19and physics
- 16:19but haven't
- 16:20touched them
- 16:20for 20 years
- 16:21so I'm looking
- 16:23forward to playing
- 16:23with PV
- 16:24equals NRT
- 16:25you know
- 16:26the ideal gas
- 16:27law
- 16:27and all the
- 16:28other foundations
- 16:29of our world
- 16:29with brilliant
- 16:30you'll get
- 16:31hands-on
- 16:31on a whole
- 16:32universe of
- 16:33concepts
- 16:33in math
- 16:34science
- 16:34computer science
- 16:35and solve
- 16:36fun problems
- 16:37while growing
- 16:37your critical
- 16:38thinking skills
- 16:39of course
- 16:39you could just
- 16:40visit brilliant.org
- 16:41directly
- 16:41its url is
- 16:42right there
- 16:42in the name
- 16:43isn't it
- 16:43but please
- 16:44use our
- 16:44link because
- 16:45you'll get
- 16:45something extra
- 16:4620% off
- 16:47an annual
- 16:48premium
- 16:49subscription
- 16:49so sign up
- 16:50today at
- 16:51talkpython.fm
- 16:52slash brilliant
- 16:52and start a
- 16:537 day free
- 16:54trial
- 16:54that's
- 16:55talkpython.fm
- 16:56slash brilliant
- 16:57the link is
- 16:57in your podcast
- 16:58player show notes
- 16:59thank you to
- 16:59brilliant.org
- 17:00for supporting
- 17:01the show
- 17:01it's insane
- 17:04I don't know
- 17:05if I've got it
- 17:06in my history
- 17:07here
- 17:08we're rewriting
- 17:09our mobile
- 17:10apps for
- 17:11talkbython
- 17:11training for
- 17:12our courses
- 17:12in
- 17:13Flutter
- 17:14and we're
- 17:15having a
- 17:15problem
- 17:16downloading
- 17:16stuff
- 17:17concurrently
- 17:18using a
- 17:18particular
- 17:19library
- 17:19in
- 17:20Flutter
- 17:20and so
- 17:21I asked
- 17:22it
- 17:23I said
- 17:24hey
- 17:24I want
- 17:25some help
- 17:25with a
- 17:25Flutter
- 17:26and Dart
- 17:26programs
- 17:26what do you
- 17:27want
- 17:27it says
- 17:27I'm using
- 17:28the
- 17:28dio
- 17:29package
- 17:29do you
- 17:29know
- 17:30it
- 17:30oh yes
- 17:30I'm
- 17:30familiar
- 17:31it does
- 17:31HTTP
- 17:31client
- 17:32stuff
- 17:32for
- 17:32Dart
- 17:32okay
- 17:33I want
- 17:34to
- 17:34download
- 17:34binary
- 17:35video
- 17:35files
- 17:35and a
- 17:36bunch
- 17:36of
- 17:36them
- 17:36given
- 17:37a
- 17:37URL
- 17:37I want
- 17:38to do
- 17:38them
- 17:38concurrently
- 17:39with three
- 17:39of them
- 17:39at a
- 17:40time
- 17:40write the
- 17:41code for
- 17:41that
- 17:41and boom
- 17:41it just
- 17:42writes it
- 17:42like using
- 17:43that library
- 17:44I told it
- 17:45about not
- 17:45just Dart
- 17:46so that's
- 17:47incredible that
- 17:48we can get
- 17:48this kind
- 17:49of assistance
- 17:49for knowledge
- 17:50and programming
- 17:51like you'll
- 17:52never find
- 17:52I mean I take
- 17:53that back
- 17:53you might
- 17:54find that
- 17:54if there's
- 17:55a very
- 17:55specific
- 17:56stack
- 17:56overflow
- 17:57question
- 17:57or something
- 17:58but if
- 17:58there's not
- 17:59a write-on
- 17:59question for it
- 18:00you're not
- 18:00going to find
- 18:01it
- 18:01I love
- 18:02when you
- 18:03know the
- 18:04stack
- 18:04overflow
- 18:04would exist
- 18:05for a
- 18:05variant
- 18:05of your
- 18:06question
- 18:06but the
- 18:07exact one
- 18:08doesn't
- 18:08exist
- 18:09and you
- 18:09have to
- 18:09go grab
- 18:10the three
- 18:10of them
- 18:10to synthesize
- 18:11and it's
- 18:12just great
- 18:12at that
- 18:13it also
- 18:14is pretty
- 18:15good at
- 18:15fixing errors
- 18:16sometimes it
- 18:17can walk
- 18:17itself into
- 18:17lying to
- 18:18you
- 18:18repeatedly
- 18:19but
- 18:19that's
- 18:20so problematic
- 18:23yeah
- 18:23but you can
- 18:24also ask
- 18:24it
- 18:25here's
- 18:25my
- 18:25program
- 18:26are there
- 18:26security
- 18:27vulnerabilities
- 18:27or do
- 18:28you see
- 18:28any
- 18:28bugs
- 18:29and it'll
- 18:29find them
- 18:30yep
- 18:30yeah
- 18:31it's
- 18:31nuts
- 18:32so people
- 18:33may be
- 18:33wondering
- 18:34we haven't
- 18:34talked yet
- 18:34about your
- 18:35project sketch
- 18:36why I'm
- 18:36talking so much
- 18:37about chat
- 18:37CP
- 18:38so that is
- 18:39kind of
- 18:39the style
- 18:40of AI
- 18:41that your
- 18:42project brings
- 18:43to pandas
- 18:44which we're
- 18:44going to get
- 18:44to
- 18:45but I want
- 18:45to touch
- 18:45on two
- 18:46more really
- 18:46quick AI
- 18:47things that
- 18:47we'll dive
- 18:48into it
- 18:48the other
- 18:49is this
- 18:50just around
- 18:50images
- 18:51just the
- 18:52ability to
- 18:52ask questions
- 18:53you've already
- 18:54mentioned
- 18:54three
- 18:55dolly
- 18:55imagine
- 18:56and then
- 18:57the other
- 18:57one I don't
- 18:58remember from
- 18:58Google that
- 18:59they haven't
- 18:59put out yet
- 19:00a mid
- 19:01journey is
- 19:01another
- 19:01just the
- 19:02ability to
- 19:03say hey
- 19:03I want a
- 19:04picture of
- 19:04this
- 19:05no actually
- 19:05change it
- 19:06slightly like
- 19:06that
- 19:07it's
- 19:07mind
- 19:07blowing
- 19:08they're a lot
- 19:08of fun
- 19:08they're great
- 19:09for sparking
- 19:10creativity
- 19:10or having
- 19:11idea and
- 19:11just getting
- 19:11to see it
- 19:12in front of
- 19:12you
- 19:12I think
- 19:13it's more
- 19:13impressive to
- 19:13me
- 19:14than even
- 19:15this chat
- 19:16GTP
- 19:16telling me
- 19:16I want a
- 19:17GTP
- 19:17I want an
- 19:29artificial
- 19:29intelligence
- 19:30panda
- 19:30and it
- 19:31came up
- 19:32and I
- 19:32want it
- 19:32photorealistic
- 19:33in the style
- 19:34of National
- 19:34Geographic
- 19:35and so
- 19:36it gave
- 19:36me
- 19:36this panda
- 19:37you can see
- 19:38beautiful whiskers
- 19:39but just
- 19:39behind the
- 19:40ear
- 19:40you can see
- 19:41the fur is
- 19:41gone
- 19:42and it's
- 19:42like
- 19:43an android
- 19:44type of
- 19:45creature
- 19:45that is a
- 19:47beautiful
- 19:48picture
- 19:48it's pretty
- 19:49accurate
- 19:50it's nuts
- 19:51that I can
- 19:51just go talk
- 19:52to these
- 19:52systems
- 19:52and ask
- 19:53them these
- 19:53questions
- 19:54I find it
- 19:55interesting
- 19:55comparing
- 19:55the chat
- 19:56GPT
- 19:56and the
- 19:57mid-journey
- 19:58style
- 19:58I completely
- 20:02get it
- 20:02it's very
- 20:03visceral
- 20:03it's also
- 20:04from another
- 20:05perspective
- 20:05I think
- 20:06of the
- 20:06weights
- 20:06and the
- 20:07scale
- 20:07of the
- 20:07model
- 20:07and
- 20:08these
- 20:09image
- 20:10ones
- 20:10that
- 20:10solve
- 20:11all
- 20:11images
- 20:11are
- 20:11so
- 20:12much
- 20:12smaller
- 20:13in
- 20:13scale
- 20:13than
- 20:14these
- 20:14language
- 20:14ones
- 20:14that
- 20:15have
- 20:15all
- 20:15this
- 20:15other
- 20:15data
- 20:16and
- 20:16stuff. So it's fascinating how complex language is. Yeah, I know the smarts is so much less,
- 20:20but just something about it actually came up with a creative picture that never existed.
- 20:26Yeah. Right. You could show this to somebody like, oh, that's an artificial panda. That's
- 20:31insane. Right. But it's, but I just gave it like a sentence or two. Yeah. Yeah. Yeah. I don't know.
- 20:36Yeah. This, it's a sort of a technical interpreter, but I love it because it's
- 20:41like this, it's just phenomenal interpolation. It's like through semantically labeled space. So
- 20:46like the words have meaning and it understands the meeting and can move sliders of like, well,
- 20:51I've seen lots of these machine things. I understand the concept of gears and this metal and this,
- 20:54like the shiny texture and then the fur texture and like, they're very good at texture. It's a,
- 21:00yeah, really great how it interprets all of that just to fit the, you know, the small prompt.
- 21:04Yeah. There are other angles of which it's frustrating. Like I want it turned, I want it
- 21:08in the back of the picture, not the, no, it's always in the center. One more thing really quick.
- 21:13And this leads me into my final thing is, is a GitHub copilot. GitHub copilot is like this in
- 21:19your editor, which is kind of insane, right? You can just give it like a comment or a series of
- 21:23comments and it will write it. I think chat GDP is maybe more open-ended and more creative, but this
- 21:29is, this is also a pretty interesting way to go. I'm a heavy user of copilot. I, if there's a,
- 21:35there's a weird crux and I'm like slowly developing like a need to have this in my browser. I was a,
- 21:40on a flight recently and was with the internet and copilot wasn't working. And I felt the, like,
- 21:46I felt the difference. I felt like I was like walking through mud instead of just like actually
- 21:50running a little bit. And I was like, Oh, I've been disconnected from my distributed mind. I am broken
- 21:56partially. Yeah. So incredible. So the last part I guess is like, you know, what are the ethics
- 22:03of this? Like I went on very positively about mid journey, but how much of that is trained on
- 22:08copyright material or there's GitHub copilot. How much of that is trained on GPL based stuff that was
- 22:16in GitHub. But when I use it, I don't have the GPL any longer on my code. I might use it on commercial
- 22:23code, but just running it through the AI, does that strip licenses or does it not? There's a GitHub
- 22:29copilotlitigation.com, which is interesting. I mean, we might be finding out. There's also
- 22:35think Getty, I think it's the Getty images. I'm not 100% sure, but I think Getty images is suing
- 22:41one of these image generation companies. I can't remember which one I don't maybe mid journey. I
- 22:47don't think it's mid journey. I think it's stable diffusion, but anyway, it doesn't really matter.
- 22:50Like there's a bunch of things that are pushing back against us. Like, wait a minute,
- 22:53where did you get this data? Did you have rights to use this data in this way? And I mean,
- 22:58what are your thoughts on this angle of AI these days?
- 23:02Yeah. I know it sounds like I don't worry too much about it in either direction. I think I
- 23:08believe in personal ethics. I believe in open source things, availability of things,
- 23:14because it just sort of like accelerates collective progress. But that said, I also believe in like
- 23:19slightly different like social structures to help support people. Like I'm a, I guess,
- 23:24a person believer in things like UBI or something like that on that direction.
- 23:27So when you combine those, I feel like it, you know, things sort of work out kind of well,
- 23:31but when we like, but it is still a thing that like,
- 23:34Be Right exists and that there is this sense of ownership and this is my thing. And I wanted to
- 23:38put licenses on it. And, I think that this sort of story started presumably that I wasn't really
- 23:44having this conversation, but like when the internet came around and search engines happened and like
- 23:49Google could just go and pull up your thing from your page and summarize it in a little blob on the
- 23:54page is, was that fair? What if it starts, you know, your shop and it allows you to go buy that
- 23:58same product from other shops. Like it, I think that the same things are showing up and in the same way
- 24:04that the web, like in the internet sort of, it's sort of, it was a large thing, but then it sort of,
- 24:08I don't know if it got quieter, but it sort of became in the background. We sort of found new
- 24:12systems. It stopped being piracy and CDs and the music industry is going to struggle. And Hey,
- 24:17things like Spotify exist and streaming services exist. And like, I don't know what the next way
- 24:21is.
- 24:21They're doing better than ever basically. Yeah. Yeah. Yeah. So I think it's just evolution.
- 24:24And then like the, some things will change and adopt some things will like fall apart and new
- 24:29things will be born. I, that's just a great, it's a good time for lots of opportunity, I guess is the
- 24:33part that I'm excited about.
- 24:34Yeah. Yeah. Yeah. For sure. I think that's definitely true. It probably, you're probably right. It probably
- 24:39will turn out to be, you know, old man yells at cloud cloud doesn't care sort of story, you know,
- 24:45in the end where it's like, on the other hand, if, if somebody came back and said,
- 24:49you know, a court came back and said, you know what, actually anything trained on GPL
- 24:54and then you use copilot on it, that's GPL. Like that would have instantly mega effects. Right.
- 25:02Yeah. I, yeah. And I guess there's also stuff like the, I don't, I didn't actually read the
- 25:06article. I only saw the headline and you know, that's the worst thing to do is to repeat a thing,
- 25:09which is a headline. But, there was that Italy thing that I saw about, like, I don't know.
- 25:14Yeah. That was really clickbaity, but I didn't get a time to look at it yet. So yeah. You probably
- 25:20ask chat to be to summarize for you. If as long as it can be a Bing, I guess, get that updated.
- 25:25Yeah. Yeah. Yeah. Yeah. There's a lot of, there's a lot of things playing in that space,
- 25:30right? Some different places. Okay. So yeah, very cool. But as a regular user, I would say,
- 25:36you know, regardless of kind of how you feel about this, at least this is my viewpoint right now.
- 25:40It's like, regardless of how I feel about which side is right in these kinds of disputes,
- 25:45this stuff is out of the bag. It's out there and available and it's a tool. And it's like saying,
- 25:50you know, I don't want to use spell check or I don't want to use some kind of like code checking. I just
- 25:55want to write like in straight notepad because it's pure, right? Like sure you could do that,
- 26:00but there's these tools that will help us be more productive and it's better to embrace them and know
- 26:05them than to just like yell at them, I suppose. Yeah. A lot of accelerant you can get.
- 26:10really speed up whatever you want to get done. Yeah, absolutely. All right. So speaking of
- 26:15speeding up things, let's talk pandas and not even my artificial pandas, but actual programming pandas
- 26:22with this project that you all have from approximate. Yeah. Approximate labs called sketch. So sketch is
- 26:30pretty awesome. Sketch is actually why we're talking today because I first talked about this on Python
- 26:35bytes and I saw this was sent over there by Jake Furman and to me and said, you should check this
- 26:41thing out. It's awesome. And, yeah, it's pretty nuts. So tell us about sketch. Yeah. So, even
- 26:49though I use a copilot as I sort of described already, and it's become a crux I found in Jupyter
- 26:54notebooks when I wanted to work with data, it just didn't, it doesn't actually apply that. So on one side,
- 27:00it was sort of like missing the mark at times. And so it was sort of like, how can I get this
- 27:04integrated into my flow? The way I actually work in a Jupyter notebook, if maybe I'm working a Jupyter
- 27:09notebook on a remote server and I don't want to set up VS Code to do it. So I don't have copilot at all.
- 27:13Like there's a bunch of different reasons that I was just like in Jupyter. It's a very different IDE
- 27:17experience. It is. Yeah. It's super different, but also you might want to ask questions about the data,
- 27:21not the structure of the code that analyzes the data, right? Exactly. Yeah. And so just a bunch of that
- 27:26type of stuff. And then also at the other side, I was trying to find something that I could throw together
- 27:31that I thought was strong demonstration of the value approximate labs is trying to chase, but wouldn't
- 27:38take me too much time to make. So it was a, oh, I could probably just go throw this together pretty quickly.
- 27:42I bet this is going to be actually useful and helpful. And so let's just do that. And so through on top of
- 27:48the actual library I was using, it was sketch. I put this on it and then shift it. So sort of shifted what the
- 27:54project was. Yeah. Yeah. So you also have this other project called Lambda Prompt. And so were
- 27:59you trying to play around Lambda Prompt and then like see what you could kind of apply here to leverage
- 28:03it? Or is that the full journey I can get into is started with data sketches. I left my last job
- 28:11to chase bringing the algorithm, like combining data sketches with AI, but just like the vague,
- 28:17like at that level. Tell us what data sketches is real quick. Sure. Yeah. So a data sketch is a
- 28:22probabilistic aggregation of data. So if you have, I think the most common one that people have heard of
- 28:27is hyperloglog and it's used to estimate cardinality. So estimate the number of unique
- 28:32values in a column. A data sketch is a class of algorithms that all sort of like use roughly fixed
- 28:39width in binary, usually representations. And then in a single pass, so their ON will look at each row
- 28:46and hash the row and then update the sketch or not necessarily hash, but they update this sketch
- 28:52object. Essentially. Those sketch objects also have another property that they are mergeable. So you
- 28:57have this like really fast ON to go bring that like to aggregate up and you get this mergeability. So you
- 29:03can map reduce it in, you know, trivial speeds. The net result is that this like tight binary packed
- 29:09object can be used to approximate measures you were looking for on the original data. So you could look
- 29:15at, if you do a few of these, they're like theta sketches, you can go and estimate not just the
- 29:21unique count, but you can also estimate if this one column would join well with this other column,
- 29:25or you can estimate, Oh, if I were to join this column to this column, then this third column that
- 29:30was on that other table would actually be correlated to this first column over here. So you get these,
- 29:35a bunch of different distributions, you get a whole bunch of these types of properties.
- 29:40And each sketch is sort of just, I would say, algorithmically engineered, like very, very
- 29:44engineered to be like information theory optimal at solving one of those like measures on the data.
- 29:50And so tight packed binary representations.
- 29:53All right. So you thought about, well, that's cool, but chat CTP is cool too.
- 29:57Yeah.
- 29:58What else?
- 30:00The core thing was, so those representations aren't usable by AI right now. And when you actually go and
- 30:07use GPT three or something like this, you have to figure out a way to build the prompt to get it to do
- 30:13what you want. This was especially true in a pre instruction tuning world, you had to really like, you had to
- 30:18play the prompt engineer role even more than you have to now. Now you could sort of get away with describing it to
- 30:23ChatGPT. And one of the things that you really have to like, play the game of is how do you get all the
- 30:28information it's going to need into this prompt in a succinct, but good enough way that it helps it do
- 30:35this. And so what sketch was about was, rather than just looking at the context of the data, like the
- 30:41metadata, the column names and the code you have, also go get some representations of representation of the
- 30:48content of the data, turn that into a string, and then bring that string in as part of the prompt.
- 30:53And then when it has that, it should understand much better at actually generating code, generating
- 30:59answers to questions. And that's what that sketch was a proof of concept of that, that worked very well.
- 31:03It really quickly showed how valuable actual data content context is.
- 31:08Yeah, I would say people are resonating with people. It's got 1.5,000 stars on GitHub.
- 31:13And it looks about six months old. So that's pretty good growth there.
- 31:18Yeah, January 16th was the day I posted it on Hacker News. And it had three,
- 31:22there was an empty repo at that point.
- 31:24Okay, three stars. It's like me and my friends. Okay, cool. So this is a tool that basically patches
- 31:33pandas to add functionality or functions, literally to pandas data frames that allows you to ask
- 31:42questions about it, right?
- 31:44Yep.
- 31:44So what kind of questions can you ask it? What can it help you with?
- 31:47Yeah, so there's two classes of questions you can ask, you can ask it, the ask type questions,
- 31:53these are sort of from that summary statistics data. So from the general, you know, representation of your
- 32:00data, ask it to like, give you answers about it, like, what are the columns here, you sort of have
- 32:04a conversation where it sort of understands the general under like shape of the data, general
- 32:10distributions, things like that, number of uniques, and like give that context to it, ask questions of that
- 32:15system. And then the other one is ask it how to do something. So you specifically can get it to write
- 32:21code to solve a problem you have, you describe the problem you want, and you can ask it to do that.
- 32:25Right. I've got this data frame, I want to plot a graph of this versus that, but color by the other
- 32:31thing.
- 32:31Yep. And in the data space world, what I sort of decided to do is like in the demo here is just sort of
- 32:37walk through what are some standard things people want to ask of data, like, like, what are those common
- 32:43questions that you hear, like, in Slack between, you know, like, business team and an analyst team. And it's just
- 32:49sort of like, Oh, can you do this? Can you get me this? Can you tell me if there's any PII? Is this safe to send?
- 32:54Can I send the CSV around? Can you clean up this CSV? Oh, I need to load this into our catalog. Can you
- 32:59describe each of these columns and check the data types all the way to can you actually go get me
- 33:04analytics or plot this?
- 33:05Yeah. Awesome. So and it plugs right into Jupyter Notebooks, so you can just import it and basically
- 33:13installing Sketch, which is a pip or Conda type thing, and then you just import it, and it's good to go,
- 33:19right? Yep. Using the Pandas extensions API, which allows you to essentially hook into their data
- 33:24frame callback and register a, you know, a function. Interesting. So it's not as jammed on from the
- 33:31outside. It's a little more, plays a little nicer with Pandas rather than just like, we're going to go
- 33:35to the class and just tap on it. Yeah, yeah. I, yeah. Not full monkey patching here. It's a,
- 33:41it's like hack supported, I think. I don't, I don't see it used often, but it is somewhere in the docs.
- 33:46Excellent. But here it is. So what I wanted to do for this is there's a, an example that you can do,
- 33:52like if you go to the repo, which obviously I'll link to, there's a video, which I mean,
- 33:57mad props to you because I review so many things, especially for the Python Bytes podcast, where
- 34:02there's a bunch of news items and new things we're just going to check out. And we'll, we'll find people
- 34:06recommending GUI frameworks that haven't, not a single screenshot or other types of things. Like,
- 34:13I have no way to judge whether this thing even might look like that. What does it even make?
- 34:17I don't even know, but somebody put a lot of effort, but they didn't bother to post an image. And you
- 34:21posted a minute and a half animation of it going through this process, which is really, really
- 34:27excellent. So people can go and watch that one minute, one minute 30 video. But there's also a
- 34:34collab opening Google Colab, which gives you a running interactive variant here. So you can just
- 34:41follow along, right? And play these pieces requires me to sign up on and run it. That's okay.
- 34:46Let me talk people through some of the things it does. And you can tell me what it's doing,
- 34:51how it's doing that, like how people might find that advantageous. So import sketch, import pandas
- 34:57as PD standard. And then you can say pandas read CSV and you give it one from a, like a,
- 35:03some example CSV that you got on your, one of your GitHub repos, right? Or in your account.
- 35:08Yeah. I found one online and then added just random synthetic data to it.
- 35:12Yeah. Like, Oh, here's a data dump. No, just kidding.
- 35:14So then you need to go to that data frame called sales data. You say dot sketch dot ask as a string,
- 35:21what columns might have PII personal identifying information in them?
- 35:28Awesome. And so it comes, tell me how that works and what it's doing here.
- 35:33So it does, I guess it has to build up the prompt, which is sent to GPT. So to OpenAI specific
- 35:40completion endpoint, the building up the prompt, it looks at the data frame. It does a bunch of
- 35:44summarization stats on it. So it calculates uniques and sums and things like that. There's two modes in
- 35:50the backend that either does sketches to do those, or it just uses like DF dot describe type stuff.
- 35:55And then it pulls those summary stats together for all the columns, throws it together with my,
- 36:00the rest of the prompt I have, you can, we can go find it, but then it sends that prompt.
- 36:05Actually, it also grabs some information off of inspect. So it sort of like walks the,
- 36:10the stack up to go and check the variable name because the data frame is named sales data.
- 36:15So it actually tries to go find that variable name in your call stack so that it can, when it writes
- 36:20code, it writes valid code, puts all that together, send it off to OpenAI, gets code back, uses Python
- 36:25AST to parse it, check that it's valid. If it's not valid Python code, or you tried to import something
- 36:30that you don't have, it will ask it to rewrite once. So this is sort of like an iterative process. So it
- 36:36takes the error or it takes the thing and it sends it back to OpenAI. It's like, Hey, fix this code.
- 36:41And then it, or in this case, sorry, ask, it actually just takes this, it sends that exact
- 36:45same prompt, but it just changes the last question to, can you answer this question off of the information?
- 36:51This portion of talk Python me is brought to you by us over at Talk Python Training with our courses.
- 36:58And I want to tell you about a brand new one that I'm super excited about. Python web apps that fly
- 37:05with CDNs. If you have a Python web app, you want it to go super fast. Static resources,
- 37:11turn out to be a huge portion of that equation. Leveraging a CDN could save you up to 75% of your
- 37:17server load and make your app way faster for users. And this course is a step-by-step guide on how to do
- 37:24it. And using the CDN to make your Python apps faster is way easier than you think. So if you've
- 37:30got a Python web app and you would like to have it scaled out globally, if you'd like to have your users
- 37:35have a much better experience and maybe even save some money on server hosting and bandwidth,
- 37:41check out this course over at talkpython.fm/courses. It'll be right up there at the top.
- 37:46And of course the link will be in your show notes. Thank you to everyone who's taken one of our courses.
- 37:51It really helps support the podcast. I'm back to the show.
- 37:56And so that sounds very, very similar to my arrow program. Rewrite it with garden clauses, redo it.
- 38:02Like you kind of, I gave you this data in this code and I asked you this question and you can have a
- 38:07little conversation, but at some point you're like, all right, well, we're going to take what it gives me
- 38:10after a couple of rounds at it. Right.
- 38:12Yeah. I take the first one that doesn't, that like passes an import check and passes AST linting.
- 38:18There was a, the, when you use small models, you run into not valid Python a lot more, but with these
- 38:23ones, it's almost always good.
- 38:25It's ridiculous. Yeah. Yeah. Yeah. It's crazy. Okay. So it says the columns that might have PII
- 38:30in them are credit card, SSN and purchase address. Okay. That's pretty excellent. And then you say,
- 38:37all right, sales data dot sketch dot ask. Can you give me friendly name to each column and output this
- 38:44as an HTML list, which is parsed as HTML and rendered in Jupyter notebook accurately. Right. So it says
- 38:51index. Well, that's an index.
- 38:52This one ends up being the same.
- 38:53It's not a great, this one is not a great example because it doesn't have to like infer
- 38:57because the names are like order space date, right? Instead of order, like maybe lowercase
- 39:04O and then like attached a big D or whatever, but it'll give you some more information. You
- 39:09can like kind of ask it questions about the type of data, right?
- 39:13Yeah, exactly. I found this is really good at if you play the game and you just name all
- 39:17your columns, like call one, call two, call three, call four, and you ask it, give me new column
- 39:21names for all of these. It gives you something that's pretty reasonable based off of the data.
- 39:24So pretty useful.
- 39:24Okay. So it's like, oh, these look like addresses. So we'll call that address. And this looks like
- 39:28social security numbers and credit scores and whatnot.
- 39:31Yep. Yep. So it can really help with that quick first onboarding step.
- 39:35Yeah. So everyone heard it here first. Just name all your columns. One, two, three, four,
- 39:39and then just get help. Like AI, what do we call these? All right. So the next thing you did in this
- 39:48demo notebook was you said sales data dot sketch dot. And this is different before I believe,
- 39:54because before you were saying ask, and now you can say how to create some derived features from the,
- 40:01from the address. Tell us about that.
- 40:03Yeah. This is the one that actually is the code writing. It's essentially the exact same prompt,
- 40:07but the change is the very end. It says like, return this as Python code that you can execute to do
- 40:13this. So instead of answering the question directly, answer the question with code that will answer the
- 40:17question.
- 40:18Right. Write a Python line of code that will answer this question given this data, something like that.
- 40:23Yep. Yep. Something like that. I don't remember exactly anymore. It's been a while, but yeah,
- 40:27some I've iterated a little bit until it started working and I was like, okay, cool. And so,
- 40:32uh, ask it for that. And then it spits back code. And that was, it sort of, it sounds overly simple,
- 40:37but that was it. That was like, that was the moment. And I was just like, oh, I could just ask it to do my
- 40:42analytics for me. And it's just all the, every other feature just sort of became like apparently
- 40:45solvable with this. And the more I played with it, the more it was just, I don't have to think about,
- 40:50I don't even have to go to Google or stack overflow to ask the question, to get the API stuff for me.
- 40:55I could, from zero to I have code that's working is one step in Jupyter.
- 40:59So you wrote that how to, and you gave it the question and then it wrote the lines of code and you just
- 41:04drop that into the next cell and just run it. Right. And so for example, in this example, it said, well,
- 41:09we can come up with city state and zip code and by writing a vector transform by passing a lambda,
- 41:16that'll pull out, you know, the city from the string that was the full address and so on. Right.
- 41:21Yeah. That's pretty neat.
- 41:22Yeah. It's fun to see what it, what it does. Not again, not any of these things are always
- 41:26probabilistic, but it also usually serves as a great starting point if, even if it doesn't get it
- 41:30right.
- 41:30Yeah. Sure. You're like, oh, okay. I see. Maybe that's not exactly right. Cause we have Europeans
- 41:35in their city, maybe in their zip code or in different orders sometimes, but it gives you
- 41:40something to work with pretty quickly. Right. By asking just a, what can I do?
- 41:44And then another one, this one's a little more interesting instead of just saying like, well,
- 41:48what other things can we pull out? It's like, this gets towards the analytics side, right? It says,
- 41:53get the top five grossing states for the sales data. Right. And it writes a group by some sorts,
- 42:01and then it does a head given five. And that's pretty neat. Tell us about this. I mean, I guess
- 42:05it's about the same, right? Just ask more questions.
- 42:08They all feel pretty similar to me. I think, I guess I could jump towards like things that
- 42:13I wanted to put next, but I didn't, we're not reliable enough to like really make the cut.
- 42:18I wanted to have it go like in my question was like, go build a model that predicts sales for the
- 42:24next six months and then plot it on a 2d plot with a dotted line for the predicted plot. And like,
- 42:31it would try, but it would always do something off. And I found I always had to break up the
- 42:36like prompted to like smaller, smaller intern level code back. Yeah.
- 42:40Yeah. It was fun getting it to train models, but it was also its own like separate thing. I sort of
- 42:48didn't play with too much. And there's another part of sketch that I guess is not in this notebook. I
- 42:54didn't realize. Yeah. Because you have to use the OpenAI API key, but it's the sketch apply. And
- 43:00that's the, I'll say this one is another just like power tool. This one has like, I don't really talk
- 43:07about, I don't even include it in the video because it's not just like as plug and play, you do have to
- 43:11go set an environment variable. And so it's like, yeah, that's one step further than I want to,
- 43:15I don't, it's not terrible, but it's a step. And so what it does is it lets you apply a completion
- 43:22endpoint of whatever your design row wise. So every single row, you can go and apply and run something.
- 43:29So if every row of your pandas data frame is a, some serialized text from a PDF or something,
- 43:35or a file in your directory structure, and you just load it as a data frame, you can do dot
- 43:39df.sketch.apply. And it's almost the exact same as df.apply. But the thing you put in as your function
- 43:45is now just a Jinja template that will fill in your column variables for that row and then ask GPT to
- 43:51continue completing. So I think I did silly ones, like here's a few states. And then the prompt is
- 43:58extract the state for it. Or so I think, right, extract the capital of the state. Yeah. Yeah. So
- 44:04just pure information extraction from it, but you can sort of like this grows into a lot more.
- 44:10So does that come out of the data? Or is that coming out of OpenAI where like it sees what is
- 44:15the capital of state and it sees New York? It's like, okay, well, all right, Albany.
- 44:20Yeah. So this is purely extracting out of the model weights. Essentially, this is not like a factual
- 44:25extraction. So this is probably a bad example because it's like it. But the thing that actually,
- 44:29actually, the better example I did once was, what is like some interesting colors that are
- 44:34good for each state? And it like just came up with a sort of like flaggish colors or sports team colors.
- 44:38That was sort of fun when it wrote that as hex. You can also do things like if you have a large text
- 44:43document or you can actually, I'll even do the more common one that I think everybody actually wants
- 44:47is you have messy data. You have addresses that are like syntactically messy and you can say,
- 44:52normalize these addresses to be in this form. And you sort of just write one example. It's a run
- 44:57dot apply and you get a new column that is that cleaned up data. Yeah. Incredible. Okay. A couple
- 45:03things here. It says I can use, you can directly call OpenAI and not use your endpoint. So at the
- 45:11moment it kind of proxies through web service that you all have that somehow checks stuff or what does
- 45:16that do? Yeah. It was just a pure ease of use. I wanted people to be able to do pip install and
- 45:21import sketch and actually get it because I know how much I use things in, in a collab or in Jupyter
- 45:28notebooks on weird machines and remembering an environment variable, managing secrets. It's like
- 45:32this whole overhead that I want to deal with. And so I wanted to just offer a lightweight way if you
- 45:38just want to be able to use it. But I know that that's not sufficient for secure. If people are going
- 45:42to be conscious of this things and want to be able to, you know, not go through my proxy thing that's
- 45:46there for help. So sure.
- 45:47Offer this up.
- 45:48What's next? Do you have a roadmap for this? Are you happy where it is and you're just letting it be or
- 45:53do you have grand plans?
- 45:55I don't have much of a roadmap for this right now. I'm actually, I guess there's like grand roadmap,
- 46:00which is like at the company scale, what we're working on. I would say that if this, we're really trying to
- 46:05solve data and with AI just in general. And so these are the types of things we hope to open source and
- 46:11just give out there, like actually everything we're hoping to open source. But the starting place is
- 46:16going to be a bunch of these like smaller toolkits or just utility things that hopefully save people
- 46:20time or very useful. The grand thing we're working towards, I guess, is this more like the, it's the
- 46:26full automated data stack. It's like the dream I think that people have wanted where you just ask it
- 46:31questions and it goes and pulls the data that you need. It cleans it. It builds up the full pipeline.
- 46:36It executes the pipeline. It gets you to the result and it shows you the result. And you look,
- 46:40you can inspect all of that, that whole DAG and say, yes, I trust this. So we're working on getting
- 46:45full end to end.
- 46:46So when I went and asked about that Arrow program, I said, I think this will still do it. I think this
- 46:51will probably work again. And it did, which is awesome. Just the way I expected. But, you know,
- 46:58AI is not as deterministic as read the number seven. If seven is less than eight, do this,
- 47:05right? Like what is the repeatability? What is the sort of experience of doing this? Like I ran it,
- 47:11I ran it again. Is it going to be pretty much the same or is it going to have like, what's the mood
- 47:16of the AI when it gets to you?
- 47:18This is sort of a parameter you can, there's a little bit of a parameter you can set if you want
- 47:22to play that game with the temperature parameter on these models at higher and higher temperatures,
- 47:26you get more and more random, but it can also truly be out of left field random if you go too
- 47:31high temperature.
- 47:32Okay. But you get maybe more creative solutions.
- 47:34Yeah. You could sometimes get that. And as you move towards zero, it gets more and more
- 47:38deterministic. Unfortunately for really trying to do some like good provable, like sort of like
- 47:43build chain type things with like hashing and caching and stuff. It's not fully deterministic,
- 47:48even at zero temperature, but that's just, I think it's worth thinking about, but at the same time,
- 47:53run it once, see the answers that it gives you comment that business out and just like put that
- 47:59as markdown, you know, freeze it. It like us memorialize it in markdown because you don't need
- 48:05to ask it over and over what columns have PII. Like, well, probably the same ones as last time.
- 48:10We're just kind of like, right, these columns, credit card, social security and purchase address,
- 48:15they have, have that. And so now, you know, right. Is that a reasonable way to think about it?
- 48:20I think, yeah, if you, if you want to get determinism or the performance is a thing that
- 48:24you're worried about, yeah, you can always cash. I think however you do it, comments or actually
- 48:28with systems.
- 48:28Sure. Sure. Sure. Sure. Or that like, like, how do I, you know, how do I do that group by sorting
- 48:35business? Like you don't have to ask that over and over once it gives you the answer.
- 48:38Yeah. Yeah. My workflow, when I use sketch, definitely I asked the question, I copy the
- 48:43code and then I go delete the question or ask it a different question for my next problem that I have.
- 48:47Yeah. I like, it's not code that it is a little bit like a vestigial when it, when you like save
- 48:53your notebook at the end and you sort of want to go back and delete all the questions you asked because
- 48:57you don't need to rerun it when you actually just go to execute the notebook later. But yeah,
- 49:01that makes a lot of sense. And plus you look smarter if you don't have to show how you got
- 49:04the answers.
- 49:05Look at this beautiful code that's even commented.
- 49:07Yeah, exactly. I guess you could probably ask it to comment your code, right?
- 49:12Yeah. You can ask it to describe. There's been some really cool things where people will throw
- 49:17like assembly at it and ask it to translate to different like languages so they can interpret
- 49:20it. Or you could do really fun things like cross language, cross, I guess I'll say like levels
- 49:26of abstraction. You could sort of ask it to describe it like at a very top level, or you can get really
- 49:30precise, like for this line, what are all the implications if I change a variable or something like that?
- 49:34Yeah, that's really cool. I suppose you could do that here. Can you can you converse with it? You
- 49:39can say, okay, you gave me this. Does it I guess what's the word? Does it have like tokens in context
- 49:43like chat HTTP does? Can you say, okay, that's cool. But but I want as integers, not as strings.
- 49:50I don't know. Yeah, I did. I did not include that in this. There was a version that had something like
- 49:55that, where I was sort of just keeping the last few calls around. But it quickly became it didn't align
- 50:00with the Jupyter IDE experience, because you end up like scrolling up and down. And it you have too much
- 50:04power over how you execute in a Jupyter notebook. So your context can change dramatically by just scrolling
- 50:10up. And trying to via inspect look across different like, across a Jupyter notebook is just a whole
- 50:16other nightmare. So yeah, I didn't try and like extract the code out of the notebook so that it
- 50:20could understand the local context. You could go straight to chat HTTP or something like that,
- 50:23take what it gave you and start asking it questions.
- 50:26Okay, so another question that I had here about this. So in order for that to do its magic,
- 50:32like you said, the really important thought or breakthrough or idea you had was like, not just
- 50:37the structure of the pandas code or anything like that, but also a little bit about the data.
- 50:41What is the privacy implications of me asking this question about my data? Suppose I have
- 50:47super duper secret CSV. And should I not ask or how to on it? Or what is the story there?
- 50:55What's the, if I work with data, how much sharing do I do of something I might not want to share if I
- 51:02ask a question about it?
- 51:04I'd say the same discretion you'd use if you would copy like a row or a few rows of that data into
- 51:09a, into ChatGPT to ask it a question about it.
- 51:12Okay.
- 51:12Is the level of concern I guess you should have like on the specifically, I am not storing these
- 51:19things, but I know is at least it was, it seems like they're going to start getting towards like a 30
- 51:24day thing. But, so there's a little bit of, yeah, I mean, you're sending your stuff over the
- 51:28wire, like over network, if you do this and to use these language models until they come local,
- 51:32until these things like llama and alpaca get good enough that they're, yeah, they're going to be
- 51:37remote. Actually, that could be a fun, sorry. I just now thought that could be a fun thing. Like
- 51:41just go get alpaca working with a sketch so that it can be fully local.
- 51:45Interesting. Like a privacy preserving type of deal.
- 51:48Yeah. I hadn't actually, yeah, that's the, that's the power of these, smaller models that are
- 51:52almost good enough. I could probably just like quickly throw that in here and see if it,
- 51:56yeah, maybe it's a wider audience.
- 51:57You have a option to not get through your API, but directly go to OpenAI. You could have another
- 52:04one to pick other, other options, right? Potentially.
- 52:07Yep. Yep. Yep. The, interface to these, one thing that I think is not, maybe it's talked
- 52:14about it more than other places, but I haven't heard as much like excitement about it is that these,
- 52:17uh, the APIs have gotten pretty nice for this whole space. the, they're all like the idea of a
- 52:23completion endpoint is pretty straightforward. You send it some amount of text and it will continue
- 52:28that text. And it's such a, it's so simple, but it's so generalizable. You could build so many
- 52:32tools off of just that one API endpoint essentially. And so combine that with an embedding endpoint and
- 52:38you sort of have all you need to, to make complex AI apps.
- 52:41It's crazy. Speaking of making AI apps, maybe touch a bit on your, your other projects, Lambda.
- 52:48So yeah, Lambda. Yeah.
- 52:50But before you get into it, mad props for like Greek letter, like that's a true physicist or
- 52:56mathematician that I can appreciate that there.
- 52:59Yeah. That was, I was excited to put it everywhere, but then of course,
- 53:02these things don't playing, playing games with character sets and websites. I'm the one that
- 53:08causes, I both feel the pain, have to clean the data that I also put into these systems.
- 53:13So yeah. Yeah. People are like a prompt and why is the a so italicized? I don't get it.
- 53:17Yeah. Okay. Yeah. So yeah. Yeah. So this one came, I was, working with, this is pre GPT.
- 53:25This is October. I guess it was right around ChatGPT coming out like around that time.
- 53:29But I was, I was really just messing around a lot with, completion endpoints as we were talking.
- 53:32And I kept rewriting the same request boiler over and over. And then I also kept rewriting
- 53:38f-strings that I was trying to like send in. And I was just like, ah, Jinja templates solved this
- 53:43already. Like there already is formatting for strings in Python. Let me just use that, compose that into a
- 53:49function. And there's, let me call these completion endpoints. I don't want to think of them as like
- 53:53API endpoint or RPC is a nice mental model, but I want to use them as functions. I want to be able to
- 53:59put decorators on them. I want to be able to use them both async or not async in Python. I want to,
- 54:05I just want to have this as a thing that I can just call really quickly with one line and just do
- 54:10whatever I need to with it. And so through this together, it's very simple. Like, honestly, I mean,
- 54:15like the hardest part was just getting all the layers of, there's actually two things you
- 54:20can make a prompt that then, cause I wrap any function as a prompt. So not just, these
- 54:26calls to GPT and then I do tracing on it. So as you like get into the call stack, every input and output
- 54:32is you can sort of like get hooked into and trace with some like call traces. So there's a bunch of just
- 54:38like weird stuff to make the utility nice, but functionally, as you can see here on it's,
- 54:42you just import it, you write a Jinja template with the class, and then you use that object that
- 54:48comes back as a function and your Jinja template variables get filled in. And your result is the
- 54:53text string that comes back out of a GPT. Interesting. And people probably, some people
- 54:57might be thinking like Jinja, okay, well I got to create an HTML file and all that, like not just a
- 55:02string that has double curlies for turning stuff into like strings within the string, kind of a different
- 55:08way to do f-strings as you were hinting at. Yeah. Yeah. There was a two pieces here. I realized as
- 55:13I was doing this also, I think I sort of mentioned with a sketch I do. I really often was taking the
- 55:18output of a language model prompt, doing something in Python, or actually I can do a full example of
- 55:24the SQL writing like exploration we did, but, we would do these things, that were sort of run
- 55:31GPT three to ask it to write the SQL. You take the SQL, you go try and execute it, but it fails for
- 55:38whatever reason, or you, and you take that error, you say, Hey, rewrite it. So we talked about that
- 55:42sort of pattern, which is sort of like rewriting. Another one of the patterns was increase the
- 55:46temperature, ask it to write the SQL. You get like 10 different SQL answers in parallel. And this is where
- 55:52the async was like really important for this. Cause I just wanted to use asyncio gather and run all 10
- 55:57of these truly in parallel against the open eye endpoint, get 10 different answers to the SQL,
- 56:02run all 10 queries against your database, then pull on what the most common, like of the ones that
- 56:08successfully ran, which ones gave the same answer the most often, then that's probably the correct
- 56:12answer. And, just chaining that stuff. It's like very pythonic functions. Like you can really
- 56:19just imagine like, Oh, I just need to write a for loop. I just need to run this function, take the
- 56:22output feed into another function, very procedural. But when you, all the abstractions in the
- 56:28open at OpenAI API, the things like just everything else, there was nothing else really at the time,
- 56:34but even the new ones that have come out like Lang chain that have sort of like taken the space by
- 56:38storm now are not really just trying to offer the minimal ingredient, which is the function.
- 56:43And to me, it was just like, if I can just offer the function, I can write a for loop. I can write,
- 56:47I can store a variable and then keep passing it into it. You could do so many different
- 56:51emergent behaviors with just starting with the function and then simple Python, scripting
- 56:56on top of it.
- 56:57And there's some interesting stuff here, land of prompt. So you can start, you can kind of start
- 57:04it, set it. I don't know what chat GDP, you can tell it a few things. I'm going to ask you a question
- 57:09about a book. Okay. The book is a choose your own adventure book. Okay. Now here I'm going to like,
- 57:14you can prepare it, right? There's probably a more formal term for that, but you can do this here.
- 57:19Like you can say, Hey system, you are a type of bot. And then you, that creates you an object that
- 57:25you can have a conversation with. And you say, what should we get for lunch? And your type of bot is
- 57:29pirate. And then so to say, as a pirate, I would suggest we have some hearty seafood or whatever,
- 57:33right? Like that's, that's beyond what you're doing with sketch. I mean, obviously this is not so much
- 57:37for code. This is like conversing with Python rather than in Python. I don't know. And your editor.
- 57:42Yeah. This one was the OpenAI chat API endpoint came out and I was just like, Oh, I should support
- 57:49it. So that's what this, I wanted to be able to Jinja template inside of the conversation. So you
- 57:53can imagine a conversation that is prepared with like seven steps back and forth, but you want to hard
- 57:59code with the conversation, like how the flow of the conversation was going. And you want to template
- 58:02it so that like on message three, it put your new context problem on message four, it put the output
- 58:08from another prompt that you ran on message five. It is this other data thing. And then you ask it to
- 58:13complete this, the intent of like, it's arbitrarily complex, but still something like that
- 58:18would be, you know, just three lines or so in Lambda prompt. The idea was that it would offer up a really
- 58:23simple API for this. Well, other thing that's interesting is of an async and async version. So that's,
- 58:28that's cool. People can, can check that out. Also a way to make it a hosted as a web service with say
- 58:35like FastAPI or something like that. Yeah. And you can make it a decorator if you like an app prompt
- 58:42decorator. Yeah. On any function you can just throw app prompt and it, it wraps it with the same class
- 58:47so that all the, all the magic you get from that works. The server bit is I took, so FastAPI has
- 58:54that sort of like inspection on the function, part. I did a little bit of middleware to get the
- 59:00two happy together. And then all you have to do is import FastAPI and then run, you know, Gunicorn
- 59:06that app. And, it's two lines and any prompts you have made become their own independent rest
- 59:14endpoint where you can just do a get or a post to it. And it returns the response from calling the prompt.
- 59:20But these prompts can also be these chains of prompts. Like one prompt can call another prompt,
- 59:24which can call another prompt. And those prompts can call async to not async back to async and things
- 59:28like that. And it should work. Pretty sure this one actually, I did test everything as far as I know,
- 59:34I'm pretty sure I've got pretty good coverage. So yeah, super cool. All right. Well get a little
- 59:39short on time, but I think people are going to really, really dig this, especially sketch. I think
- 59:43there's a lot of folks out there doing pandas that would love an AI buddy to help them
- 59:50do things like not just analyze the code, but the data as well.
- 59:55Yeah. Just, I think, anybody's, I know it's for me, but it's just like copilot in
- 59:59VS Code ID, sketch in your Jupyter ID, takes almost nothing to add. And you,
- 1:00:05whenever you're just sort of sitting there, you think you're about to alt tab to go to Google. You
- 1:00:08could just try the sketch.ask and it's surprising how often that sketch.ask or sketch.howto gets you
- 1:00:14way closer to a solution without even having to leave the, you don't even have to leave your,
- 1:00:17your environment. It's like a whole other level of autocomplete for sure. And super cool. All right.
- 1:00:23Now, before I let you out of here, you got to answer the final two questions. If you're going to write
- 1:00:27some Python code and it's not a Jupyter notebook, what editor are you using? It sounds to me like you may
- 1:00:33have just given a strong hint at what that might be. Yeah. I've switched almost entirely to VS Code.
- 1:00:38and I've been really liking it with the remote development and, like it's just, I work
- 1:00:43across like many machines, both cloud and local and some like five, six different machines are my
- 1:00:48like primary working machines. And I use the remote, VS Code thing. And it just, I have a unified
- 1:00:53environment that gives me terminal, the files and the code all in one and copilot on all of them.
- 1:00:59Yeah. It's wild. All right. And then notable pipe UI package. I mean, pip install sketch,
- 1:01:04you can throw that out there if you like. That's pretty awesome. But anything you've run across
- 1:01:08you're like, Oh, this is people should know about this. Yeah. It doesn't have to be popular. Just
- 1:01:12like, Oh, this is cool. In the, I guess these, these two are very popular, but, in the data
- 1:01:17space, I really, I'm a huge fan of, Ray and, also arrow. Like I use those two tools as like
- 1:01:25my backend bread and butter for everything I do. And so those have just been really great work.
- 1:01:30Apache arrow. Right. And then Ray, I'm not sure. Yeah. Ray is a distributed, scheduling compute
- 1:01:38framework. It's sort of like a, right. I don't know what they, yeah. I remember seeing about this.
- 1:01:42Yeah. This is a, it is, I'm parsing, he didn't talk about other things, but I'm like parsing common
- 1:01:47crawl, which is like 25 petabytes of data. And, Ray is great. It's just the workhorse. It power is
- 1:01:53really useful. Like I find it's so snappy and good, but it offers everything I need in a distributed
- 1:02:00environment. So I can write code that runs on a hundred machines and not have to think about it.
- 1:02:05It works really well. That's, that's pretty nuts. Not as nuts as chat GDP and mid journey,
- 1:02:09but it's still pretty nuts. So before we call it a date, do you want to tell people about approximate
- 1:02:14labs? It sounds like you guys are making some good progress. I might have some, some jobs for people
- 1:02:19to work in this kind of area as well. Yeah. So, we're, we're working at the intersection
- 1:02:23of, AI and tabular data. So anything related to these training, these large language models,
- 1:02:28and also, tabular data. So things with_columns and rows, we are trying to like solve that problem,
- 1:02:32try and bridge the gap here. Cause there's a pretty big gap. We have three main initiatives
- 1:02:37that working on, which is we're trying to build up the data set of data sets. So just like the pile
- 1:02:41or the stack or lay on five B these like big data sets that were used to train all these big
- 1:02:46models. We're making our own on tabular data. We are training models. So this is actually
- 1:02:51training large language models, doing these training, these full transformer models.
- 1:02:55And then we're also building apps like sketch, like UIs, things that are actually there to help
- 1:03:00make data more accessible to people. So anything that helps people get value from data and make it open
- 1:03:05source. That's what we're working on. We just, raised our seed round. So we are now officially
- 1:03:11hiring. So, looking for people who are interested in the space and who are enthusiastic
- 1:03:15about these problems. Awesome. Well, very exciting demo libraries, I guess, however you call them.
- 1:03:23But I think this, I think these are neat. People are going to find a lot of cool uses for them. So
- 1:03:27excellent work and congrats on all the success so far. It sounds like you're just starting to take
- 1:03:32off. Yeah. Thank you. All right, Justin, final call to action. People want to get started.
- 1:03:36Let's pick sketch. People want to get started with sketch. What do you tell them?
- 1:03:39Just, pip install it. Give sketch a, give sketch a try, pip install it,
- 1:03:43import it, and then throw it on your data frame. Awesome. And then ask it questions or how tos.
- 1:03:49Yeah. Yeah. Yep. Whatever you want. if you really, if you really want to, and you,
- 1:03:53you trust the model, like throw some, applies and have it clean your data for you. Cool.
- 1:03:57Awesome. All right. Well, thanks for being on the show.
- 1:04:00Come in here and tell us about all your work. It's great. Yeah. Thank you. Yeah. See you later.
- 1:04:04Thanks for having me.
- 1:04:05This has been another episode of talk Python to me. Thank you to our sponsors. Be sure to check out
- 1:04:11what they're offering. It really helps support the show. Stay on top of technology and raise your value
- 1:04:16to employers or just learn something fun in STEM at brilliant.org. Visit talkpython.fm/brilliant
- 1:04:24to get 20% off an annual premium subscription. Want to level up your Python? We have one of the largest
- 1:04:30catalogs of Python video courses over at talk Python. Our content ranges from true beginners
- 1:04:35to deeply advanced topics like memory and async. And best of all, there's not a subscription in
- 1:04:40sight. Check it out for yourself at training.talkpython.fm. Be sure to subscribe to the show,
- 1:04:45open your favorite podcast app and search for Python. We should be right at the top. You can also find
- 1:04:51the iTunes feed at /itunes, the Google play feed at /play and the direct RSS feed at slash
- 1:04:57RSS on talkpython.fm. We're live streaming most of our recordings these days. If you want to be part of
- 1:05:03the show and have your comments featured on the air, be sure to subscribe to our YouTube channel at
- 1:05:08talkpython.fm/youtube. This is your host, Michael Kennedy. Thanks so much for listening. I really
- 1:05:14appreciate it. Now get out there and write some Python code.
- 1:05:16I'll see you next time.