Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

# ----------------------------------------------------------------------------- | |
# AI-powered Git Commit Function | |
# Copy paste this gist into your ~/.bashrc or ~/.zshrc to gain the `gcm` command. It: | |
# 1) gets the current staged changed diff | |
# 2) sends them to an LLM to write the git commit message | |
# 3) allows you to easily accept, edit, regenerate, cancel | |
# But - just read and edit the code however you like | |
# the `llm` CLI util is awesome, can get it here: https://llm.datasette.io/en/stable/ | |
gcm() { |
from fastapi import Request, HTTPException | |
from pydantic import BaseModel, BaseModel, HttpUrl | |
from modal import Secret, App, web_endpoint, Image | |
from typing import Optional, List | |
from example import proposal | |
import os | |
app = App(name="circleback", image=Image.debian_slim().pip_install("openai", "pydantic", "fastapi")) | |
class Attendee(BaseModel): |
# Code inspired from https://gist.github.com/karpathy/00103b0037c5aaea32fe1da1af553355 | |
# slerp function is entirely lifted from the above gist. | |
import torch | |
from diffusers import DiffusionPipeline | |
import numpy as np | |
def interpolate(v1, v2, step, total_steps): | |
alpha = step / (total_steps - 1) |
""" To use: install LLM studio (or Ollama), clone OpenVoice, run this script in the OpenVoice directory | |
git clone https://github.com/myshell-ai/OpenVoice | |
cd OpenVoice | |
git clone https://huggingface.co/myshell-ai/OpenVoice | |
cp -r OpenVoice/* . | |
pip install whisper pynput pyaudio | |
""" | |
from openai import OpenAI | |
import time |
# !pip install transformers sentencepiece | |
import torch | |
import torch.nn as nn | |
torch.set_grad_enabled(False) | |
from transformers import AutoTokenizer, AutoModelForCausalLM | |
from transformers.activations import ReLUSquaredActivation | |
from collections import defaultdict, OrderedDict |
from transformers import ( | |
AutoConfig, | |
AutoTokenizer, | |
BitsAndBytesConfig, | |
GenerationConfig, | |
AutoModelForCausalLM, | |
LlamaTokenizerFast, | |
PreTrainedModel, | |
TextIteratorStreamer, | |
StoppingCriteria, |
https://github.com/jondurbin/airoboros
pip install --upgrade airoboros==2.0.13
# Clone llama.cpp | |
git clone https://github.com/ggerganov/llama.cpp.git | |
cd llama.cpp | |
# Build it | |
make clean | |
LLAMA_METAL=1 make | |
# Download model | |
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin |