class_docstr: PyTorch implementation containing all the modelling needed for your NLP task. Combines a language
  model and a prediction head. Allows for gradient flow back to the language model component.
class_docstr_tok: ["PyTorch","implementation","containing","all","the","modelling","needed","for","your","NLP","task",".","Combines","a","language","model","and","a","prediction","head",".","Allows","for","gradient","flow","back","to","the","language","model","component","."]
docstr: Saves the language model and prediction heads. This will generate a config file
  and model weights for each.
  
  :param save_dir: path to save to
  :type save_dir: Path
code: def save(self, save_dir):
      """
      Saves the language model and prediction heads. This will generate a config file
      and model weights for each.
  
      :param save_dir: path to save to
      :type save_dir: Path
      """
      os.makedirs(save_dir, exist_ok=True)
      self.language_model.save(save_dir)
      for i, ph in enumerate(self.prediction_heads):
          ph.save(save_dir, i)
  
imports: import copy
  import json
  import logging
  import os
  from pathlib import Path
  import multiprocessing
  import numpy
  import torch
  from torch import nn
  from transformers import AutoConfig
  from transformers.convert_graph_to_onnx import convert, quantize
  from farm.data_handler.processor import Processor
  from farm.modeling.language_model import LanguageModel
  from farm.modeling.prediction_head import PredictionHead, pick_single_fn
  from farm.utils import MLFlowLogger, stack
  import farm.conversion.transformers
label_desc: Use image node_id 4 for calling the AdaptiveModel obj's underlying member method code with example usage: obj.save(save_dir) without return types