Spaces:
Running on Zero
Running on Zero
fix model card button
Browse files
app.py
CHANGED
|
@@ -276,7 +276,8 @@ def build_app(predict_fn, model_choices: list[str]) -> gr.Blocks:
|
|
| 276 |
with gr.Row():
|
| 277 |
analyze_btn = gr.Button("π Analyze", variant="primary", scale=2)
|
| 278 |
clear_btn = gr.Button("ποΈ Clear", scale=1)
|
| 279 |
-
|
|
|
|
| 280 |
|
| 281 |
gr.Markdown("### π€ Model")
|
| 282 |
model_dropdown = gr.Dropdown(
|
|
@@ -498,16 +499,15 @@ def build_app(predict_fn, model_choices: list[str]) -> gr.Blocks:
|
|
| 498 |
}"""
|
| 499 |
)
|
| 500 |
|
|
|
|
|
|
|
|
|
|
| 501 |
@spaces.GPU
|
| 502 |
def _gpu_dummy():
|
| 503 |
return None
|
| 504 |
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
inputs=[],
|
| 508 |
-
outputs=[],
|
| 509 |
-
js='() => window.open("https://huggingface.co/realphongha/danbooru-tag-query", "_blank")'
|
| 510 |
-
)
|
| 511 |
|
| 512 |
# ββ model switcher ββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 513 |
|
|
|
|
| 276 |
with gr.Row():
|
| 277 |
analyze_btn = gr.Button("π Analyze", variant="primary", scale=2)
|
| 278 |
clear_btn = gr.Button("ποΈ Clear", scale=1)
|
| 279 |
+
with gr.Column():
|
| 280 |
+
gr.Markdown('[π **Model Card**](https://huggingface.co/realphongha/danbooru-tag-query)')
|
| 281 |
|
| 282 |
gr.Markdown("### π€ Model")
|
| 283 |
model_dropdown = gr.Dropdown(
|
|
|
|
| 499 |
}"""
|
| 500 |
)
|
| 501 |
|
| 502 |
+
# HF ZeroGPU requires @spaces.GPU somewhere in code
|
| 503 |
+
gpu_hidden_state = gr.State(value=None)
|
| 504 |
+
|
| 505 |
@spaces.GPU
|
| 506 |
def _gpu_dummy():
|
| 507 |
return None
|
| 508 |
|
| 509 |
+
gpu_hidden_state.change(fn=_gpu_dummy, inputs=[gpu_hidden_state], outputs=[gpu_hidden_state])
|
| 510 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
| 511 |
|
| 512 |
# ββ model switcher ββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 513 |
|