Spaces:
Running
on
Zero
Running
on
Zero
update UI
Browse files
app.py
CHANGED
@@ -1444,8 +1444,9 @@ def run_fn(
|
|
1444 |
info2 = 'Or try use the Python package that powers this app: <a style="white-space: nowrap;text-underline-offset: 2px;color: var(--body-text-color)" href="https://ncut-pytorch.readthedocs.io/en/latest/">ncut-pytorch</a>'
|
1445 |
info = info1 + info2
|
1446 |
|
1447 |
-
message = "<b>HuggingFace: </b></br>" + e.message + "</br></br>---------</br>" + "<b>`ncut-pytorch` Developer: </b></br>" + info
|
1448 |
-
|
|
|
1449 |
|
1450 |
|
1451 |
import torch
|
@@ -1856,7 +1857,7 @@ def make_input_images_section(rows=1, cols=3, height="450px", advanced=False, is
|
|
1856 |
save_profile_button.click(fn=lambda name, images: on_disk_profiles.save_profile(name, images), inputs=[profile_text, input_gallery])
|
1857 |
load_profile_button.click(fn=lambda name, existing_images: gr.update(value=on_disk_profiles.load_profile(name, existing_images)), inputs=[profile_text, input_gallery], outputs=[input_gallery])
|
1858 |
delete_profile_button.click(fn=lambda name: on_disk_profiles.delete_profile(name), inputs=profile_text)
|
1859 |
-
list_profiles_button.click(fn=lambda: gr.Info(on_disk_profiles.list_profiles(), duration=
|
1860 |
|
1861 |
if advanced:
|
1862 |
advanced_block.visible = True
|
@@ -2314,7 +2315,7 @@ with demo:
|
|
2314 |
fig, ax = plt.subplots(1, 1, figsize=(6, 6))
|
2315 |
ax.scatter(tsne_embed[:, 0], tsne_embed[:, 1], s=20, c=fps_tsne3d_rgb)
|
2316 |
# compute the length of the edges
|
2317 |
-
lengthes = np.linalg.norm(tsne_embed[edges[:, 0]] - tsne_embed[edges[:, 1]], axis=1)
|
2318 |
# max_length = lengthes[k:].max()
|
2319 |
# diag_length = np.linalg.norm(tsne_embed.max(axis=0) - tsne_embed.min(axis=0))
|
2320 |
|
|
|
1444 |
info2 = 'Or try use the Python package that powers this app: <a style="white-space: nowrap;text-underline-offset: 2px;color: var(--body-text-color)" href="https://ncut-pytorch.readthedocs.io/en/latest/">ncut-pytorch</a>'
|
1445 |
info = info1 + info2
|
1446 |
|
1447 |
+
# message = "<b>HuggingFace: </b></br>" + e.message + "</br></br>---------</br>" + "<b>`ncut-pytorch` Developer: </b></br>" + info
|
1448 |
+
gr.Warning(info, duration=0)
|
1449 |
+
raise gr.Error(e.message , duration=0)
|
1450 |
|
1451 |
|
1452 |
import torch
|
|
|
1857 |
save_profile_button.click(fn=lambda name, images: on_disk_profiles.save_profile(name, images), inputs=[profile_text, input_gallery])
|
1858 |
load_profile_button.click(fn=lambda name, existing_images: gr.update(value=on_disk_profiles.load_profile(name, existing_images)), inputs=[profile_text, input_gallery], outputs=[input_gallery])
|
1859 |
delete_profile_button.click(fn=lambda name: on_disk_profiles.delete_profile(name), inputs=profile_text)
|
1860 |
+
list_profiles_button.click(fn=lambda: gr.Info(on_disk_profiles.list_profiles(), duration=10))
|
1861 |
|
1862 |
if advanced:
|
1863 |
advanced_block.visible = True
|
|
|
2315 |
fig, ax = plt.subplots(1, 1, figsize=(6, 6))
|
2316 |
ax.scatter(tsne_embed[:, 0], tsne_embed[:, 1], s=20, c=fps_tsne3d_rgb)
|
2317 |
# compute the length of the edges
|
2318 |
+
# lengthes = np.linalg.norm(tsne_embed[edges[:, 0]] - tsne_embed[edges[:, 1]], axis=1)
|
2319 |
# max_length = lengthes[k:].max()
|
2320 |
# diag_length = np.linalg.norm(tsne_embed.max(axis=0) - tsne_embed.min(axis=0))
|
2321 |
|