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
gsutil -m rsync -r -i -x ".*filesToFilterOut.*" /local/path/to/myfolder gs://mybucket/myfolder |
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
var portalMain = window.frames['mainwindow'].frames['portalmain']; | |
var rightSideFrame; // This is named of the form *_rightside, so we search | |
for(let i = 0; i < portalMain.frames.length; i++) { | |
if(portalMain.frames[i].name.endsWith('_rightside')) { | |
rightSideFrame = portalMain.frames[i]; | |
break; | |
} | |
} | |
var frameDoc = rightSideFrame.frames['componentframe'].document; |
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 PIL import Image, ExifTags | |
from collections import defaultdict | |
from datetime import datetime | |
import os | |
from tqdm import tqdm | |
from glob import glob | |
import sys | |
glob_string = sys.argv[1] | |
print(f'Searching in globstring: {glob_string}') |
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
class MiniLMTokenizer(torch.nn.Module): | |
def __init__(self, vocab: Dict[str, int], vocab_scores: Dict[str, float]): | |
''' | |
:param vocab: A dictionary mapping from string to index of token | |
:param vocab_scores: A dictionary mapping from string to the score of a given token. This is used to decide | |
which tokenization is most probable for our input string. | |
For unigram models this should be avaiable under `~/.cache/torch/sentence_transformers/$YOURMODEL/unigram.json` | |
You might also need to flip the scores if they're negative. | |
``` | |
with open(f'~/.cache/torch/sentence_transformers/{org}_{model_name}/unigram.json', 'r') as f: |
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
python -q -X faulthandler -c "#Faulty Code" |
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
''' | |
#Conda environment file (env.yml). Install with `conda env create -f env.yml` | |
channels: | |
- nvidia | |
- rapidsai | |
- anaconda | |
- conda-forge | |
dependencies: | |
- python=3.8 |
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
\%23c Matches in a specific column. (23), example :%s/\%1c/#/ (insert # on first column of all rows) | |
:% (all rows), :. (this row), :$ (last row), :.,$ (this->last row), :5,$ (5th->last row) | |
s, substitute. :%s/a/b/g, change all a->b on all rows. | |
u, undo | |
p, paste | |
m+a, set mark a [works for a-z] | |
'+a, go to mark a [works for a-z] | |
<<, de-indent row | |
>>, indent row | |
J, join rows |
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
for f in *; do NEW_NAME=$(echo $f | sed -e "s/.*EP\([0-9][0-9]\).*/S06E\1.mkv/g"); mv ${f} ${NEW_NAME}; done; |
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
# Origin http://ubuntuhandbook.org/index.php/2020/05/canon-printer-scangear-mp-ubuntu-20-04/ | |
# Ubuntu | |
sudo apt install printer-driver-gutenprint | |
sudo add-apt-repository ppa:thierry-f/fork-michael-gruz | |
sudo apt install scangearmp2 | |
sudo apt install scangearmp-mp495series | |
# Arch / Manjaro |
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
torch::jit::IValue myIvalue; | |
torch::jit::IValue myIvalue2; | |
torch::jit::script::Module module; | |
std::unordered_map<std::string, torch::jit::IValue> umap = {{"x", myIvalue}, {"opt", myIvalue2}}; | |
auto result = module.get_method("forward")({}, umap); | |
// shows all potential arguments to model forward | |
std::cout << module.get_method("forward").function().getSchema().arguments() << std::endl; |
NewerOlder