conda create -n gptneox python numpy -y
conda activate gptneox
conda install pytorch torchvision pytorch-cuda=11.7 -c pytorch -c nvidia -y
pip install transformers accelerate bitsandbytes
conda create -n coca python
conda activate coca
conda install pytorch torchvision pytorch-cuda=11.7 -c pytorch -c nvidia
conda install transformers open-clip-torch -c conda-forge
CPU version:
class A: | |
x = [1] | |
@classmethod | |
def fetch(cls, name: str = "x") -> list[int]: | |
is_base_cls = super().__thisclass__ is cls | |
parent_cls = cls.mro()[1] | |
prev = [] if is_base_cls else parent_cls.fetch(name=name) | |
return prev + getattr(cls, name, []) |
from enum import Enum | |
from pytest import fixture, mark | |
class Int1(Enum): | |
small = 0 | |
large = 100 | |
import ast | |
from pyflakes import checker, reporter | |
class CheckerSnooper(checker.Checker): | |
verbose: bool | |
def __init__(self, *args, **kwargs): | |
self.verbose = kwargs.pop("verbose", False) |
recfile="2022-10-01 19-44-24"; ffmpeg -i "$recfile.mkv" -q:a 0 -map a "$recfile.mp3"; whisper --model large --language en "$recfile.mp3" |
Louis "Hi Craig"
Craig "Hi Louis"
Louis "How much wood could a woodchuck chuck if a woodchuck could chuck wood?"
Craig "He would chuck, he would, as much as he could, and chuck as much wood as a woodchuck would if a woodchuck could chuck wood"
Louis "I just checked and in 1988, a New York fish and wildlife technician named Richard Thomas calculated the volume of dirt in a typical 25–30-foot long woodchuck burrow and determined that if the woodchuck had moved an equivalent volume of wood, it could move "about 700 pounds (320 kg) on a good day, with the wind at his back"."
# ffmpeg -i foo.m4a foo.wav | |
from pyannote.audio import Pipeline | |
pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization") | |
diarization = pipeline("foo.wav") | |
# RTTM format https://catalog.ldc.upenn.edu/docs/LDC2004T12/RTTM-format-v13.pdf | |
with open("foo.rttm", "w") as rttm: | |
diarization.write_rttm(rttm) |
conda create -n diffusers
conda activate diffusers
conda install -y pytorch torchvision torchaudio cudatoolkit=11.6 -c pytorch -c conda-forge
pip install diffusers transformers piexif
OUTDATED For hf_stablediffusion_img2img.py
download https://github.com/huggingface/diffusers/blob/main/examples/inference/image_to_image.py (edit: this has been deprecated)
For hf_stablediffusion_inpaint.py
run pip install git+https://github.com/huggingface/diffusers.git
(not yet been released). At time of writing the DDIM scheduler worked, the default PNDM one did not.