In the name of God
This gist contains steps to setup Ubuntu 20.04
for deep learning.
Install Ubuntu 20.04:
from transformers import AutoModelForCausalLM, AutoTokenizer, StaticCache | |
import torch | |
from typing import Optional | |
device = "cuda" | |
# Copied from the gpt-fast repo | |
def multinomial_sample_one_no_sync(probs_sort): # Does multinomial sampling without a cuda synchronization | |
q = torch.empty_like(probs_sort).exponential_(1) | |
return torch.argmax(probs_sort / q, dim=-1, keepdim=True).to(dtype=torch.int) |
#!/usr/bin/env bash | |
for f in $(<~/git/repos); do | |
cd ~/git/$f | |
git pull > /dev/null & | |
cd - > /dev/null | |
done | |
wait < <(jobs -p) | |
for f in $(<~/git/repos); do |