This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Game of Life Canvas</title> | |
<style> | |
body { | |
display: flex; | |
flex-direction: column; |
This file contains 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
# OK time to arithmetic code. V1 because its so simplistic as a concept | |
# I'll make a dictionary of all unique symbols in the string (rather than | |
# a predefined dict) | |
# and I'll go ahead and subdivide and add it to a running total. | |
from collections import Counter | |
from sys import getsizeof | |
text = "Hello world!" | |
text_dc = {s:i for i,s in enumerate(sorted(set(text)))} | |
print(text_dc) |
This file contains 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 safetensors import safe_open | |
import einops | |
import torch | |
from transformers import AutoModelForCausalLM | |
def get_orthogonalized_matrix(matrix: Float[Tensor, '... d_model'], vec: Float[Tensor, 'd_model']) -> Float[Tensor, '... d_model']: | |
device = matrix.device | |
vec = vec.to(device) | |
proj = einops.einsum(matrix, vec.view(-1, 1), '... d_model, d_model single -> ... single') * vec | |
return matrix - proj |
This file contains 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 argparse | |
import sys | |
import os.path as path | |
import torch | |
import torch.nn as nn | |
from PIL import Image | |
from transformers import ( | |
AutoTokenizer, | |
LlamaForCausalLM, | |
BitsAndBytesConfig, |
This file contains 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
# You take too many clips and its using up all your storage space? | |
# Don't know what to do? | |
# just save this file and make a .bat or shortcut file with the following content | |
# powershell.exe -NoExit -command "& 'C:\A path with spaces\watch_it.ps1' -filePath 'C:\Wherever you save videos'" | |
# you also have to edit below where the ffmpeg executable is. | |
# Geforce experience defaults to C:\Users\User\Videos | |
# This'll watch every directory there, and spawn a ffmpeg process for each video created, | |
param( | |
[Parameter(Mandatory=$true)][ValidateScript({ Test-Path -Path $_ })][string]$filePath |
This file contains 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 | |
import transformers | |
import gradio as gr | |
import PIL | |
from threading import Thread | |
from transformers import AutoTokenizer, AutoModelForCausalLM, TextIteratorStreamer | |
import warnings | |
# disable some warnings | |
transformers.logging.set_verbosity_error() |
This file contains 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 | |
import transformers | |
import gradio as gr | |
import PIL | |
from threading import Thread | |
from transformers import AutoTokenizer, AutoModelForCausalLM, TextIteratorStreamer | |
import warnings | |
# disable some warnings | |
transformers.logging.set_verbosity_error() |
This file contains 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 | |
import transformers | |
from transformers import AutoModelForCausalLM, AutoTokenizer | |
from PIL import Image | |
import warnings | |
# disable some warnings | |
transformers.logging.set_verbosity_error() | |
transformers.logging.disable_progress_bar() | |
warnings.filterwarnings('ignore') |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
def main(): | |
for i in range(1, 101): | |
if i % 15 == 0: | |
print("Fizzbuzz") | |
continue | |
if i % 5 == 0: | |
print("Buzz") | |
continue | |
if i % 3 == 0: | |
print("Fizz") |
NewerOlder