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
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{ | |
default: Turndown | |
}, { | |
default: Readability | |
}]) => { | |
/* Optional vault name */ | |
const vault = ""; | |
/* Optional folder name such as "Clippings/" */ |
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 transformers import MarianTokenizer, AutoModelForSeq2SeqLM | |
text = 'Рада познакомиться' | |
mname = 'Helsinki-NLP/opus-mt-ru-en' | |
tokenizer = MarianTokenizer.from_pretrained(mname) | |
model = AutoModelForSeq2SeqLM.from_pretrained(mname) | |
input_ids = tokenizer.encode(text, return_tensors="pt") | |
outputs = model.generate(input_ids) | |
decoded = tokenizer.decode(outputs[0], skip_special_tokens=True) | |
print(decoded) #Nice to meet you |
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
{{FrontSide}} | |
<div class="outside"> Answer</div> | |
<div class="card-back shadow"> | |
<div class="back">{{Back}}</div> | |
{{#BackOpt}} | |
<hr /> | |
<div class="backopt">{{BackOpt}}</div> |
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
###################################################################### | |
# START OF PLUGINS | |
###################################################################### | |
# Plugin manager for tmux | |
set -g @plugin 'tmux-plugins/tpm' | |
# Simple tmux options for anyone | |
set -g @plugin 'tmux-plugins/tmux-sensible' |
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
env: | |
TERM: xterm-256color | |
# Colors (Gruvbox dark) | |
colors: | |
# Default colors | |
primary: | |
# hard contrast: background = '#1d2021' | |
background: '#282828' | |
# soft contrast: background = '#32302f' |
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
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" 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 |
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
#!/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 |
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
# 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 |
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
# 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) |
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 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 |
NewerOlder