class_docstr: a ``Predictor`` is a thin wrapper around an AllenNLP model that handles JSON -> JSON predictions
  that can be used for serving models through the web API or making predictions in bulk.
class_docstr_tok: ["a","``","Predictor","``","is","a","thin","wrapper","around","an","AllenNLP","model","that","handles","JSON","-",">","JSON","predictions","that","can","be","used","for","serving","models","through","the","web","API","or","making","predictions","in","bulk","."]
docstr: Instantiate a :class:`Predictor` from an :class:`~allennlp.models.archival.Archive`;
  that is, from the result of training a model. Optionally specify which `Predictor`
  subclass; otherwise, the default one for the model will be used.
docstr_tok: ["Instantiate","a",":","class",":","`","Predictor","`","from","an",":","class",":","`","~allennlp.models.archival.Archive","`",";","that","is",",","from","the","result","of","training","a","model",".","Optionally","specify","which","`","Predictor","`","subclass",";","otherwise",",","the","default","one","for","the","model","will","be","used","."]
code: def from_archive(cls, archive, predictor_name=None):
      """
      Instantiate a :class:`Predictor` from an :class:`~allennlp.models.archival.Archive`;
      that is, from the result of training a model. Optionally specify which `Predictor`
      subclass; otherwise, the default one for the model will be used.
      """
      # Duplicate the config so that the config inside the archive doesn't get consumed
      config = archive.config.duplicate()
  
      if not predictor_name:
          model_type = config.get("model").get("type")
          if not model_type in DEFAULT_PREDICTORS:
              raise ConfigurationError(
                  "No default predictor for model type {model_type}.\n"
                  "Please specify a predictor explicitly."
              )
          predictor_name = DEFAULT_PREDICTORS[model_type]
  
      dataset_reader_params = config["dataset_reader"]
      dataset_reader = DatasetReader.from_params(dataset_reader_params)
  
      model = archive.model
      model.eval()
  
      return Predictor.by_name(predictor_name)(model, dataset_reader)
  
imports: from __future__ import absolute_import
  import json
  from allennlp.common import Registrable
  from allennlp.common.checks import ConfigurationError
  from allennlp.common.util import JsonDict, sanitize
  from allennlp.data import DatasetReader, Instance
  from allennlp.models import Model
  from allennlp.models.archival import load_archive
label_desc: Use image node_id 11 for calling the Predictor obj's underlying member method code with example usage: obj.from_archive(cls, archive, predictor_name) and returns: Predictor