add health check
Browse files- app_base.py +11 -0
app_base.py
CHANGED
|
@@ -139,6 +139,9 @@ def resize_image(image, target_size = 1024):
|
|
| 139 |
|
| 140 |
def create_demo() -> gr.Blocks:
|
| 141 |
|
|
|
|
|
|
|
|
|
|
| 142 |
with gr.Blocks() as demo:
|
| 143 |
cropper = gr.State()
|
| 144 |
with gr.Row():
|
|
@@ -160,6 +163,8 @@ def create_demo() -> gr.Blocks:
|
|
| 160 |
start_step = gr.Slider(minimum=1, maximum=100, value=15, step=1, label="Start Step")
|
| 161 |
filter = gr.Dropdown(choices=filter_names, label="Filter", value="NONE")
|
| 162 |
g_btn = gr.Button("Edit Image")
|
|
|
|
|
|
|
| 163 |
with gr.Accordion("Advanced Options", open=False):
|
| 164 |
guidance_scale = gr.Slider(minimum=0, maximum=20, value=0, step=0.5, label="Guidance Scale")
|
| 165 |
seed = gr.Number(label="Seed", value=8)
|
|
@@ -190,4 +195,10 @@ def create_demo() -> gr.Blocks:
|
|
| 190 |
outputs=[restored_image, download_path],
|
| 191 |
)
|
| 192 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 193 |
return demo
|
|
|
|
| 139 |
|
| 140 |
def create_demo() -> gr.Blocks:
|
| 141 |
|
| 142 |
+
def health_check():
|
| 143 |
+
return "Healthy"
|
| 144 |
+
|
| 145 |
with gr.Blocks() as demo:
|
| 146 |
cropper = gr.State()
|
| 147 |
with gr.Row():
|
|
|
|
| 163 |
start_step = gr.Slider(minimum=1, maximum=100, value=15, step=1, label="Start Step")
|
| 164 |
filter = gr.Dropdown(choices=filter_names, label="Filter", value="NONE")
|
| 165 |
g_btn = gr.Button("Edit Image")
|
| 166 |
+
health_btn = gr.Button("Health Check", visible=False)
|
| 167 |
+
health_output = gr.Textbox(label="Health Check Output", visible=False)
|
| 168 |
with gr.Accordion("Advanced Options", open=False):
|
| 169 |
guidance_scale = gr.Slider(minimum=0, maximum=20, value=0, step=0.5, label="Guidance Scale")
|
| 170 |
seed = gr.Number(label="Seed", value=8)
|
|
|
|
| 195 |
outputs=[restored_image, download_path],
|
| 196 |
)
|
| 197 |
|
| 198 |
+
health_btn.click(
|
| 199 |
+
fn=health_check,
|
| 200 |
+
inputs=[],
|
| 201 |
+
outputs=[health_output],
|
| 202 |
+
)
|
| 203 |
+
|
| 204 |
return demo
|