Complete the code to load a pre-trained model for fine-tuning.
model = load_model('[1]')
We start fine-tuning from a base-model that already learned general knowledge.
Complete the code to prepare domain-specific data for fine-tuning.
domain_data = load_data('[1]')
Fine-tuning uses domain_corpus.txt to adapt the model to the specific domain.
Fix the error in the fine-tuning loop by completing the missing method call.
for batch in domain_data: loss = model.[1](batch) loss.backward()
The forward method computes the output and loss during training.
Fill both blanks to update the model parameters during fine-tuning.
optimizer.[1]() optimizer.[2]()
First, zero_grad() clears old gradients. Then, step() updates model weights.
Fill all three blanks to create a dictionary of fine-tuned model metrics.
metrics = {'loss': [1], 'accuracy': [2], 'epoch': [3]We store the current loss_value, acc_value, and current_epoch in the metrics dictionary.
