Skip to content

Instantly share code, notes, and snippets.

View dalequark's full-sized avatar
💭
🪂 slacking

Dale Markowitz dalequark

💭
🪂 slacking
View GitHub Profile

Big Context Windows are a Bigger Deal Than You Think

This blog post was generated by Gemini 1.5 in the style of DaleOnAI.com

Remember when we used to marvel at LLMs that could handle a few thousand tokens of context? Well, hold onto your hats, folks, because Google just dropped Gemini 1.5, a multimodal LLM with a 1 million token context window. That's not just a bigger window, it's a whole new way of looking at how we interact with LLMs.

Sure, the ability to dump massive documents, movies, and audio into a single prompt is cool. Imagine asking an LLM to compare two movies after consuming both in their entirety, or to summarize a dense legal document. But the real magic of Gemini 1.5 isn't just the size of the window, it's the near-perfect recall and improved reasoning that comes with it.

Jeff Dean himself pointed out the significance of this breakthrough on Twitter, referencing DeepMind's "needle in a haystack" tests. These tests showed that Gemini 1.5 can not only access millions of tokens, b

@dalequark
dalequark / objecttracker.js
Created June 18, 2021 21:11
Simple object tracker
function huntForPets(monitoredItem, detectionArray, target) {
// naughtyAnimals is an array that keeps track of each animal are in frame
var naughtyAnimals = [];
// Loop through all of the objects recognized by the API
for (let i = 0; i < detectionArray.length; i++) {
// If we found one of the objects we were looking for...
if (detectionArray[i].class === target && detectionArray[i].score > MIN_DETECTION_CONFIDENCE) {
// Draw a bounding box on screen
renderFoundObject(detectionArray[i]);
@dalequark
dalequark / bbox_distance.js
Created June 17, 2021 21:43
bbox distance
class BBox {
constructor(bbox) {
let x = bbox[0];
let y = bbox[1];
this.width = bbox[2];
this.height = bbox[3];
this.midX = x + this.width / 2;
this.midY = y + this.height / 2;
}
@dalequark
dalequark / webcam_obj_detection.html
Last active June 18, 2021 23:34
Webcam object detection
<!-- Load TensorFlow.js. This is required to use coco-ssd model. -->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs"> </script>
<!-- Load the coco-ssd model. -->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/coco-ssd"> </script>
<script>
// Grab DOM reference to video element.
const video = document.getElementById('webcamVideo');
@dalequark
dalequark / stt_api_output.json
Created February 2, 2021 23:07
stt_api_output.json
[
{
"transcript": "Software developers. We're not known for our Rock and style. Are we or are we today? I'll show you how I use ml to make new trendier taking inspiration from influencers. I'm going to build an app that analyzes my closet and pictures of fashionable influencers and then makes me outfit recommendations. If I'm missing an important piece will also recommend me products to buy let me show you how",
"words": [
{
"word": "Software",
"start_time": 0.2,
"end_time": 0.6,
"speaker_tag": 0
},
@dalequark
dalequark / spreadsheet.gs
Created December 1, 2020 22:18
Spreadsheet NLP on GCP
/**
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
def canAddItem(existingArray, newType):
bottoms = {"pants", "skirt", "shorts", "dress"}
newType = newType.lower()
if newType in existingArray:
return False
if newType == "shoe":
return True
if newType in bottoms and len(bottoms.intersection(existingArray)):
return False
if newType == "top" and "dress" in existingArray:
@dalequark
dalequark / rtt2
Created August 6, 2020 00:06
rtt2
sudo apt-get update && sudo apt-get install -y git python3-dev python3-pygame python3-venv libatlas-base-dev libasound2-dev python3-pyaudio
sudo cp /usr/share/alsa/alsa.conf /usr/share/alsa/alsa.conf.orig
@dalequark
dalequark / rtt1
Last active August 6, 2020 00:05
dalessickgist
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
sudo apt-get install apt-transport-https ca-certificates gnupg
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
sudo apt-get update && sudo apt-get install google-cloud-sdk
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list