Load the encoder `name` from the model directory.
161028
def load_encoder(self, name:str, device:torch.device=None):
        ""
        encoder = get_model(self.model)[0]
        if device is None: device = self.data.device
        if hasattr(encoder, 'module'): encoder = encoder.module
        encoder.load_state_dict(torch.load(self.path/self.model_dir/f'{name}.pth'))
        encoder.load_state_dict(torch.load(self.path/self.model_dir/f'{name}.pth', map_location=device))
        self.freeze()
721868
def load(name)
      name = name.to_sym
      raise "Could not find SimpleCov Profile called '#{name}'" unless key?(name)
      SimpleCov.configure(&self[name])
    end
936859
def _load_from_yaml(self, filename: str, model_identifiers: Dict[str, List[str]]):
        
        class_name = filename[:filename.rfind('.')]
        rendered_yaml = self.env.get_template(filename).render(
            model_identifiers=model_identifiers)
        fixture_data, self.relationships[class_name] = self._post_process_yaml_data(
            yaml.load(rendered_yaml),
            self.factory.get_relationships(class_name))

        for identifier_key, data in fixture_data.items():
            self.model_fixtures[class_name][identifier_key] = data
865003
def load_model_from_path(model_path, meta=False, **overrides):
    """"""
    if not meta:
        meta = get_model_meta(model_path)
    cls = get_lang_class(meta["lang"])
    nlp = cls(meta=meta, **overrides)
    pipeline = meta.get("pipeline", [])
    disable = overrides.get("disable", [])
    if pipeline is True:
        pipeline = nlp.Defaults.pipe_names
    elif pipeline in (False, None):
        pipeline = []
    for name in pipeline:
        if name not in disable:
            config = meta.get("pipeline_args", {}).get(name, {})
            component = nlp.create_pipe(name, config=config)
            nlp.add_pipe(component, name=name)
    return nlp.from_disk(model_path)
251231
def load_classifier():
    """"""
    path = os.path.join(l.TOPDIR, 'clf.pickle')
    obj = pickle.load(open(path, 'r'))

    return obj['tfidf_model'], obj['clf'], obj['target_names']
849796
def load_model_data(self, path, model):
        
        if os.path.isdir(path):
            # try find a model data collection
            if os.path.isfile(os.path.join(path, '_all.yml')):
                self.load_model_data_collection(path, model)
            self.load_model_data_from_files(path, model)
            self.session.commit()
53550
def _load_model(self, dct):
        
        classname, version, _ = _pop_metadata(dct)

        _check_version(version)
        cls = self._models[classname]

        # Use `from_json` if available
        if hasattr(cls, 'from_json'):
            return cls.from_json(dct)

        # Default to object constructor
        return cls(**dct)
416673
def load_precise_model(model_name: str) -> Any:
    """"""
    if not model_name.endswith('.net'):
        print('Warning: Unknown model type, ', model_name)

    inject_params(model_name)
    return load_keras().models.load_model(model_name)
64723
def load_datafile(name, search_path, codecs=get_codecs(), **kwargs):
    
    return munge.load_datafile(name, search_path, codecs, **kwargs)
14027
def load_model(path):
    """"""
    abspath = find_data(path)
    cached = _model_cache.get(abspath)
    if cached is not None:
        log.debug('Using cached copy of %s' % path)
        return cached
    log.debug('Loading model %s' % path)
    try:
        with io.open(abspath, 'rb') as f:
            model = six.moves.cPickle.load(f)
    except IOError:
        raise ModelNotFoundError('Could not load %s. Have you run `cde data download`?' % path)
    _model_cache[abspath] = model
    return model
1306701
def load(filename, loader=None, implicit_tuple=True, env={}, schema=None):
  """"""
  with open(filename, 'r') as f:
    return loads(f.read(),
                 filename=filename,
                 loader=loader,
                 implicit_tuple=implicit_tuple,
                 env=env,
                 schema=schema)
232299
def get_model_loader(filename):
    
    assert isinstance(filename, six.string_types), filename
    filename = os.path.expanduser(filename)
    if filename.endswith('.npy'):
        assert tf.gfile.Exists(filename), filename
        return DictRestore(np.load(filename, encoding='latin1').item())
    elif filename.endswith('.npz'):
        assert tf.gfile.Exists(filename), filename
        obj = np.load(filename)
        return DictRestore(dict(obj))
    else:
        return SaverRestore(filename)
313476
def load_model_from_path(model_path, meta=False, **overrides):
    """"""
    from .tokenizer_loader import TokenizerLoader

    if not meta:
        meta = get_model_meta(model_path)
    tokenizer_loader = TokenizerLoader(meta=meta, **overrides)
    tokenizers = meta.get('tokenizers', [])
    disable = overrides.get('disable', [])
    if tokenizers is True:
        tokenizers = TokenizerLoader.Defaults.tokenizers
    elif tokenizers in (False, None):
        tokenizers = []
    for tokenizer_name in tokenizers:
        if tokenizer_name not in disable:
            config = meta.get('tokenizer_args', {}).get(tokenizer_name, {})
            component = tokenizer_loader.create_tokenizer(tokenizer_name, config=config)
            tokenizer_loader.add_tokenizer(component, name=tokenizer_name)
    return tokenizer_loader.from_disk(model_path)
1071638
def load_object_by_name(obj_name):
    
    parts = obj_name.split('.')
    t = __import__('.'.join(parts[:-1]), fromlist=(parts[-1],))
    return getattr(t, parts[-1])
777943
def load_data_and_model(items_as_dict, **context):
    
    res = {}
    for k, v in items_as_dict.items():
        if isinstance(v, str):
            if os.path.splitext(v)[-1] == ".pkl":
                with open(v, "rb") as f:
                    try:
                        bin = pickle.load(f)
                    except ImportError as e:
                        if '.model.' in v:
                            continue
                        else:
                            raise ImportError("Unable to load '{0}' due to {1}".format(v, e))
                    res[k] = bin
            elif os.path.splitext(v)[-1] == ".keras":
                import keras.models
                res[k] = keras.models.load_model(v, custom_objects=context)
            else:
                res[k] = v
        else:
            res[k] = v
    return res
727988
def load_object(name):
    """"""

    if "." not in name:
        raise Exception('load object need module.object')

    module_name, object_name = name.rsplit('.', 1)
    if six.PY2:
        module = __import__(module_name, globals(), locals(), [utf8(object_name)], -1)
    else:
        module = __import__(module_name, globals(), locals(), [object_name])
    return getattr(module, object_name)
341623
def load(self , filename=None, data=None):
        

        self.__load(filename=filename, data=data)