Skip to content

Instantly share code, notes, and snippets.

View HarshTrivedi's full-sized avatar
💭
Am probably having coffee ☕☕☕

Harsh Trivedi HarshTrivedi

💭
Am probably having coffee ☕☕☕
View GitHub Profile
@dirkgr
dirkgr / logging_tqdm.py
Last active November 14, 2023 04:54
A drop-in replacement for TQDM which writes log messages instead of progress bars
from typing import *
import time
import logging
def logging_tqdm(
i,
*,
logger: Optional[logging.Logger] = None,
desc: str = "Working",
total: Optional[int] = None,
@Tushar-N
Tushar-N / pad_packed_demo.py
Last active December 27, 2022 06:35
How to use pad_packed_sequence in pytorch<1.1.0
import torch
import torch.nn as nn
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
seqs = ['gigantic_string','tiny_str','medium_str']
# make <pad> idx 0
vocab = ['<pad>'] + sorted(set(''.join(seqs)))
# make model
@hangsong
hangsong / Install NVIDIA Driver and CUDA.md
Created September 9, 2016 06:59 — forked from wangruohui/Install NVIDIA Driver and CUDA.md
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora