Skip to content

Instantly share code, notes, and snippets.

View cedrickchee's full-sized avatar
⚒️
⚡ 🦀 🐿️ 🐘 🐳 ⬡ ⚛️ 🚢 🚀 🦄 🍵

Cedric Chee cedrickchee

⚒️
⚡ 🦀 🐿️ 🐘 🐳 ⬡ ⚛️ 🚢 🚀 🦄 🍵
View GitHub Profile
@cedrickchee
cedrickchee / vim-thoughts.md
Last active August 11, 2023 16:19
VIM is more than just a code editor

VIM Thoughts and Software Enshittification

I recently learned a new meme (word?), "enshittification".

Quoting the article:

Here is how platforms die: first, they are good to their users; then they abuse their users to make things better for their business customers; finally, they abuse those business customers to claw back all the value for themselves. Then, they die.

The writer called this enshittification.

@cedrickchee
cedrickchee / leaked-sys-prompts.md
Last active March 25, 2024 15:41
Leaked System Prompts
@cedrickchee
cedrickchee / llama2c-micro-llm.md
Last active March 10, 2024 17:46
Llama2.c — The rise of micro-LLMs (Large Language Models)

Llama2.c — The rise of micro-LLMs (Large Language Models)

Status: Draft

A glimpse into the future of smaller, better models.

I like llama2.c contributing guide. It motivates me to write this post.

Below is a copy of it.

@cedrickchee
cedrickchee / llama-home.md
Created July 12, 2023 05:22 — forked from rain-1/llama-home.md
How to run Llama 13B with a 6GB graphics card

This worked on 14/May/23. The instructions will probably require updating in the future.

llama is a text prediction model similar to GPT-2, and the version of GPT-3 that has not been fine tuned yet. It is also possible to run fine tuned versions (like alpaca or vicuna with this. I think. Those versions are more focused on answering questions)

Note: I have been told that this does not support multiple GPUs. It can only use a single GPU.

It is possible to run LLama 13B with a 6GB graphics card now! (e.g. a RTX 2060). Thanks to the amazing work involved in llama.cpp. The latest change is CUDA/cuBLAS which allows you pick an arbitrary number of the transformer layers to be run on the GPU. This is perfect for low VRAM.

  • Clone llama.cpp from git, I am on commit 08737ef720f0510c7ec2aa84d7f70c691073c35d.
@cedrickchee
cedrickchee / software-craftmanship-wisdom.md
Created May 30, 2023 06:40
What I've Learned in 45 Years in the Software Industry

What I've Learned in 45 Years in the Software Industry

BTI360 teammate Joel Goldberg recently retired after working in the software industry for over four decades. When he left he shared with our team some of the lessons he learned over his career. With his permission, we reshare his wisdom here.

Looking back on four decades in the software industry, I’m struck by how much has changed. I started my career with punch cards and I am ending in the era of cloud computing. Despite all this change, many principles that have helped me throughout my career haven’t changed and continue to be relevant. As I step away from the keyboard, I want to share six ideas I’ve learned from my career as a software engineer.

1. Beware of the Curse of Knowledge

When you know something it is almost impossible to imagine what it is like not to know that thing. This is the curse of knowledge, and it is the root of countless misunderstandings and inefficiencies. Smart people who are comfortable with complexity can be especi

@cedrickchee
cedrickchee / ai-plugin.json
Created March 25, 2023 14:22 — forked from danielgross/ai-plugin.json
ChatGPT Plugin for Twilio
{
"schema_version": "v1",
"name_for_model": "twilio",
"name_for_human": "Twilio Plugin",
"description_for_model": "Plugin for integrating the Twilio API to send SMS messages and make phone calls. Use it whenever a user wants to send a text message or make a call using their Twilio account.",
"description_for_human": "Send text messages and make phone calls with Twilio.",
"auth": {
"type": "user_http",
"authorization_type": "basic"
},
@cedrickchee
cedrickchee / alpaca-native-langchain-chatbot-tutorial.md
Last active October 20, 2023 06:58
Creating a chatbot using Alpaca native and LangChain

Creating a chatbot using Alpaca native and LangChain

Let's talk to an Alpaca-7B model using LangChain with a conversational chain and a memory window.

Setup and installation

Install python packages using pip. Note that you need to install HuggingFace Transformers from source (GitHub) currently.

$ pip install git+https://github.com/huggingface/transformers
@cedrickchee
cedrickchee / alpaca-inference.py
Last active March 22, 2023 19:34
HuggingFace Transformers inference for Stanford Alpaca (fine-tuned LLaMA)
# Based on: Original Alpaca Model/Dataset/Inference Code by Tatsu-lab
import time, torch
from transformers import LlamaTokenizer, LlamaForCausalLM, GenerationConfig
tokenizer = LlamaTokenizer.from_pretrained("./checkpoint-1200/")
def generate_prompt(instruction, input=None):
if input:
return f"""The following is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
@cedrickchee
cedrickchee / llama-7b-m1.md
Last active May 2, 2024 12:47
4 Steps in Running LLaMA-7B on a M1 MacBook with `llama.cpp`

4 Steps in Running LLaMA-7B on a M1 MacBook

The large language models usability

The problem with large language models is that you can’t run these locally on your laptop. Thanks to Georgi Gerganov and his llama.cpp project, it is now possible to run Meta’s LLaMA on a single computer without a dedicated GPU.

Running LLaMA

There are multiple steps involved in running LLaMA locally on a M1 Mac after downloading the model weights.

@cedrickchee
cedrickchee / text-generation-webui-guide.md
Created March 12, 2023 12:04
Installing 8/4-bit LLaMA with text-generation-webui on Linux

Installing 8-bit LLaMA with text-generation-webui

Linux

  1. Follow the instructions here under "Installation option 1: conda"

  2. Download the desired Hugging Face converted model for LLaMA here

  3. Copy the entire model folder, for example llama-13b-hf, into text-generation-webuimodels