You need to install the pv
library first for visualize progress bar.
In Debian system, just run this command: sudo apt-get install pv
tar cf - <files> -P | pv -s $(du -sb <files> | awk '{print $1}') | gzip > <some .tar.gz file>
# train_grpo.py | |
import re | |
import torch | |
from datasets import load_dataset, Dataset | |
from transformers import AutoTokenizer, AutoModelForCausalLM | |
from peft import LoraConfig | |
from trl import GRPOConfig, GRPOTrainer | |
# Load and prep dataset |
conda create -n textgen python=3.10.9 | |
conda activate textgen | |
install pytorch: pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117 | |
git clone https://github.com/oobabooga/text-generation-webui | |
cd text-generation-webui | |
pip install -r requirements.txt | |
python server.py | |
# download model | |
# refresh model list | |
# load model |
# "#################################################" | |
# Dockerfile to build a GitHub Pages Jekyll site | |
# - Ubuntu 22.04 | |
# - Ruby 3.1.2 | |
# - Jekyll 3.9.3 | |
# - GitHub Pages 288 | |
# | |
# This code is from the following Gist: | |
# https://gist.github.com/BillRaymond/db761d6b53dc4a237b095819d33c7332#file-post-run-txt | |
# |
Here's a simple implementation of bilinear interpolation on tensors using PyTorch.
I wrote this up since I ended up learning a lot about options for interpolation in both the numpy and PyTorch ecosystems. More generally than just interpolation, too, it's also a nice case study in how PyTorch magically can put very numpy-like code on the GPU (and by the way, do autodiff for you too).
For interpolation in PyTorch, this open issue calls for more interpolation features. There is now a nn.functional.grid_sample()
feature but at least at first this didn't look like what I needed (but we'll come back to this later).
In particular I wanted to take an image, W x H x C
, and sample it many times at different random locations. Note also that this is different than upsampling which exhaustively samples and also doesn't give us fle
# CMake version requirement | |
cmake_minimum_required(VERSION 3.8.0) | |
project(MY_PROJ VERSION 1.0.0 LANGUAGES CXX CUDA) | |
# find_package() | |
set(INCUDE_DIR "${PROJECT_SOURCE_DIR}/include") | |
set(LIBRARY_DIR "${PROJECT_SOURCE_DIR}/lib") |
PowerCfg /SETACVALUEINDEX SCHEME_CURRENT SUB_PROCESSOR IDLEDISABLE 000 | |
PowerCfg /SETACTIVE SCHEME_CURRENT |