Spaces:
Running
Running
Download old_code/optimisation.py from nhamid289/optimization-dev: direct link, hf CLI and curl.
- Browser
- Download file 788 Bytes
-
https://huggingface.co/spaces/nhamid289/optimization-dev/resolve/main/old_code/optimisation.py
- Command line
-
hf download hf://spaces/nhamid289/optimization-dev/old_code/optimisation.py
-
curl -L -o optimisation.py https://huggingface.co/spaces/nhamid289/optimization-dev/resolve/main/old_code/optimisation.py
788 Bytes
| import gradio as gr | |
| from bivariate import Bivariate | |
| from univariate import Univariate | |
| class Optimisation: | |
| def __init__(self, width=1200, height=900): | |
| self.width = width | |
| self.height = height | |
| self.univariate = Univariate(width, height) | |
| self.bivariate = Bivariate(width, height) | |
| def on_load(self): | |
| self.univariate.reset() | |
| self.bivariate.reset() | |
| def launch(self): | |
| with gr.Blocks() as demo: | |
| gr.HTML("<div style='text-align:left; font-size:40px; font-weight: bold;'>Optimisation trajectory visualizer</div>") | |
| self.univariate.build() | |
| self.bivariate.build() | |
| demo.load(self.on_load) | |
| demo.launch() | |
| visualizer = Optimisation(width=1200, height=900) | |
| visualizer.launch() | |