Skip to content

Instantly share code, notes, and snippets.

View kordless's full-sized avatar
🦥
sloth mode

Коrd Campbell kordless

🦥
sloth mode
  • Straight outta the 60s.
View GitHub Profile
import openai
import numpy as np
from openai.embeddings_utils import get_embedding
openai.api_key = "TOKEN"
def gpt3_embedding(content, engine='text-similarity-ada-001'):
content = content.encode(encoding='ASCII',errors='ignore').decode()
response = openai.Embedding.create(input=content,engine=engine)
vector = response['data'][0]['embedding'] # this is a normal list
State of AI Report
October 11, 2022
#stateofai
stateof.ai
Ian Hogarth
Nathan Benaich
About the authors
Nathan is the General Partner of Air Street Capital, a venture capital firm investing in AI-first technology and life science companies. He founded RAAIS and London.AI (AI community for industry and research), the RAAIS Foundation (funding open-source AI projects), and Spinout.fyi (improving university spinout creation). He studied biology at Williams College and earned a PhD from Cambridge in cancer research.
Nathan Benaich
@kordless
kordless / README.md
Last active September 28, 2022 15:56
Analyzing 5 Billion Games of Set with FeatureBase

Analyzing 5 Billion Games of Set with FeatureBase

FeatureBase is a binary-tree database built on Roaring Bitmaps. This makes it suitable for running analytics on massive data sets in real time. If you've never used FeatureBase before, you can get it running locally in about 5 minutes.

Today, we're going to take a look at using FeatureBase to simulate and analyze a very large number of Set games in real-time.

Set (the game)

Set is a card game designed by Marsha Falco in 1974 and published by Set Enterprises in 1991. The deck consists of 81 unique cards that vary in four features across three possibilities for each kind of feature: number of shapes (one, two, or three), shape (diamond, squiggle, oval), shading (solid, striped, or open), and color (red, green, or purple).

In a game of Set, the cards are shuffled and then 12 cards are drawn from the top of the deck and placed on the table. Game play then com

@kordless
kordless / README.md
Last active October 6, 2022 04:10
Set Up a FeatureBase Binary Index in 5 Minutes

FeatureBase in 5 Minutes

FeatureBase is a B-tree database built on Roaring Bitmaps. This makes it suitable for running analytics on massive data sets in real time. It's also perfect for use in machine learning applications, where a fast feature store is desired during training or inference. FeatureBase itself may be considered a type of machine learning model which is trained on large amounts of other model's inference data, over time.

This guide is designed to get you started using FeatureBase on a Mac or Linux/UNIX based system. It covers downloading and starting the FeatureBase server as well as ingesting and querying a small amount of data.

You may also want to reference the documentation for FeatureBase after you finish running through this guide.

Install

Start by heading over to the downloads on the Github repo and select the buil

import openai
import numpy as np
from openai.embeddings_utils import get_embedding
openai.api_key = ""
def gpt3_embedding(content, engine='text-similarity-ada-001'):
content = content.encode(encoding='ASCII',errors='ignore').decode()
response = openai.Embedding.create(input=content,engine=engine)
vector = response['data'][0]['embedding'] # this is a normal list
// google docs app
var line = "{{line}}";
if ("{{text}}" == "" && "{{view}}" == "") {
// just nothing
url = "https://docs.google.com/";
} else if ("{{text}}" == "" && "{{view}}" != ""){
// view
var view = "{{view}}".substring(1); // trim the | off (fix this)
if (view == "sheets") {
@kordless
kordless / auth.py
Created March 5, 2021 23:29
Passwordless Authentication for Mitta
import datetime
import logging
import os
import socket
import time
from random import randrange
import urllib.parse
from google.cloud import ndb
@kordless
kordless / timewarp.py
Created March 5, 2021 03:52
Mitta Timewarp
import datetime
from dateutil.relativedelta import relativedelta
import re
# timewarp.py
# Kord Campbell
# Copyright 2020, Mitta Corp.
# All Rights Reserved.
# description: common name to solr timerange converter in python3
@kordless
kordless / models.py
Created March 5, 2021 03:46
Models for Mitta
import datetime
import os
import requests
from google.cloud import ndb
import flask_login
from lib.util import random_string, random_number, generate_token, random_name
from lib.solr import doc_count
@kordless
kordless / spool.json
Last active March 1, 2021 17:25
Upload Reference for Mitta.us
{
"timestamp": "{{timestamp}}",
"request_url": "/g",
"result": "success",
"response": [{
"source_type": "spool",
"created": "{{created}}",
"updated": "{{updated}}",
"name": "{{name}}",
"upload_url": "{{upload_url}}",