Skip to content

Instantly share code, notes, and snippets.

View davo's full-sized avatar
🏠

Davo Galavotti davo

🏠
View GitHub Profile
@virattt
virattt / rag-reranking-gpt-colbert.ipynb
Last active March 30, 2024 18:26
rag-reranking-gpt-colbert.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@astuyve
astuyve / deny_snippet.json
Created January 17, 2024 15:00
Deny cloudwatch permissions from Lambda to save money
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
@yuinchien
yuinchien / glossary.md
Last active February 3, 2024 16:31
AI Glossary
TERM DEFINITION SOURCE LINK
AGI. Artificial General Intelligence An AGI could learn to accomplish any intellectual task that human beings or animals can perform. Alternatively, AGI has been defined as an autonomous system that surpasses human capabilities in the majority of economically valuable tasks. Source
Adversarial suffix A string of random seeming characters, to a prompt that makes the LLM significantly more likely to return an unfiltered response. Source Demo
AI. Artificial Intelligence Artificial intelligence (AI) is the intelligence of machines or software, as opposed to the intelligence of humans or animals. It is a field of study in computer science which develops and studies intelligent machines. [Source](https://en.wikipedia.org/wiki/Artificial
@ZeldOcarina
ZeldOcarina / AirtableConnector.ts
Created September 5, 2023 18:50
A simple way to fetch Airtable API
import * as path from "path";
import * as fs from "fs";
import axios, { AxiosError, type AxiosInstance } from "axios";
import airtableDefaults from "./constants/airtable-defaults";
const fsPromises = fs.promises;
const MAX_RETRIES = 3; // Number of times to retry after hitting rate limit
const RETRY_DELAY = 30 * 1000; // 30 seconds in milliseconds
from langchain.document_loaders import YoutubeLoader
from langchain.indexes import VectorstoreIndexCreator
urls = [
("https://www.youtube.com/watch?v=fP6vRNkNEt0", "Prompt Injection"),
("https://www.youtube.com/watch?v=qWv2vyOX0tk", "Low Code-No Code"),
("https://www.youtube.com/watch?v=k8GNCCs16F4", "Agents In Production"),
("https://www.youtube.com/watch?v=1gRlCjy18m4", "Agents"),
("https://www.youtube.com/watch?v=fLn-WqliEQU", "Output Parsing"),
("https://www.youtube.com/watch?v=ywT-5yKDtDg", "Document QA"),
("https://www.youtube.com/watch?v=GrCFyyyAxCU", "SQL"),
@alex-streza
alex-streza / FigmaProvider.ts
Created February 10, 2023 22:10
Figma OAuth Provider implementation for Auth.js (previously next-auth)
import { Provider } from "next-auth/providers";
export const FigmaProvider: Provider = {
id: "figma",
name: "Figma",
type: "oauth",
authorization: {
url: "https://www.figma.com/oauth",
params: {
scope: "file_read",
export const chaosTestStrings = (): void => {
const textNodes = getAllTextNodes(document.body);
for (const node of textNodes) {
const textNodeLength = node.textContent ? node.textContent.length : 0;
if (node.textContent === null) {
return;
}
if (node.parentElement instanceof Element) {
if (node.parentElement.dataset.originalText === undefined) {
[
{
"gameTime": "2022-11-20T16:00:00Z",
"homeTeam": "cat",
"awayTeam": "equ"
},
{
"gameTime": "2022-11-21T13:00:00Z",
"homeTeam": "ing",
"awayTeam": "ira"
@madebyollin
madebyollin / stable_diffusion_m1.py
Last active February 10, 2024 02:25
Stable Diffusion on Apple Silicon GPUs via CoreML; 2s / step on M1 Pro
# ------------------------------------------------------------------
# EDIT: I eventually found a faster way to run SD on macOS, via MPSGraph (~0.8s / step on M1 Pro):
# https://github.com/madebyollin/maple-diffusion
# The original CoreML-related code & discussion is preserved below :)
# ------------------------------------------------------------------
# you too can run stable diffusion on the apple silicon GPU (no ANE sadly)
#
# quick test portraits (each took 50 steps x 2s / step ~= 100s on my M1 Pro):
# * https://i.imgur.com/5ywISvm.png