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 tqdm import tqdm | |
from sentence_transformers import SentenceTransformer, util | |
from autofaiss import build_index | |
import sys | |
spacefile = sys.argv[1] | |
queryfile = sys.argv[2] | |
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
WARMUP_UPDATES=15000 # Warmup the learning rate over this many updates | |
TOTAL_UPDATES=5000000 # Total number of training steps | |
MAX_TOKENS=1024 | |
MAX_POSITIONS=1024 # Num. positional embeddings (usually same as above) | |
PEAK_LR=[0.0006] # Peak learning rate, adjust as needed | |
UPDATE_FREQ=[2] # Increase the batch size 16x | |
MODEL=bart_large |
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
# zsh | |
sudo apt install zsh | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
echo "exec zsh" >> ~/.bashrc | |
# zsh-syntax-highlighting | |
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git | |
echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc | |
source ./zsh-syntax-highlighting/zsh-syntax-highlighting.zsh |
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
// Unfollow everyone on twitter.com, by Jamie Mason (https://twitter.com/fold_left) | |
// https://gist.github.com/JamieMason/7580315 | |
// | |
// 1. Go to https://twitter.com/YOUR_USER_NAME/following | |
// 2. Open the Developer Console. (COMMAND+ALT+I on Mac) | |
// 3. Paste this into the Developer Console and run it | |
// | |
// Last Updated: 09 April 2020 | |
(() => { | |
const $followButtons = '[data-testid$="-unfollow"]'; |
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 pyautogui | |
import pyperclip | |
from time import sleep | |
import sys | |
message = f"""Hello | |
I'm in search of fulltime opportunity at {sys.argv[1]}, could refer me, or pass along my CV to a recruiter? | |
I'm a graduate student at NYU, currently working at the intersection of Reinforcement Learning and Natural Language Processing, under the supervision of Prof. Yann LeCun. |
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 hist(d, count=True): | |
import matplotlib.pyplot as plt | |
if count: | |
d = list(map(len, d)) | |
n, bins, patches = plt.hist(x=d, bins='auto', color='#0504aa', alpha=0.7, rwidth=0.85) | |
plt.grid(axis='y', alpha=0.75) | |
plt.xlabel('Value') | |
plt.ylabel('Frequency') | |
maxfreq = n.max() | |
plt.ylim(ymax=np.ceil(maxfreq / 10) * 10 if maxfreq % 10 else maxfreq + 10) |
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 torch.optim import Optimizer | |
class AdamW(Optimizer): | |
""" | |
Implements Adam algorithm with weight decay fix in PyTorch | |
Paper: Fixing Weight Decay Regularization in Adam by Ilya Loshchilov, Frank Hutter | |
https://arxiv.org/abs/1711.05101 | |
""" | |
def __init__(self, params, lr, b1=0.9, b2=0.999, e=1e-8, l2=0, | |
vector_l2=False, max_grad_norm=-1, **kwargs): |
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
# wordvec_example.py | |
# | |
# This file shows one way to work with word2vec data in Python. | |
# | |
# Setup: | |
# | |
# 1. Install gensim: | |
# | |
# pip install gensim | |
# |
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
# wordvec_example.py | |
# | |
# This file shows one way to work with word2vec data in Python. | |
# | |
# Setup: | |
# | |
# 1. Install gensim: | |
# | |
# pip install gensim | |
# |
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
4r5e | |
5h1t | |
5hit | |
a55 | |
anal | |
anus | |
ar5e | |
arrse | |
arse | |
ass |
NewerOlder