Skip to content

Instantly share code, notes, and snippets.

View jasonjmcghee's full-sized avatar
✏️

Jason McGhee jasonjmcghee

✏️
View GitHub Profile
@jasonjmcghee
jasonjmcghee / Modelfile
Last active September 9, 2023 15:42
LLMonitor - CodeLlama - Instruct (7B) :: My Local Results using `Ollama` (Temperature 0)
FROM codellama
PARAMAETER temperature 0
@jasonjmcghee
jasonjmcghee / cached_fn.py
Created May 28, 2023 04:48
Incredibly simple way to cache the output of a function - useful with unreliable LLM APIs
import os
def cached_fn(dir_name: str, file_name: str, fn, verbose=True):
"""
Base the output of a function on a file.
If the file already exists, use it instead of running the function.
If the function was executed, write its output to the provided `dir_name` and `file_name`.
@jasonjmcghee
jasonjmcghee / cached_chroma.py
Last active April 5, 2024 10:24
Cached embeddings in Chroma made easy.
from abc import ABC
from typing import List, Optional, Any
import chromadb
from langchain.docstore.document import Document
from langchain.embeddings.base import Embeddings
from langchain.vectorstores import Chroma
class CachedChroma(Chroma, ABC):
@jasonjmcghee
jasonjmcghee / bestEver.html
Created July 30, 2012 19:32
ICanHaz + Backbone
<!DOCTYPE html>
<html>
<head>
<title>ICanHaz + Backbone</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://underscorejs.org/underscore-min.js" ></script>
<script src="http://backbonejs.org/backbone-min.js" ></script>
<script src="https://github.com/andyet/ICanHaz.js/raw/master/ICanHaz.min.js" ></script>
<script id="user" type="text/html">