This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from scipy.integrate import solve_ivp | |
import matplotlib.pyplot as plt | |
from mpl_toolkits.mplot3d import Axes3D | |
from itertools import permutations | |
from collections import Counter | |
# Define the Thomas attractor system | |
def thomas_derivatives(t, u, b): | |
x, y, z = u |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# based off of https://gist.github.com/rauchg/c5f0b1dc245ad95c593de8336aa382ac?permalink_comment_id=4842642#gistcomment-4842642 | |
# further adapted from https://gist.github.com/algal/5e815ffd371d57d3a6a37056db1bd281 | |
if [ "$#" -eq 0 ]; then | |
echo "Usage: $(basename $0) promt_to_send_to_perplexity" | |
echo "" | |
echo " Requirements: PERPLEXITY_API, defined; jq and curl, installed; bash, version 3 or higher." | |
exit 1 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from distilabel.steps import LoadDataFromDicts | |
from distilabel.steps.tasks import EvolInstruct | |
from distilabel.pipeline import Pipeline | |
from distilabel.llms import OllamaLLM | |
import pprint | |
# Set up the pipeline | |
with Pipeline(name="evol-instruct-example") as pipeline: | |
# Load initial instructions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import modal | |
app = modal.App(name="moondream-label-datikz_v2") | |
data_dict = modal.Dict.from_name("HF_DATASET", create_if_missing=True) | |
def download_dataset(): | |
from datasets import load_dataset | |
data_dict["HF_DATASET"] = "nllg/datikz-v2" | |
dataset = load_dataset(data_dict["HF_DATASET"]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
from transformers import AutoModelForCausalLM, AutoTokenizer | |
import xxhash | |
from tqdm import tqdm | |
# load moondream model | |
model_id = "vikhyatk/moondream2" | |
revision = "2024-05-20" | |
model = AutoModelForCausalLM.from_pretrained( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import modal | |
app = modal.App(name="pokemon-eval") | |
moondream_image = modal.Image.micromamba( | |
python_version="3.11" | |
).apt_install( | |
"git" | |
).micromamba_install( | |
"cudatoolkit", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
podman run --rm --device nvidia.com/gpu=all --security-opt=label=disable --mount type=bind,src="${PWD}",target=/workspace/axol | |
otl -v ${HOME}/.cache/huggingface:/root/.cache/huggingface winglian/axolotl:main-py3.10-cu118-2.0.1 accelerate launch -m axolotl.cli.train examples/openllam | |
a-3b/lora.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
git clone https://github.com/continuedev/continue | |
npm config set prefix ~/.local | |
sh continue/install-dependencies.sh | |
cd continue/extensions/vscode | |
node scripts/prepackage.js | |
npm install @vscode/vsce | |
PATH=$PATH:~/.local/bin/ | |
npm install yarn | |
node scripts/package.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
print("pytorch version: " + torch.__version__) | |
print("CUDA available: " + str(torch.cuda.is_available())) | |
print("device count: " + str(torch.cuda.device_count())) | |
print("current device: " + str(torch.cuda.current_device())) | |
print("device name: " + torch.cuda.get_device_name(torch.cuda.current_device())) | |
print("backend:") | |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu") | |
print(device) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import requests | |
import collections | |
class BearerAuth(requests.auth.AuthBase): | |
def __init__(self, token): | |
self.token = token | |
def __call__(self, r): | |
r.headers['Authorization'] = 'Bearer ' + self.token | |
return r |
NewerOlder