Neovim, tmux, Starship, zoxide, fzf, exa, bash vi mode, ...
Shows git stats, command runtime etc. in a nice way.
You can change directory with partial keyword you remember. It will remember the most frequent cd and find it.
# ~/.config/starship.toml | |
[battery] | |
full_symbol = "🔋" | |
charging_symbol = "🔌" | |
discharging_symbol = "⚡" | |
[[battery.display]] | |
threshold = 30 | |
style = "bold red" |
""" | |
Author: Kiyoon Kim (yoonkr33@gmail.com) | |
Since torchvision 0.13 (PyTorch 1.12), the new `weights` parameter is introduced and the original `pretrained` parameter is now deprecated. | |
It supports more pretrained weights but it is more difficult to find the right one. | |
This script provides a backward compatible but supporting new version in ease, using strings. | |
""" | |
from __future__ import annotations | |
from typing import Callable, get_type_hints, get_args | |
from enum import Enum | |
from packaging import version |
""" | |
This will make pptx slides containing images. | |
It assumes your images are square shaped. | |
""" | |
from glob import glob | |
from pptx import Presentation | |
from pptx.dml.color import RGBColor | |
from pptx.util import Inches |
#!/usr/bin/env python3 | |
from pathlib import Path | |
from safetensors.torch import load_file | |
def summarize_tensor(x): | |
if x is None: | |
return "None" | |
x = x.float() | |
return f"({x.min().item():.3f}, {x.mean().item():.3f}, {x.max().item():.3f})" |
from torch import nn | |
def _addindent(s_, numSpaces): | |
s = s_.split("\n") | |
# don't do anything for single-line stuff | |
if len(s) == 1: | |
return s_ | |
first = s.pop(0) | |
s = [(numSpaces * " ") + line for line in s] |
# flake8: noqa: D100 D101 D102 D105 T201 | |
from dataclasses import dataclass, field | |
@dataclass | |
class BaseConfig: | |
@property | |
def envvar_prefix(self) -> str: | |
return "MLCONFIG_" |
import tensorrt as trt | |
import torch | |
import tqdm | |
logger = trt.Logger(trt.Logger.WARNING) | |
runtime = trt.Runtime(logger) | |
with open("vae_encoder_engine.trt", "rb") as f: | |
serialized_engine = f.read() |
from rich.progress import ( | |
Progress, | |
ProgressColumn, | |
SpinnerColumn, | |
Task, | |
TextColumn, | |
TimeElapsedColumn, | |
) | |
from rich.text import Text |
#include <sys/ioctl.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <termios.h> | |
enum { | |
KEYSTATE_NONE = 1024, | |
KEYSTATE_ESCAPE, | |
KEYSTATE_CONTROL, | |
KEYSTATE_MOUSE_PROPS |