Skip to content

Instantly share code, notes, and snippets.

View sengstacken's full-sized avatar

Aaron Sengstacken sengstacken

View GitHub Profile
@sengstacken
sengstacken / watch_gpu
Last active August 31, 2021 18:02
watch_gpu
watch -n1 nvidia-smi
@sengstacken
sengstacken / scalers.py
Created September 16, 2021 17:14
scale data with pandas without warnings
scale_cols = ['Time','Amount']
scaler = StandardScaler()
# fit scaler
scaler.fit(train_df[scale_cols].to_numpy())
# make copies of dataframes
train_df_ = train_df.copy()
val_df_ = val_df.copy()
test_df_ = test_df.copy()
import qrcode
qr = qrcode.QRCode(version=3, box_size=15, border=15) #box_size is QR dimension and border is thickness
data = "https:~/~/www.amazon.com"
qr.add_data(data)
image = qr.make_image(fill='black', back_color='white')
# from - https://gitlab.com/juliensimon/aim410/-/blob/master/aim410.ipynb
# Number of GPUs on this machine
%env SM_NUM_GPUS=0
# Where to save the model
%env SM_MODEL_DIR=/tmp/model
# Where the training data is
%env SM_CHANNEL_TRAINING=data
# Where the validation data is
%env SM_CHANNEL_VALIDATION=data
@sengstacken
sengstacken / LLM-file-tree.py
Created April 24, 2024 13:23
Get file structure for LLM upload
import os
import shutil
import tarfile
from collections import defaultdict
import logging
# Setup basic logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
def copy_and_compress(src_directory, temp_directory, max_types, max_size):