<jupyter_start><jupyter_text>we can load the model back if we have a learner created<jupyter_code>learn.load("my_model")<jupyter_output><empty_output><jupyter_text>We can download the model from the artifact:<jupyter_code>api = wandb.Api()
artifact = api.artifact('capecape/inference_fastai/my_model:latest')
artifact_dir = artifact.download()
Path(artifact_dir).ls()<jupyter_output><empty_output><jupyter_text>it works 😎 (this guy wants a full path)<jupyter_code>learn.load(Path(artifact_dir).absolute()/"my_model")<jupyter_output><empty_output><jupyter_text>Exporting the Learner<jupyter_code>learn.export("learner.pkl")
at = wandb.Artifact("Model_learner", 
                    type="model", 
                    description="The fastai learner object")
at.add_file("learner.pkl")
with wandb.init(project='inference_fastai', job_type="save_learn"):
    wandb.log_artifact(at)
api = wandb.Api()
artifact = api.artifact('capecape/inference_fastai/Model_learner:latest')
artifact_dir = artifact.download()
Path(artifact_dir).ls()
learn = load_learner(Path(artifact_dir)/"learner.pkl")<jupyter_output>wandb: ERROR Error while calling W&B API: json: cannot unmarshal string into Go value of type map[string]interface {} (<Response [500]>)
{'fraction_non_alphanumeric': 0.12864077669902912, 'fraction_numerical': 0.0024271844660194173, 'mean_word_length': 7.032467532467533, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '604009', 'license': 'Apache-2.0', 'n_tokens_mistral': 441, 'n_tokens_neox': 420, 'n_words': 75, 'path': 'inference_fastai.ipynb', 'repo_name': 'tcapelle/fastai_dev', 'size': '1236'}