<jupyter_start><jupyter_text>Training for Artist Generation - CVAE--- This notebook trains our CVAE model on persona data, and is built with Colab in mind. ---First, view some info about your gpu you have been allocated<jupyter_code>gpu_info = !nvidia-smi
gpu_info = '\n'.join(gpu_info)
if gpu_info.find('failed') >= 0:
  print('Select the Runtime > "Change runtime type" menu to enable a GPU accelerator, ')
  print('and then re-execute this cell.')
else:
  print(gpu_info)<jupyter_output><empty_output><jupyter_text>Get the code<jupyter_code>import os
from getpass import getpass
import urllib

user = input('User name: ')
password = getpass('Password: ')
password = urllib.parse.quote(password) # your password is converted into url format
repo_name = "artist-lyric-gen.git"
cmd_string = 'git clone https://{0}:{1}@github.com/{0}/{2}'.format(user, password, repo_name)

!{cmd_string}

%cd /content/artist-lyric-gen/src/
LOG_PATH = "/content/artist-lyric-gen/src/log_dir"<jupyter_output><empty_output><jupyter_text>Get any dependencies needed here  Set Up TensorBoard<jupyter_code>%load_ext tensorboard
%reload_ext tensorboard
!rm -rf $LOG_PATH
%tensorboard --logdir $LOG_PATH --reload_interval 0.1<jupyter_output><empty_output><jupyter_text>Be sure to edit `src/utils.py` to use the persona information you desire!  Initialize args, run code! This cell will run the primary training code, and defaults to 100 epochs.  This takes about 16 - 20 hours in our experience, but you can expirement with smaller models and less data to speed up the process.<jupyter_code>!python main.py -b 256  --data ./dataset/ --persona_data ./dataset/persona_tags_bpe.txt<jupyter_output><empty_output><jupyter_text>Don't forget to download your model once you are done!<jupyter_code>from google.colab import files
files.download('ckpt/cvae.th')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10883620689655173, 'fraction_numerical': 0.009159482758620689, 'mean_word_length': 5.703971119133574, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 23, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '340245', 'license': 'MIT', 'n_tokens_mistral': 625, 'n_tokens_neox': 607, 'n_words': 183, 'path': 'src/notebooks/cvae_train.ipynb', 'repo_name': 'alexameen/artist-lyric-gen', 'size': '1856'}