Save Artifact#

Perfect! Now you have started the fine-tuning job in the cloud. However, fine-tuning takes time. It highly depends on the size of your training data, evaluation data and other hyper-parameters. Because of this, you might have to close the session and reconnect to it several times.

In the following example, we show how to connect to an existing run and download a tuned model:

import finetuner


# connect to the experiment we created previously.
experiment = finetuner.get_experiment('finetune-flickr-dataset')
# connect to the run we created previously.
run = experiment.get_run('finetune-flickr-dataset-efficientnet-1')
print(f'Run status: {run.status()}')
print(f'Run artifact id: {run.artifact_id}')
print(f'Run logs: {run.logs()}')
# save the artifact.

If the fine-tuning finished, you can see this in the terminal:

🔐 Successfully login to Jina Ecosystem!
Run status: FINISHED
Run Artifact id: 62972acb5de25a53fdbfcecc
Run logs:

  Training [2/2] ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 50/50 0:00:00 0:01:08 • loss: 0.050
[09:13:23] INFO     [__main__] Done ✨                 
           INFO     [__main__] Saving fine-tuned models ...
           INFO     [__main__] Saving model 'model' in 
                    /usr/src/app/tuned-models/model ...                         
           INFO     [__main__] Pushing saved model to Hubble ...
[09:13:54] INFO     [__main__] Pushed model artifact ID:
           INFO     [__main__] Finished 🚀             ```