I am using the code from here, but I do not how to save the model, encoder and decoder so I do not have to train it every time I want to use it https://pytorch.org/tutorials/intermediate/seq2seq_translation_tutorial.html#training-and-evaluating 25
This part is crucial for me - i want to save encoder1 and attn_decoder1 so I can use them after.
How do I do that?
train_now = "yes"
if train_now == "yes": 
    hidden_size = 256
    print("input_lang.n_words",input_lang.n_words)
    print("input_lang.n_words",input_lang.n_words)
    encoder1 = EncoderRNN(input_lang.n_words, hidden_size).to(device)
    attn_decoder1 = AttnDecoderRNN(hidden_size, output_lang.n_words, dropout_p=0.1).to(device)
    trainIters(encoder1, attn_decoder1, 5000, print_every=50)
    evaluateRandomly(encoder1, attn_decoder1)
else: 
    #load somehow encoder1 and attn_decoder1
    evaluateRandomly(encoder1, attn_decoder1)
######################################################################