code: def __init__(
      self,
      weights_path=None,
      vocab_path=None,
      config_path=None,
      name="textgenrnn",
      allow_growth=None,
  ):
      if weights_path is None:
          weights_path = resource_filename(
              __name__, "textgenrnn_weights.hdf5"
          )
  
      if vocab_path is None:
          vocab_path = resource_filename(
              __name__, "textgenrnn_vocab.json"
          )
  
      if allow_growth is not None:
          c = tf.compat.v1.ConfigProto()
          c.gpu_options.allow_growth = True
          set_session(tf.compat.v1.Session(config=c))
  
      if config_path is not None:
          with open(
              config_path, "r", encoding="utf8", errors="ignore"
          ) as json_file:
              self.config = json.load(json_file)
  
      self.config.update({"name": name})
      self.default_config.update({"name": name})
  
      with open(
          vocab_path, "r", encoding="utf8", errors="ignore"
      ) as json_file:
          self.vocab = json.load(json_file)
  
      self.tokenizer = Tokenizer(
          filters="", lower=False, char_level=True
      )
      self.tokenizer.word_index = self.vocab
      self.num_classes = len(self.vocab) + 1
      self.model = textgenrnn_model(
          self.num_classes, cfg=self.config, weights_path=weights_path
      )
      self.indices_char = dict((self.vocab[c], c) for c in self.vocab)
  
imports: import json
  import re
  import numpy
  import tensorflow
  import tqdm
  from pkg_resources import resource_filename
  from sklearn.decomposition import PCA
  from sklearn.manifold import TSNE
  from sklearn.metrics.pairwise import cosine_similarity
  from sklearn.preprocessing import LabelBinarizer
  from tensorflow import config
  from tensorflow.compat.v1.keras.backend import set_session
  from tensorflow.keras.callbacks import LearningRateScheduler
  from tensorflow.keras.models import Model
  from tensorflow.keras.optimizers import Adam
  from tensorflow.keras.preprocessing.text import Tokenizer, text_to_word_sequence
  from .model import textgenrnn_model
  from .model_training import generate_sequences_from_texts
  from .utils import generate_after_epoch, save_model_weights, textgenrnn_encode_sequence, textgenrnn_generate, textgenrnn_texts_from_file, textgenrnn_texts_from_file_context
label_desc: Use image node_id 1 to create a new textgenrnn object  with example: obj = textgenrnn(weights_path, vocab_path, config_path, name, allow_growth)