This file contains hidden or 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 torch.nn as nn | |
from einops.layers.torch import Rearrange | |
from transformers import AutoModel | |
class DummyModel(nn.Module): | |
def __init__(self, textmodel_weight_name, task_name, batch_size, freeze_text_model=False): | |
super(DummyModel, self).__init__() | |
self.task_name = task_name |
This file contains hidden or 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
# /lib/systemd/system/gpupowerlimiter.service | |
[Unit] | |
Description="Limit Nvidia GPU power at each reboot using nvidia-smi" | |
[Service] | |
User=root | |
Group=root | |
ExecStartPre=/usr/bin/nvidia-smi -i 0 -pm ENABLED | |
ExecStart=/usr/bin/nvidia-smi -pl 280 |
This file contains hidden or 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
# If you come from bash you might have to change your $PATH. | |
export PATH=$HOME/bin:/usr/local/bin:$PATH | |
export PATH="$PATH:/home/shawon/.local/bin" | |
# openbangla settings for kde | |
# Ibus KDE | |
export GTK_IM_MODULE=ibus | |
export QT_IM_MODULE=ibus | |
export XMODIFIERS=@im=ibus |
This file contains hidden or 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/bash | |
function echo_green { | |
echo -e "\\e[32m$*\\e[0m" | |
} | |
function echo_orange { | |
echo -e "\\e[33m$*\\e[0m" | |
} |
This file contains hidden or 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
absl-py==1.0.0 | |
aiohttp==3.8.1 | |
aiosignal==1.2.0 | |
analytics-python==1.4.0 | |
anyio==3.5.0 | |
asgiref==3.5.0 | |
async-timeout==4.0.2 | |
attrs==21.4.0 | |
autopep8==1.6.0 | |
backoff==1.10.0 |
This file contains hidden or 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 os | |
from tqdm import tqdm | |
train_dir = os.path.join(os.getcwd(), "data", "train") | |
test_dir = os.path.join(os.getcwd(), "data", "test") | |
# merge all text from the txt files | |
# returns a list |
This file contains hidden or 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
\documentclass[11pt]{report} | |
\usepackage[utf8]{inputenc} | |
% set margin | |
\usepackage[a4paper, margin=2.0cm]{geometry} | |
\addtolength{\leftmargin}{2.5cm} | |
% page numbering | |
\pagenumbering{gobble} |
This file contains hidden or 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
#input | |
['S', | |
['NP-SBJ', | |
['NP', | |
['DT', 'The'], | |
['NN', 'cat'] | |
] | |
], | |
['VP', | |
['VB', 'chases'], |
This file contains hidden or 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 math | |
import argparse | |
argument_parser = argparse.ArgumentParser() | |
argument_parser.add_argument("--n", type=int, required=True) | |
args = argument_parser.parse_args() | |
def is_prime(n): | |
if n == 1: |
This file contains hidden or 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
# fragments | |
from fragments import get_random_text | |
def easy_password(length: int): | |
psw = "" | |
while len(psw) != length: | |
chunk = psw + get_random_text() | |
if (len(chunk)-length == 1) or ((len(chunk) > length)): | |
psw = psw |