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
# Load .env | |
cd /workspace | |
sed -i '/^KVA_STORAGE=/d' .env | |
echo 'KVA_STORAGE=/workspace/kva_store' >> .env | |
export $(grep -v '^#' /workspace/.env | xargs) | |
echo "export $(grep -v '^#' /workspace/.env | xargs)" >> ~/.bashrc | |
# Github & Huggingface tokens | |
git config --global credential.helper store | |
echo "https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com" > ~/.git-credentials |
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 os | |
import shutil | |
from mutagen.mp3 import MP3 | |
from mutagen.id3 import ID3, TIT2, TPE1, TALB | |
import click | |
def update(file, directory, target_directory): | |
if file.endswith('.mp3'): # Check if the file is an MP3 | |
path = os.path.join(directory, file) |
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 random | |
def generate_riddle(n_hints, n_words, loop_length): | |
""" | |
Build a path towards the correct hint and fill the rest with random hints | |
""" | |
loop_length = loop_length - 1 | |
assert n_words + loop_length < n_hints | |
values = list(range(n_words)) |
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 clip | |
from PIL import Image | |
import requests | |
from io import BytesIO | |
import click | |
import os | |
device = "cuda" if torch.cuda.is_available() else "cpu" | |
model, preprocess = clip.load("ViT-B/32", device=device) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
<html> | |
<head> | |
<script> | |
window.onload = (() => { | |
/* Codex output here */ | |
}); | |
</script> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
""" | |
" | |
Poor man's ML workstation: | |
Recipe: | |
1. Auto-setup codeserver on colab | |
2. Auto-mount google drive and store editor settings and extensions directly on drive | |
3. Treat a drive folder as home directory | |
Result: |
NewerOlder