lightning/docs/source-app/landing_app.py

13 lines
311 B
Python

# app.py
from lightning.app import LightningWork, LightningApp, CloudCompute
class YourComponent(LightningWork):
def run(self):
print('RUN ANY PYTHON CODE HERE')
# run on a cloud machine ("cpu", "gpu", ...)
component = YourComponent(cloud_compute=CloudCompute("cpu"))
app = LightningApp(component)