Skip to content

Instantly share code, notes, and snippets.

@ericflo
ericflo / create_pairs.py
Last active September 15, 2024 05:29
RLAIF Steering Tokens
# create_pairs.py
import argparse
import copy
import json
import random
from tqdm import tqdm
from datasets import load_dataset
from vllm import LLM, SamplingParams
from transformers import AutoTokenizer
@ericflo
ericflo / chalice_of_light.md
Created September 1, 2024 20:45
Llama 405 Base is very creative...

Movie Title: The Chalice of Light

Length:

2 hours and 45 minutes

Supporting Evidence -- Reason for Virality:

Many people believe in various kinds of supernatural phenomena for a variety of reasons, reasons I believe are not yet totally understood by academics, and certainly not by the general public. However, the fact that people believe in these things is by itself an untapped power.

# Deploy 1x AMD MI300X
# python -m vllm.entrypoints.openai.api_server --port 8083 --host 127.0.0.1 --model meta-llama/Meta-Llama-3.1-70B-Instruct --max-model-len 120000
# NUM_WORKERS=32 MODEL_NAME="meta-llama/Meta-Llama-3.1-70B-Instruct" OPENAI_API_URL="http://127.0.0.1:8083/v1" python agent_instruction_database.py
import copy
import os
import json
import traceback
import random
from pprint import pprint
# MODEL_NAME="meta-llama/Meta-Llama-3.1-8B-Instruct" OPENAI_API_URL="http://localhost:1234/v1" OPENAI_API_TOKEN="..." python general_function_calling.py
# MODEL_NAME="meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo" OPENAI_API_URL="https://api.together.xyz/v1" OPENAI_API_TOKEN="$TOGETHER_API_KEY" python general_function_calling.py
# MODEL_NAME="meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo" OPENAI_API_URL="https://api.together.xyz/v1" OPENAI_API_TOKEN="$TOGETHER_API_KEY" python general_function_calling.py
import copy
import os
import traceback
import json
import re
import inspect
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from datasets import load_dataset
from trl import SFTTrainer
from transformers import (
AutoTokenizer,
AutoModelForCausalLM,
TrainingArguments,
HfArgumentParser,
)
from peft import LoraConfig
import torch
@ericflo
ericflo / requirements.txt
Last active October 10, 2023 03:21
CodeLlama / CausalLM LoRA Training Code
transformers
tqdm
accelerate
datasets
peft
scipy
bitsandbytes
wandb
nvitop
flash-attn
@ericflo
ericflo / lora.py
Last active April 30, 2023 03:58
import os
import json
import random
import textwrap
import re
import math
import torch
from torch import nn
from torch.utils.data import DataLoader, Dataset, IterableDataset
You are Cody, a Unity C# codebase modification assistant.
Follow these steps for our conversation:
1. Introduce yourself and explain what you do.
* Hi, I'm Cody! I'm a Unity codebase modification assistant. I can help you make changes to your Unity code by asking you questions and outputting the updated code.
2. Ask the user to provide an initial code snippet that they would like to modify.
* Please provide the initial code snippet that you would like to modify.
public class MyController : MonoBehaviour
{
private void OnEnable() {
SetupFixedDeltaTime();
}
private void SetupFixedDeltaTime() {
var xrSettings = XRGeneralSettings.Instance;
if (xrSettings == null) {
Debug.Log($"XRGeneralSettings is null.");