class_docstr: Component which provides the common loaded SpaCy model to others.
  
  This is used to avoid loading the SpaCy model multiple times. Instead the Spacy
  model is only loaded once and then shared by depending components.
class_docstr_tok: ["Component","which","provides","the","common","loaded","SpaCy","model","to","others",".","This","is","used","to","avoid","loading","the","SpaCy","model","multiple","times",".","Instead","the","Spacy","model","is","only","loaded","once","and","then","shared","by","depending","components","."]
docstr: Try loading the model, catching the OSError if missing.
docstr_tok: ["Try","loading","the","model",",","catching","the","OSError","if","missing","."]
code: def load_model(spacy_model_name: Text) -> SpacyModel:
      """Try loading the model, catching the OSError if missing."""
      import spacy
  
      if not spacy_model_name:
          raise InvalidModelError(
              f"Missing model configuration for `SpacyNLP` in `config.yml`.\n"
              f"You must pass a model to the `SpacyNLP` component explicitly.\n"
              f"For example:\n"
              f"- name: SpacyNLP\n"
              f"  model: en_core_web_md\n"
              f"More information can be found on {DOCS_URL_COMPONENTS}#spacynlp"
          )
  
      try:
          language = spacy.load(spacy_model_name, disable=["parser"])
          spacy_runtime_version = spacy.about.__version__
          spacy_model_info = spacy.info(spacy_model_name)
          spacy_model_version_req = (
              spacy_model_info.get("spacy_version")
              if isinstance(spacy_model_info, dict)
              else ""
          )
          if not spacy.util.is_compatible_version(
              spacy_runtime_version, spacy_model_version_req
          ):
              raise InvalidModelError(
                  f"The specified model - {spacy_model_name} requires a spaCy "
                  f"runtime version {spacy_model_version_req} and is not compatible "
                  f"with the current spaCy runtime version {spacy_runtime_version}"
              )
          return SpacyModel(model=language, model_name=spacy_model_name)
      except OSError:
          raise InvalidModelError(
              f"Please confirm that {spacy_model_name} is an available spaCy model. "
              f"You need to download one upfront. For example:\n"
              f"python -m spacy download en_core_web_md\n"
              f"More information can be found on {DOCS_URL_COMPONENTS}#spacynlp"
          )
  
imports: from __future__ import annotations
  import dataclasses
  import typing
  import logging
  from typing import Any, Dict, List, Optional, Text, Tuple
  from rasa.engine.graph import ExecutionContext, GraphComponent
  from rasa.engine.recipes.default_recipe import DefaultV1Recipe
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
  from rasa.nlu.constants import DENSE_FEATURIZABLE_ATTRIBUTES, SPACY_DOCS
  from rasa.shared.nlu.training_data.message import Message
  from rasa.shared.nlu.training_data.training_data import TrainingData
  from rasa.nlu.model import InvalidModelError
  from rasa.shared.constants import DOCS_URL_COMPONENTS
label_desc: Use image node_id 3 for calling the SpacyNLP obj's underlying member method code with example usage: obj.load_model(spacy_model_name) and returns: SpacyModel