Skip to content

Instantly share code, notes, and snippets.

View afiaka87's full-sized avatar
🤪

Clay Mullis afiaka87

🤪
View GitHub Profile
@afiaka87
afiaka87 / finetune_clip_wds.py
Last active September 29, 2023 09:35
Finetune CLIP on a 'webdataset' formatted dataset
from torchvision.transforms.transforms import GaussianBlur
import webdataset as wds
import io
from PIL import Image
from clip.loader import TextImageDataset
from clip.clip import load, tokenize
from torchvision import transforms as T
from torch.utils.data import DataLoader
from torch.optim import Adam
import torch.nn.functional as F
@afiaka87
afiaka87 / dalle_blog_semantic_search.ipynb
Last active April 10, 2024 19:57
dalle_blog_semantic_search.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@afiaka87
afiaka87 / zeta_quantize.ipynb
Last active November 27, 2023 04:43
zeta_quantize.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@crowsonkb
crowsonkb / ema_biased.py
Created February 26, 2021 19:09
Biased EMA for PyTorch
"""Exponential moving average for PyTorch. Adapted from
https://www.zijianhu.com/post/pytorch/ema/.
"""
from copy import deepcopy
import torch
from torch import nn
@crowsonkb
crowsonkb / ema.py
Last active February 28, 2021 22:45
Parameter averaging for PyTorch
"""Exponential moving average for PyTorch. Adapted from
https://www.zijianhu.com/post/pytorch/ema/.
"""
from copy import deepcopy
import torch
from torch import nn
@riobard
riobard / tcpdump.txt
Last active August 12, 2022 08:19
Poem lines broadcast by my ISP-provided fiber optical modem
# My ISP-provided fiber optical modem broadcasts a line of a poem every ten seconds. Here's the tcpdump of the complete poem.
# The optical modem is made by Shanghai Nokia-Bell Co.,Ltd and its model number is G-140W-UD. It's provided by my ISP, China Unicom in Shenzhen.
$ tcpdump -i vlan10 ether proto 0x8300
15:59:00.720301 00:00:00:00:00:12 (oui Ethernet) > Broadcast, ethertype Unknown (0x8300), length 72:
0x0000: 0000 0000 e4ea 8386 d93c 5468 6520 6461 .........<The.da
0x0010: 7920 4920 6c6f 7374 206d 7920 7665 7279 y.I.lost.my.very
0x0020: 2066 6972 7374 2074 6f6f 7468 2c00 0000 .first.tooth,...
0x0030: 0000 0000 0000 0000 0000 ..........
15:59:10.740778 00:00:00:00:00:12 (oui Ethernet) > Broadcast, ethertype Unknown (0x8300), length 72:
@tdcosta100
tdcosta100 / WSL2GUIXvnc-en.md
Last active April 6, 2024 00:36
A tutorial to use GUI in WSL2 replacing original XServer by Xvnc, allowing WSL to work like native Linux, including login screen

WSL2 with GUI using Xvnc

In this tutorial, we will setup GUI in WSL2, and access it using VNC. No additional software outside WSL (like VcXsrv) is required, except, of course, a VNC Viewer (RealVNC, TightVNC, TigerVNC, UVNC, etc, all of them might work flawlessly).

The key component we need to install is tigervnc-standalone-server.

For this setup, I will use Ubuntu 20.04 LTS (Focal Fossa, unfortunately 22.04 does not work), and install GNOME Desktop. Since the key components aren't bound to Ubuntu or GNOME, you can use your favorite distro and GUI. Check the Sample screenshots section for examples.

So let's go. First, we need a working WSL2 installation.

@nathzi1505
nathzi1505 / install-docker.sh
Last active February 28, 2024 15:52
Docker and Nvidia Docker installation in Ubuntu 20.04 LTS
# WARNING : This gist in the current form is a collection of command examples. Please exercise caution where mentioned.
# Docker
sudo apt-get update
sudo apt-get remove docker docker-engine docker.io
sudo apt install docker.io
sudo systemctl start docker
sudo systemctl enable docker
docker --version
@dominiklohmann
dominiklohmann / banner.png
Last active December 20, 2023 19:22
yabai autoupdate
banner.png