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 argparse | |
| import os | |
| import sys | |
| import random | |
| import codecs | |
| import json | |
| from bs4 import BeautifulSoup | |
| from multiprocessing import Pool | |
| import colorama | |
| from colorama import Fore |
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
| !wget https://model-server.zqevans2.workers.dev/jmann-small-190k.ckpt -O /content/drive/MyDrive/AI/models/jmann-small-190k.ckpt |
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
| du -cBM --max-depth=1 2> >(grep -v 'Permission denied') | grep -v 'cannot access' | sort -n |
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
| ! pip install kaggle | |
| ! mkdir ~/.kaggle | |
| !cp /content/drive/MyDrive/kaggle.json ~/.kaggle/kaggle.json | |
| # AN INDIVIDUAL .ckpt FILE | |
| LINK='omgsupportteam/dd-tb-fine-22-10-11-22-42-36' | |
| FILENAME = 'last.ckpt' | |
| ! kaggle datasets download $LINK -f $FILENAME |
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 sys, json | |
| from dateutil.parser import parse | |
| from datetime import datetime, timezone, timedelta | |
| with open("/var/colab/app.log", 'r') as fileData: | |
| for textline in fileData: | |
| if " started" in textline: | |
| time = parse (json.loads(textline)['time']) | |
| now = datetime.now(time.tzinfo) | |
| later = time + timedelta(hours=4) | |
| print(now-time, "session started") |
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 | |
| def prune_it(p): | |
| print(f"prunin' in path: {p}") | |
| size_initial = os.path.getsize(p) | |
| nsd = dict() | |
| sd = torch.load(p, map_location="cpu") | |
| print(sd.keys()) | |
| for k in sd.keys(): | |
| if k != "optimizer_states": | |
| nsd[k] = sd[k] |
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
| NAMEZIP = f"/content/drive/MyDrive/AI/models/DanceDiffusion/finetune/{NAME}/{NAME}_zipped_demos.7z" | |
| !7z a -t7z $NAMEZIP /content/sample-generator/*.wav |
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
| !rsync -a /content/drive/MyDrive/PathToSamples/ /content/Temp | |
| !tar -zcf /content/normalized.gz /content/Temp | |
| !cp /content/normalized.gz /content/drive/MyDrive/PathForZip/normalized.gz |
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/env python | |
| # coding: utf-8 | |
| # You need PIL <http://www.pythonware.com/products/pil/> to run this script | |
| # Download unifont.ttf from <http://unifoundry.com/unifont.html> (or use | |
| # any TTF you have) | |
| # Copyright 2011 Álvaro Justen [alvarojusten at gmail dot com] | |
| # License: GPL <http://www.gnu.org/copyleft/gpl.html> | |
| from image_utils import ImageText |
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/env python | |
| # coding: utf-8 | |
| # You need PIL <http://www.pythonware.com/products/pil/> to run this script | |
| # Download unifont.ttf from <http://unifoundry.com/unifont.html> (or use | |
| # any TTF you have) | |
| # Copyright 2011 Álvaro Justen [alvarojusten at gmail dot com] | |
| # License: GPL <http://www.gnu.org/copyleft/gpl.html> | |
| from image_utils import ImageText |