aitextgen icon indicating copy to clipboard operation
aitextgen copied to clipboard

Error creating aitextgen instance

Open metaphorz opened this issue 4 years ago • 1 comments

I could not find this in the existing issues, but when running on colab I get the following. The file tree looks correct within colab. Should the directory "models" be changed to "model_folder" ? Also, I am using the shortcut as suggested but can easily just replicate the file tree in my Google Drive, if that would help. Here is the Colab that uses aitextgen:

https://colab.research.google.com/github/thunderclapinteractive/poetrywtf-nlp/blob/main/notebooks/generate_gpt_2_poetry_with_aitextgen.ipynb

AssertionError Traceback (most recent call last)

/usr/local/lib/python3.7/dist-packages/aitextgen/aitextgen.py in init(self, model, model_folder, config, vocab_file, merges_file, tokenizer_file, schema_tokens, schema_return, cache_dir, tf_gpt2, to_gpu, to_fp16, verbose, gradient_checkpointing, bos_token, eos_token, unk_token, **kwargs) 102 if model: 103 assert not os.path.isfile(model), ( --> 104 "As of aitextgen 0.5.0, you must " 105 + "use model_folder to load an existing model." 106 )

AssertionError: As of aitextgen 0.5.0, you must use model_folder to load an existing model.

metaphorz avatar Jul 31 '21 18:07 metaphorz

just change it to

ai = aitextgen(model_folder=f"{run_dir}", to_gpu=True)

redthing1 avatar Aug 27 '21 20:08 redthing1