class_docstr: The ``ServeStreamlit`` work allows you to use streamlit from a work.
  
  You can optionally build a model in the ``build_model`` hook, which will only be called once per session.
class_docstr_tok: ["The","``","ServeStreamlit","``","work","allows","you","to","use","streamlit","from","a","work",".","You","can","optionally","build","a","model","in","the","``","build_model","``","hook",",","which","will","only","be","called","once","per","session","."]
code: def run(self) -> None:
      env = os.environ.copy()
      env["LIGHTNING_COMPONENT_NAME"] = self.name
      env["LIGHTNING_WORK"] = self.__class__.__name__
      env["LIGHTNING_WORK_MODULE_FILE"] = inspect.getmodule(
          self
      ).__file__
      self._process = subprocess.Popen(
          [
              sys.executable,
              "-m",
              "streamlit",
              "run",
              __file__,
              "--server.address",
              str(self.host),
              "--server.port",
              str(self.port),
              "--server.headless",
              "true",  # do not open the browser window when running locally
          ],
          env=env,
      )
      self.ready = True
      self._process.wait()
  
imports: import abc
  import inspect
  import os
  import pydoc
  import subprocess
  import sys
  from typing import Any, Callable, Type
  from lightning.app.core.work import LightningWork
  from lightning.app.utilities.app_helpers import StreamLitStatePlugin
  from lightning.app.utilities.state import AppState
label_desc: Use image node_id 5 for calling the ServeStreamlit obj's underlying member method code with example usage: obj.run() without return types