Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
Fix for new version
Browse files Browse the repository at this point in the history
  • Loading branch information
krshrimali committed Jun 15, 2022
1 parent 149cc16 commit 1ba45af
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,15 @@ Methods which can be overridden will be included later.
```python
from typing import List, Any

from lightning import LightningFlow, LightningApp, LightningWork
from lightning.frontend import StreamlitFrontend
from lightning.utilities.state import AppState

import lightning as L
from lightning.app.frontend import StreamlitFrontend
from lightning.app.utilities.state import AppState

from hp_space_generator import HPSpaceGenerator
from hp_space_generator import RandomSearchStrategy, GridSearchStrategy


class DoSomethingExtra(LightningWork):
class DoSomethingExtra(L.LightningWork):
def __init__(self):
super().__init__(run_once=True)
self.hpe_list = []
Expand All @@ -68,7 +67,7 @@ def _render_fn(state: AppState):
st.table(pd.DataFrame(state.data))


class Visualizer(LightningFlow):
class Visualizer(L.LightningFlow):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.data = None
Expand All @@ -80,7 +79,7 @@ class Visualizer(LightningFlow):
return StreamlitFrontend(render_fn=_render_fn)


class HPComponent(LightningFlow):
class HPComponent(L.LightningFlow):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.space_generator = HPSpaceGenerator()
Expand Down Expand Up @@ -114,5 +113,5 @@ class HPComponent(LightningFlow):


# To launch the hpe Component
app = LightningApp(HPComponent(), debug=True)
app = L.LightningApp(HPComponent(), debug=True)
```

0 comments on commit 1ba45af

Please sign in to comment.