Weeknotes 2023-04-24
,Me, walking up to the front desk of the hotel: I have a weird question
Clerk: there are no weird questions
Me: I have an NFC chip implanted in my hand, and I was wondering whether you'd be willing to enroll it as a new key for my room
Clerk: you want me to do what?? I need to see this. What room?
Didn't even ask for ID.--Quinn Wilton
This past week was quite eventful 😅. On Monday morning, I had an emergency dental appointment due to a broken tooth crown 😬. Following that, I attended the Beyond Tellerrand conference on Monday and Tuesday, which proved to be an excellent experience filled with inspiring talks and engaging conversations with fellow attendees. A special shoutout and warm greetings to the hosts of the WWSIV podcast 🎙️!
Throughout the week, I attempted to make django-cast compatible with the upcoming Wagtail 5 release, but faced challenges mainly due to the usage of modules from 'wagtail.core' in migrations 🐛 and the removal of 'image_node.filter_spec' attribute. Additionally, I had to resolve an issue with old comments being invisible on python-podcast.de as a result of the migration to Wagtail and changes to the Django episode model's primary keys 🔧 - thanks to Norbert for the heads up. Unfortunately, there was no django-cast release this week 😞.
In my spare time, I delved into my new LLM hobby by starting to read the "Natural Language Processing with Transformers" book 📚. On Friday morning, I attended a Creative Mornings talk discussing ChatGPT and midjourney, though it didn't present much new information for me 🤷♀️ but the room was packed and there seems to be a lot of buzz around this topic. Later that day, I attempted to record a screencast with Manuel about the "nlp with transformers"-book and some LLM implementation stuff, but we faced technical difficulties with real-time collaboration on Jupyter notebooks. I subsequently wrote a TIL post about the experience, hoping that for our next screencast, it will work better 🤞.
Lastly, I managed to take some time and enjoy the outdoors – very good! 🌳
Articles
- The /now page movement | Great idea, didn't know about this! Will probably adopt this.
- Ruleset interpolation Explainer | Useful CSS stuff
- Statement from the listed authors of Stochastic Parrots on the “AI pause” letter | Ok, not so bad
- Replacing my best friends with an LLM trained on 500,000 group chat messages
- Why I am excited about ChatGPT | "Calculator for writing" - yup...
- How Shadow DOM and accessibility are in conflict
- Using Unpoly with Django
- The AI Economist: Optimal Economic Policy Design via Two-level Deep Reinforcement Learning
- Scaffolded LLMs as natural language computers
Weeknotes / Newsletter
- Weeklog for Week 15: April 10 to April 16 | Johannes
- Week in Review 2023-04-17 | Luis
- Science and Technology links (April 22 2023) | Daniel Lemire
- css-layout issue 343: Asking for help and use cases for a CSS layout accessibility issue. Also, lots of exciting things landing in browsers over the past few weeks. | Rachel Andrew
- Introducing Neapolitan | Carlton Gibson
Software
- GREASE - Grease is a website starter that makes building performant, accessible, aesthetic websites fast & frictionless
- Node.js 20 Now Available
- you.com - The AI Search Engine You Control
- Wavelength Messenger
- I know this has been around a bit, but the Netlify drop interface is rad
- recursive.design - A typographic palette for vibrant code & UI
Cool Websites
Podcasts
- #118 - Anthropic vs OpenAI, AutoGPT, RL at Scale, AI Safety, Memeworthy AI Videos (Last Week in AI) | Last Week in AI is one of the best AI news podcasts I discovered so far
- Revision 565: Quo vadis Frontend-Tooling? (Working Draft)
- AI – mehr als ChatGPT? mit Philipp Schmid von Hugging Face (programmier.bar) | Meh
- S3 E6 Richard Socher joins Host Pieter Abbeel: LLMs, Search, You.com, AGI, Metamind, AIX Ventures (The Robot Brains) | Great episode! Didn't know Richard Socher was one of the first investors in huggingface...
- WR1479 Bank Run, Klimageld und Spitzensteuer (Wirtschaftskunde) | Always great!
- #111 - Julian asks Bob about his use of ChatGpt (PyBites Podcast) | Meh
- „Jetzt kommt das goldene KI-Zeitalter“ (Künstliche Intelligenz) | Well, what I take away from this episode is that good consulting is in high demand right now 😇 (I'm available, just saying..).
Out of Context Images
TIL: Real-time Collaboration for Jupyter Notebooks
,While preparing a screencast with Manuel, we searched for real-time collaboration tools for Jupyter notebooks. JetBrains' "Code With Me" proved unsuitable, displaying only raw JSON. Here are two practical alternatives:
- Visual Studio Code's "Live Share" extension
- Launching JupyterLab server like this:
jupyter-lab --collaborative
If you're aware of other collaboration tools for Jupyter notebooks suited for screencasts, please drop me a note 😄!
Weeknotes 2023-04-17
,I use keming as an adjective to describe bad kerning --Xe
Worked a little bit on the upcoming pytest-course. My wife made a website for Thomy Saurk which was going live last week. Then there was a new django-cast release. It provides some fixes for the podcast_audio
field (if it's not set there's no twitter-card and the episode is not showing up in the feed) and it's now possible to add custom templates for error views (for 404, 500, 403 etc HTTP status codes) if you create a theme for django-cast.
And after two or three years of using PyCharm or vs code for writing Python almost exclusively, I started to use vim and neovim again and spent already a significant amount of time on their configuration 😅. But I missed using vim for sure.
Articles
- Set Studio: respecting the fabric of the internet | Case study
- Top 10 Django Third-Party Packages | No surprises here...
- PostgreSQL® JSONB Cheatsheet: Complete & Fast Lookup Guide
- An example of LLM prompting for programming
- Science and Technology links (April 11 2023)
- Deploying key transparency at WhatsApp
- We must slow down the race to God-like AI | Despite the clickbait title, this article is actually good
- Running Tasks Concurrently in Django Asynchronous Views
- Reduce - The Power of a Single Python Function
- Prompt injection: what’s the worst that can happen?
- Color Theme Switcher
Video
- Sparks of AGI: early experiments with GPT-4 | I wouldn't call it AI leave alone AGI, but there's something, yep
- Modern Web Development: Centering DIVs in new exciting wrong ways with AI!
Books
Weeknotes
- Weeklog for Week 14: April 03 to April 09 | Johannes
- April Week 14 | Bithive
- Week in Review 2023-04-10 | Luis
Mastodon / Twitter
- Gene Hackman would be the perfect name for a CRISPR engineer.
- I remember Max Keiser calling this the most revolutionary graph he'd ever seen
- Fantastic #TomLehrer content in today's FT
Software
- htmx release 1.9.0
- httpx release 0.24.0
- Neapolitan - easy crud views for Django
- List of LLaMA models | Lots of interesting links...
- Python 3.11.3
- fedifeed - Display Mastodon Posts in a curated feed with an user-customisable algorithm
- Paperless-ngx is a document management system that transforms your physical documents into a searchable online archive so you can keep, well, less paper
- The RWKV Language Model (and my LM tricks)
- DeepSpeed Chat: Easy, Fast and Affordable RLHF Training of ChatGPT-like Models at All Scales
- Unpoly - The unobtrusive JavaScript framework for server-side web applications
- Enhance - The HTML first full stack web framework
- Image BPP Calculator
- zola (né Gutenberg) - A fast static site generator in a single binary with everything built-in
- Running Jupyter notebooks online | Cool list of sites where you can run your notebooks
Podcasts
- LWiAI Podcast #117 - Google’s Bard Rush, BloombergGPT, ChatGPT King, Balenciaga Harry Potter (Last Week in AI) | Trying to keep up with all this buzz
- #370 – Edward Frenkel: Reality is a Paradox – Mathematics, Physics, Truth & Love (Lex Fridman Podcast)
- The End of Mediocrity (part 2) (Akimbo - A podcast from Seth Godin) | Yup
- ChatGPT Is Not Intelligent w/ Emily M. Bender (Tech Won't Save Us) | Well, I agree with the analysis of why the letter is more of a marketing move and misleading. And I also think there're some valid critical points considering the social implications etc (I'm not an expert on this stuff, but it sounds plausible to me). But most of the technical assumptions and arguments are just wrong. And I have a problem with the structure of the presented arguments (yes, it's that bad). I use this LLM stuff for some time now and it has been really useful for stuff I'm an expert on. Dismissing this utility based on theoretical grounds gives me some strong "Pope vs Galileo - I don't have to look" vibes. TLDR: for this to be considered the strongest criticism, it is pretty weak.
- FS264 Die Große Elchwanderung (Freak Show) | After 1.5 years, finally! 🎉
TIL: Validating Wagtail Page Fields Only Upon Publishing
,Recently, I encountered an issue when publishing a podcast episode about LLMs using django-cast. The episode failed to appear in the podcast feed and the announcement tweet lacked the newly added Twitter card. The cause? I forgot to include the podcast_audio
field.
Ideally, the system should have displayed an error when attempting to publish an episode without the podcast_audio
field. However, we still want to allow draft episodes to be saved without the audio field.
Initial Solution Suggested by ChatGPT
For this LLM-focused episode, I initially sought guidance from ChatGPT. It provided a seemingly promising solution that appeared effective upon first inspection:
class MyCustomPage(Page):
field1 = ...
field2 = ...
...
def clean(self):
super().clean()
# Check if the page is being published
if self.status == 'live':
# Perform custom validation for required fields
if not self.field1:
raise ValidationError({'field1': "Field1 is required for publishing."})
if not self.field2:
raise ValidationError({'field2': "Field2 is required for publishing."})
Upon closer examination, the correct condition should have been if self.status_string == "live"
. However, the proposed solution still didn’t function as intended. Instead of displaying a user-friendly error message in the Wagtail admin interface, attempting to publish an episode without the podcast_audio
field resulted in an unwieldy traceback, which would have led to an internal server error in production.
Revised Solution
The previous solution didn't work, because Wagtail only displays a nice error message when the ValidationError
is raised while it tries to save a draft revision. Therefore we need to raise the ValidationError
during the first call of the clean method where the status_string is still "draft". But how do we know the page is about to be published then?
After tinkering with the before_edit_page
hook for a while, I finally landed on this solution:
class CustomEpisodeForm(WagtailAdminPageForm):
"""
Custom form for Episode to validate the podcast_audio field.
The reason for this is that the podcast_audio field is not required
for draft episodes, but it is required for published episodes. So
we have to check which button was clicked in the admin form.
"""
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields["action-publish"] = forms.CharField(required=False, widget=forms.HiddenInput())
def clean(self) -> dict[str, Any]:
cleaned_data = super().clean()
if cleaned_data.get("action-publish") and cleaned_data.get("podcast_audio") is None:
raise forms.ValidationError({"podcast_audio": _("An episode must have an audio file to be published.")})
return cleaned_data
class Episode(Post):
...
base_form_class = CustomEpisodeForm
This CustomEpisodeForm
class checks whether the “Save draft” or “Publish” button was pressed in the Wagtail admin and stores the information for use in the clean method. This solution successfully validates the podcast_audio field only upon publishing the episode, while still allowing draft episodes to be saved without the audio field.
Weeknotes 2023-04-10
,"for legal reasons this is a joke" --julia, serial project starter
Lots of colored eggs. Short work week where I was collecting some material for an upcoming pytest-course and did some research about this whole shiny new LLM field which is completely wild atm. Recorded a podcast episode about LLMs. Released a new django-cast version with some minor improvements. Fixed a 500 error on this site caused by the csrf-middleware raising an error and context-processors weren't run so the custom error template didn't get its base template (this needs more fixing).
Articles
- Django: Avoid database queries in template context processors | Probably I should get rid of the db query in my theme context processor for django-cast
- Ban 1+N in Django
- Thoughts on a Crazy Week in AI News
- Slack | Martin Fowler on including slack in your iterations
- CAN Injection: keyless car theft | Ahahaha...
- Exclusive: OpenAI Used Kenyan Workers on Less Than $2 Per Hour to Make ChatGPT Less Toxic | Well, just to be able to find the link again. This article does not look credible at all (as well as the whole time.com site, meh).
- Thinking About Code Review | Yep, PRs make sense in an open-source context. Otherwise, not so much...
- What are we going to do about ChatGPT? | More reasonable than the letter
- Programming-language popularity by GitHub pull requests
Mastodon / Twitter
- Everyone needs a break | Webcomic about the need to get away from everything
- Brain vs Sleep webcomic - "pacific ocean"
Freelance
- Double Your Freelancing | Ok, maybe I have to do some marketing...
- 030 | The Side Hustle | The Unspoken Lever of FI | Fixed income would be nice, too
Papers
- Eight Things to Know about Large Language Models | Fascinating
Weeknotes
- Weeknotes: A new llm CLI tool, plus automating my weeknotes and newsletter | Simon Willison
- Weeklog for Week 13: March 27 to April 02 | Johannes
Software
- Django Playwright and Pytest example
- unittest-parametrize | Works like the @pytest.mark.parametrize decorator from pytest
- Django 4.2 released
- Let it be free! Open-sourcing “Baby AGI”, a paired down version of the “Task-Driven Autonomous Agent” at 105 lines of code. Three task agents (execution, creation, prioritization) work in harmony… forever.
- Just been informed that #AutoGPT is ranked #1 trending in the entire world on @Github !🤯
- SentencePiece is an unsupervised text tokenizer and detokenizer mainly for Neural Network-based text generation systems
- Slint 1.0: The Next-Generation Native GUI Toolkit Matures | Native UIs in rust
- pinecone.ai - Long-term Memory for AI
- babyagi - This Python script is an example of an AI-powered task management system | Twitter thread
- Libraries.io monitors 7,144,509 open source packages across 32 different package managers, so you don't have to | Used this to track how many packages depend on packages I wrote...
- Tabby - Self-hosted AI coding assistant. An opensource / on-prem alternative to GitHub Copilot
- opentalk.eu - video conference software which allows self-hosting
Podcasts
- What AI can do for you on Theory of Change (no link to original podcast, since the feed is broken) | Really good episode!
- Soumith Chintala: PyTorch On the past and present of machine learning frameworks, and the story of PyTorch and its creator (The Gradient Podcast) | Interesting
- The Story of Visual Studio Code with Erich Gamma and Kai Maetzel (The Hanselminutes Podcast) | Surprising how early and small vscode started...
- Aidan Gomez, co-founder and CEO of Cohere joins Host Pieter Abbeel to discuss transformers, large language models, command and instruct models, prompt engineering, LLMs competitive landscape (The robot brains)