Skip to content

Instantly share code, notes, and snippets.

View bigsnarfdude's full-sized avatar

BigsnarfDude bigsnarfdude

View GitHub Profile
@bigsnarfdude
bigsnarfdude / tokenization.ipynb
Last active February 29, 2024 06:00
tokenization.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bigsnarfdude
bigsnarfdude / gpt4_output.md
Last active February 25, 2024 17:21
RoPE vs rope (byte encoder issue? cant see the spelling?)

what is rope important in llm

Rope is important in Large Language Models (LLMs) like ChatGPT in a metaphorical sense. The term "rope" isn't literally used in the technology or structure of LLMs, but understanding its metaphorical application can be insightful.

  1. Complexity and Interconnectedness: Just as a rope is made of many intertwined fibers, an LLM is composed of multiple layers and connections within its neural network. Each thread or fiber in a rope contributes to its overall strength and functionality, much like how each neuron and layer in an LLM contributes to its ability to process and generate language.

  2. Guidance and Direction: Ropes are often used to guide, lead, or secure things. In a similar way, the training and design of an LLM guide how it processes information and generates responses. The training data, algorithms, and parameters act like ropes, directing the LLM towards accurate and relevant outputs.

@bigsnarfdude
bigsnarfdude / gemmaPrompt.txt
Created February 22, 2024 01:11
./main -m ./models/gemma-7b-it.gguf -c 8000 -f ./prompttext.txt
<start_of_turn>user
summarize the following text:
Thank you very much to the organizers for inviting me to speak, which I guess came a
long time ago.
But I'm glad that we all made it here eventually.
Yeah, so I'm sorry about two things, the first is to break a long streak of very nice chalk
talk.
I'm afraid during COVID I got very lazy, so I just give talks on my iPad now.
@bigsnarfdude
bigsnarfdude / finetune.md
Last active February 21, 2024 17:25
vram requirements fine tunes
Hardware Requirements


Method	Bits	7B	13B	30B	65B	8x7B
Full	16	160GB	320GB	600GB	1200GB	1000GB
Freeze	16	20GB	40GB	120GB	240GB	200GB
LoRA	16	16GB	32GB	80GB	160GB	120GB
QLoRA	8	10GB	16GB	40GB	80GB	80GB
QLoRA	4	6GB	12GB	24GB	48GB	32GB
import os
from openai import OpenAI
import prompt
def truncate_words(input_string, max_words):
words = input_string.split()
truncated_words = words[:max_words]
return ' '.join(truncated_words)

This text appears to be a summary of a lecture or discussion focused on algebraic geometry, specifically dealing with complex varieties, schemes, and toric degenerations. Here's a breakdown of the key points:

  1. Complex Varieties: The discussion primarily deals with algebraic varieties over complex numbers. However, it acknowledges that extending beyond the complex case is possible for those interested.

  2. General Schemes and Spec of a Ring: The lecture isn't focused on general schemes but rather on specific cases, like the spectrum (Spec) of some ring in variables defined by an ideal. This is related to the concept of vanishing sets of ideals, i.e., sets of points where functions in the ideal vanish.

  3. Vanishing Sets in (\mathbb{C}^n) and (\mathbb{C}^{n+1}): The speaker describes constructing varieties as vanishing sets of ideals within (\mathbb{C}^n) and (\mathbb{C}^{n+1}). They mention removing the zero vector from these sets and dividing by scaling, referring to a projective space

@bigsnarfdude
bigsnarfdude / clean_transcripts.py
Last active February 23, 2024 23:20
process_transcripts.py
import os
import sys
def clean_duplicates(file_name):
duplicates = []
cleaned = []
with open(file_name, 'r') as f:
sentences = f.readlines()
for s in sentences:
if s in cleaned:
@bigsnarfdude
bigsnarfdude / l.py
Created February 16, 2024 14:42
llama_cpp_python using metal gpu and without simple QA python
from llama_cpp import Llama
llm = Llama(
model_path="/Users/vincent/development/llama.cpp/models/mistral-7b-instruct-v0.2.Q4_K_M.gguf",
n_gpu_layers=-1, # Uncomment to use GPU acceleration
seed=1337,
n_ctx=2048)
output = llm(
"[INST] Question: Write a paper on the industrial revolution. Answer: [/INST]", # Prompt
max_tokens=None, # Generate up to 32 tokens, set to None to generate up to the end of the context window
#stop=["Q:", "\n"], # Stop generating just before the model would generate a new question
@bigsnarfdude
bigsnarfdude / clean_transcripts_function.py
Last active February 14, 2024 17:45
clean_transcripts_function.py
import os
import sys
def clean_duplicates(file_name):
duplicates = []
cleaned = []
with open(file_name, 'r') as f:
sentences = f.readlines()
for s in sentences:
if s in cleaned: