Click to toggle contents of `code`
CODE!
CODE!
UPDATED 22.11.2022
It's been two years since the last update, so here's the updated working script as per the comments below.
Thanks to BryanHaley for this.
setInterval(function () {
video = document.getElementsByTagName('ytd-playlist-video-renderer')[0];
video.querySelector('#primary button[aria-label="Action menu"]').click();
model.zero_grad() # Reset gradients tensors | |
for i, (inputs, labels) in enumerate(training_set): | |
predictions = model(inputs) # Forward pass | |
loss = loss_function(predictions, labels) # Compute loss function | |
loss = loss / accumulation_steps # Normalize our loss (if averaged) | |
loss.backward() # Backward pass | |
if (i+1) % accumulation_steps == 0: # Wait for several backward steps | |
optimizer.step() # Now we can do an optimizer step | |
model.zero_grad() # Reset gradients tensors | |
if (i+1) % evaluation_steps == 0: # Evaluate the model when we... |
~/.bash_aliases
file.function gdrive_download () {
CONFIRM=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate "https://docs.google.com/uc?export=download&id=$1" -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$CONFIRM&id=$1" -O $2
rm -rf /tmp/cookies.txt
}
import argparse | |
import logging | |
from logging import Filter | |
from logging.handlers import QueueHandler, QueueListener | |
import torch | |
import torch.distributed as dist | |
import torch.multiprocessing as mp | |
from torch.multiprocessing import Queue |
# Put this function to your .bashrc file. | |
# Usage: mv oldfilename | |
# If you call mv without the second parameter it will prompt you to edit the filename on command line. | |
# Original mv is called when it's called with more than one argument. | |
# It's useful when you want to change just a few letters in a long name. | |
# | |
# Also see: | |
# - imv from renameutils | |
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste) |
# Create 3 tunnels, each for different ports, with only https enabled | |
# This way the ngrok process stays bellow the Free plan limit (4 tunnels) | |
authtoken: ... | |
log: ngrok.log | |
tunnels: | |
first: | |
addr: 3000 | |
proto: http | |
bind_tls: true |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from argparse import ArgumentParser | |
import torch | |
import torch.distributed as dist | |
from torch.nn.parallel import DistributedDataParallel as DDP | |
from torch.utils.data import DataLoader, Dataset | |
from torch.utils.data.distributed import DistributedSampler | |
from transformers import BertForMaskedLM |
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" VIM SETTINGS | |
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" TURNS LINE NUMBERING ON | |
set nu | |
" TRIGGER `autoread` WHEN FILES CHANGES ON DISK | |
set autoread | |
autocmd FocusGained,BufEnter,CursorHold,CursorHoldI * if mode() != 'c' | checktime | endif |