Skip to content

Instantly share code, notes, and snippets.

View andrewgazelka's full-sized avatar
🤖

Andrew Gazelka andrewgazelka

🤖
  • discord: @andrewgazelka
  • 07:28 (UTC -04:00)
View GitHub Profile
data parallelism
/* EDIT MODE */
.HyperMD-header.HyperMD-header-1 {
/* text-align: center !important; */
}
/* PREVIEW MODE */
/* .markdown-preview-view h1, h2, h3, h4, h5 { */
/* text-align: center !important; */
@andrewgazelka
andrewgazelka / rp.zsh
Created June 29, 2023 14:08
Run commands in parallel
# run in parallel
rp() {
name=$(getuuid)
tmux new-session -d -s $name
# Get the total number of items.
total=${#items[@]}
# Initialize a counter.
count=1
from transformers import AutoTokenizer, AutoModel
import torch
import torch.nn.functional as F
#Mean Pooling - Take attention mask into account for correct averaging
def mean_pooling(model_output, attention_mask):
token_embeddings = model_output[0] #First element of model_output contains all token embeddings
input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)
match res {
Ok(res) => { ... }
Err(Io(io)) => { ... }
Err(InvalidArgs) => { ... }
}
set ideajoin
set multiple-cursors
set commentary
set vim-paragraph-motion
set surround
set argtextobj
set NERDTree
set textobj-entire
set clipboard+=unnamed
set hlsearch
@andrewgazelka
andrewgazelka / init.sh
Last active October 21, 2021 23:39
Branch creation based on issue name
# git create branch based on an issue (git checkout -b)
# example `gcob 118` creates a new branch based on issue 118
gcob(){
local issue_name="$(hub issue show $1 | head -n 1 | sed 's/# \([A-Za-z]*\)/\1/' | sed 's/ /-/g')"
local branch_name="$1-$issue_name"
git checkout -b $branch_name
}
@andrewgazelka
andrewgazelka / 📊 Weekly development breakdown
Last active May 30, 2021 01:09
Weekly development breakdown
Rust 19 hrs 52 mins █████████████░░░░░░░░ 62.1%
Dart 6 hrs 57 mins ████▌░░░░░░░░░░░░░░░░ 21.7%
TypeScript 1 hr 19 mins ▊░░░░░░░░░░░░░░░░░░░░ 4.2%
Java 1 hr 1 min ▋░░░░░░░░░░░░░░░░░░░░ 3.2%
JavaScript 50 mins ▌░░░░░░░░░░░░░░░░░░░░ 2.6%

Contact

  • EMAIL: andrew (dot) gazelka (at) gmail.com
  • DISCORD: Andrew Gazelka#5386
@andrewgazelka
andrewgazelka / REPOSITORIES.md
Last active January 6, 2021 20:54
Cool Repositories