Skip to content

Instantly share code, notes, and snippets.

View kordless's full-sized avatar
🦥
sloth mode

Коrd Campbell kordless

🦥
sloth mode
View GitHub Profile
@kordless
kordless / README.md
Last active January 1, 2024 11:19
Example of using OpenAI functions in completions with Python decorators.

Example of using OpenAI functions in completions with Python decorators

This example illustrates a way to utilize a function dynamically while querying an OpenAI GPT model. It uses the newly released functions support in the completion endpoints OpenAI provides.

The general concept is based on using a decorator to extract information from a function so it can be presented to the language model for use, and then pass the result of that function back to the completion endpoint for language augmentation.

In general, a wide variety of functions can be swapped in for use by the model. By changing the get_top_stories function, plus the prompt in run_conversation, you should be able to get the model to run your function without changing any of the other code.

Configuration

To use this, create a config.py file and add a variable with your OpenAI token:

@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

Keybase proof

I hereby claim:

  • I am quinnnorton on github.
  • I am quinn (https://keybase.io/quinn) on keybase.
  • I have a public key ASBksDACU5UHZpG7xCY0N857FOqqG4F6Vx4Cud1p4jPMFAo

To claim this, I am signing this object:

@MarcelMue
MarcelMue / file.md
Last active August 29, 2015 14:17

#Using the giantswarm CLI on Windows with boot2docker without a additional VM

####prerequisites:

  • Boot2docker should be running on your system and you should have access to it with boot2docker ssh
  • A filepath of your windows system should be mirrored in boot2docker (eg windows C:\\Users\Username should be boot2docker /c/Users/Username)
  • Have a decent console setup to make the following steps easier ( I use Console 2)

####Setup

  • Switch to your boot2docker with boot2docker ssh and download the swarm cli to a location mirrored by windows (eg your project folder) by executing curl -O http://downloads.giantswarm.io/swarm/clients/0.15.0/swarm-0.15.0-linux-amd64.tar.gz
  • run tar xzf swarm-0.15.0-linux-amd64.tar.gzat the same location
@maximebf
maximebf / gist:3986659
Created October 31, 2012 11:56
Jinja2 macro to render WTForms fields with Twitter Bootstrap
{% macro form_field(field) -%}
{% set with_label = kwargs.pop('with_label', False) %}
{% set placeholder = '' %}
{% if not with_label %}
{% set placeholder = field.label.text %}
{% endif %}
<div class="control-group {% if field.errors %}error{% endif %}">
{% if with_label %}
<label for="{{ field.id }}" class="control-label">
{{ field.label.text }}{% if field.flags.required %} *{% endif %}: