Membrane S3 sink

The membrane_s3_plugin(as of version 0.1.2) has gotten outdated with changes in membrane_core. Here's an S3 sink implementation that works with the latest Membrane: defmodule Membrane.S3.Sink do @moduledoc """ Element that uploads incoming buffers to an S3 bucket. Pipeline…

[Video] Testing Google Gemini Audio Capabilities

Gemini with audio Video Code Mix.install([ {:req, "~> 0.4.14"}, {:kino, "~> 0.12.0"} ]) Form form = Kino.Control.form( [ prompt: Kino.Input.textarea("Prompt"), audio: Kino.Input.audio("Audio", format: :wav) ], submit: "Submit" ) frame = Kino.Frame.new(…

TIL: Sum Types With `instructor_ex`

The Instructor Elixir library lets you retrieve structured output from LLMs like the OpenAI GPT models. But I found that having it return structs that are sum types is not that straightforward. Simple Instructor responses For this post, let’s looks at survey questions as an example. You can define…

TIL: File Uploads Using the Req Elixir Library

The Req Elixir library doesn’t support file uploads(as of version 0.4.5). Instead, you need to use multipart to construct the HTTP request before you send it. Here is an example sending an mp3 file to the OpenAI audio transcription API(aka Whisper): def transcribe_audio(file_…

TIL: Creating `sentence-transformers` Embeddings From Bumblebee

One amazing thing about the Elixir machine learning ecosystem is that you can run state-of-the-art ML models right from Elixir. You can go pick your favorite Hugging Face model and get it running without any ceremony. I was recently creating text embeddings using Bumblebee, and realized that some of the…