Skip to content

Instantly share code, notes, and snippets.

View Elijah-Bodden's full-sized avatar

Elijah Bodden Elijah-Bodden

View GitHub Profile

How to make an LLM clone of yourself

Wanna create and play with an AI clone of yourself or someone else (my lawyer says please don't)[^1] like this one? You're in luck because it's super easy!

Step one: get you some datas

This step really varies depending on your data sources, but the end goal is to turn some of real-you's conversations (from your platforms of choice) into a ShareGPT format dataset with you as the gpt. Here's what your (json) file should end up looking like:

{"conversations": [{"from": "human", "value": "Hi"}, {"from": "gpt", "value": "Hello"}]} 
{"conversations": [{"from": "human", "value": "What's up "}, {"from": "gpt", "value": "not much, you?"}, {"from": "human", "value": "Just thinking, what if you're a robot and I don't realize it?"}, {"from": "gpt", "value": "hahaha don't be crazy"}]}
...

NOTE: Make sure every line starts with a message from the other person ("human")

import json
filenames = []
out_name = "processed.json"
myname = "YOURDISCORDUSERNAME"
for filename in filenames:
with open(filename, encoding="utf-8") as file:
data = json.load(file)["messages"]
newdata = [[data[i]["author"]["name"], data[i]["content"]] for i in range(len(data)) if data[i]["content"] != ""]
@Elijah-Bodden
Elijah-Bodden / Web server.S
Created December 12, 2023 02:25
Web POST/GET http server written in intel x86 asm (pwn.college webserver course final solution)
.intel_syntax noprefix
.globl _start
.section .text
_start:
# Open socket
mov rdi, 2
mov rsi, 1
mov rdx, 0
import random
def PI(precision):
j = 0
for i in range(precision):
x = random.random()
y = random.random()
if (x ** 2 + y ** 2 < 1): j += 1
return j/precision * 4
@Elijah-Bodden
Elijah-Bodden / typeCheck.js
Last active August 27, 2022 00:17
A tiny, dynamic type checker and TypeError generator
function checkTypes(...requiredArgs, expectedTypes) {
var mistyped = requiredArgs.filter((argumentObj, index) => {
return expectedTypes[index]
? !expectedTypes[index].includes(typeof Object.values(argumentObj)[0])
: false;
});
if (mistyped != "") {
throw new TypeError(
`expected the argument "${
Object.keys(mistyped[0])[0]