Skip to content

Instantly share code, notes, and snippets.

View pszemraj's full-sized avatar

Peter pszemraj

View GitHub Profile

We shall also address some key issues related to space optimization, such as the use of microelectronic technologies (e.g., electronic sensors) and computational modeling. Finally, we'll consider another challenge facing the next edition of our series--the sea of underwater buildings.

2 What Is Ocean Architecture?

Ocean architecture refers to how objects move through time. While many ideas have emerged since antiquity, archaeologists believe that the structure of the earth was constructed using mechanical and chemical processes. At one level, there were two basic types of structures - mechanical systems and gravity systems. Metamorphoses may be thought of as building blocks of modern society:

a) The physical organization of each object. An organism moves through its own frame when it moves, but does not move or carry out any actions; or b) The interaction between different parts of the body depends on the environment surrounding it. The process of motion determines how far away the animal lives and wha

@pszemraj
pszemraj / USAGE.md
Last active May 19, 2024 18:40
how to use unsloth grad checkpointing

usage

Credit/source: here

how to use unsloth grad checkpointing

steps

To integrate the provided monkey patch for offloading gradient checkpointing into the Hugging Face transformers library, you need to follow these steps:

@pszemraj
pszemraj / jamba900m_11k.md
Last active May 18, 2024 03:39
this took 7 mins and 2 gb vram. yep 2 gb. the generated text has not been edited in any way, just saved as .md

Introduction

At the heart of every meme generation lies the concept of what it means to be human. While we do so by providing us with powerful examples and narratives, today's consumers need to understand the nature of their behavior, how they behave, and what happens when these people are harmed. Our goal in creating mesmerizing and exciting stories for our audiences is to share our stories without distractions, and with no limits on how much effort may go into making them. To achieve this goal, we aim to build an interactive narrative of our experience. In addition, we encourage visitors to use their stories to explore ways that the future might look like and apply the lessons learned. With the introduction of Android, there has been significant growth in mobile apps with unprecedented popularity and success. For example, Apple has created a series of popular smartphones with impressive user interface features. These include the Google Play Store, Facebook Live, Twitter, YouTube, and Spotify. From browsin

@pszemraj
pszemraj / calculate_code_readability.py
Created November 6, 2023 17:01
heuristics for language agnostic code readability index
import re
from itertools import chain
def calculate_readability(code_string:str) -> float:
code = code_string.splitlines()
# Heuristic 1: Line length
max_line_length = 80
long_lines = sum(1 for line in code if len(line) > max_line_length)
@pszemraj
pszemraj / pile_t5_samsum.sh
Last active April 16, 2024 22:32
bash script for basic testing with pile-t5-large. note that this uses 1024 as the seq length for in/ 512 out
#!/bin/bash
# Set environment variables
export WANDB_PROJECT="pileT5-summ"
export WANDB_WATCH="gradients"
export WANDB_ENTITY="pszemraj"
NUM_WORKERS=$(lscpu -p | egrep -v '^#' | sort -u -t, -k 2,4 | wc -l)
echo "Number of CPU cores: $NUM_WORKERS"
@pszemraj
pszemraj / atlanta-overview.md
Created March 30, 2024 03:22
modern relocation research & adjustment courtesy of claude3 opus

Messages Overview - 2024-03-30 04:20:45 - Total Messages: 6

User - Msg No. 1/6

Can you give me an up to date overview of Atlanta and the different areas of the city

Assistant - Msg No. 2/6

Sure, I can provide you with an overview of Atlanta and its different areas. Atlanta is the capital and most populous city in the state of Georgia, with a diverse population and a thriving economy. Here's a breakdown of some of the main areas:

@pszemraj
pszemraj / create_archive.py
Created March 27, 2024 12:00
simple CLI for builtin-python archive creation
"""
Creates an archive of a directory
pip install fire
"""
import os
import shutil
from pathlib import Path
@pszemraj
pszemraj / enable_tf32.py
Last active March 24, 2024 05:00
modern way to auto enable tf32
import torch
import logging
def check_ampere_gpu():
"""
Check if the GPU supports NVIDIA Ampere or later and enable FP32 in PyTorch if it does.
"""
# Check if CUDA is available
if not torch.cuda.is_available():
@pszemraj
pszemraj / find_deps.py
Created March 23, 2024 02:26
find local package meta dependencies
import pkg_resources
def list_dependencies(package_name, level=0, explored=set()):
# Define indent outside of try-except to ensure it's always assigned
indent = " " * level
if package_name in explored:
return
explored.add(package_name)
@pszemraj
pszemraj / dataset_from_list.py
Created March 17, 2024 02:24
hf datasets create a Dataset from a list of dicts
from datasets import Dataset
# Your initial list of dictionaries
data = [
{"id": 1, "text": "Hello world!", "label": 0},
{"id": 2, "text": "How are you?", "label": 1},
# Add more dictionaries as needed
]
# Convert list of dictionaries to a dictionary of lists