Hello. I was training gpt2 model 124M. And it went wrong. Like after extensive training of 1day nearly complete pc on. lots of computation and resources. It gave an attribute error.
This was the code:
import gpt_2_simple as gpt2
import os
# Path to your training data file (process.txt)
data_file_path = 'process.txt'
# Set up the GPT-2 model
model_name = "124M" # You can also use "774M" or "1558M" for larger models
sess = gpt2.start_tf_sess()
# Download the GPT-2 model
gpt2.download_gpt2(model_name="124M")
# Train the GPT-2 model
gpt2.finetune(sess,
dataset=data_file_path,
model_name=model_name,
steps=1000, # You can adjust the number of training steps as needed
restore_from='fresh',
run_name='chatbot_model')
# Save the trained model
model_directory = os.path.join(gpt2.models.GPT2_MODEL_DIR, model_name)
gpt2.save_gpt2(sess, run_name='chatbot_model', model_name=model_directory)
and it gave the error: ```
Saving checkpoint/chatbot_model/model-1000
Traceback (most recent call last):
File "/home/ahmed/bots/train.py", line 23, in <module>
model_directory = os.path.join(gpt2.models.GPT2_MODEL_DIR, model_name)
^^^^^^^^^^^
AttributeError: module 'gpt_2_simple' has no attribute 'models'. Did you mean: 'model'?
so please help me i don't want to loose the trained model.