Spaces:
Runtime error
Runtime error
modify the description to support space duplication.
Browse files
app.py
CHANGED
@@ -75,11 +75,28 @@ model = load_model_from_config(cfg, "model_wo_ema.ckpt", verbose=True)
|
|
75 |
ddim_sampler = DDIMSampler(model)
|
76 |
render_tool = Render_Text(model)
|
77 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
block = gr.Blocks().queue()
|
79 |
|
80 |
with block:
|
81 |
with gr.Row():
|
82 |
-
gr.Markdown(
|
83 |
only_show_rendered_image = gr.Number(value=1, visible=False)
|
84 |
|
85 |
with gr.Column():
|
|
|
75 |
ddim_sampler = DDIMSampler(model)
|
76 |
render_tool = Render_Text(model)
|
77 |
|
78 |
+
|
79 |
+
# description = """
|
80 |
+
# # <center>Expedit-SAM (Expedite Segment Anything Model without any training)</center>
|
81 |
+
# Github link: [Link](https://github.com/Expedit-LargeScale-Vision-Transformer/Expedit-SAM)
|
82 |
+
# You can select the speed mode you want to use from the "Speed Mode" dropdown menu and click "Run" to segment the image you uploaded to the "Input Image" box.
|
83 |
+
# Points per side is a hyper-parameter that controls the number of points used to generate the segmentation masks. The higher the number, the more accurate the segmentation masks will be, but the slower the inference speed will be. The default value is 12.
|
84 |
+
# """
|
85 |
+
|
86 |
+
description = """
|
87 |
+
## Control Stable Diffusion with Glyph Images
|
88 |
+
"""
|
89 |
+
|
90 |
+
SPACE_ID = os.getenv('SPACE_ID')
|
91 |
+
if SPACE_ID is not None:
|
92 |
+
# description += f'\n<p>For faster inference without waiting in queue, you may duplicate the space and upgrade to GPU in settings. < a href=" ">< img style="display: inline; margin-top: 0em; margin-bottom: 0em" src="https://bit.ly/3gLdBN6" alt="Duplicate Space" /></ a></p >'
|
93 |
+
description += f'\n<p>For faster inference without waiting in queue, you may duplicate the space and upgrade to GPU in settings. <a href="https://huggingface.co/spaces/{SPACE_ID}?duplicate=true"><img style="display: inline; margin-top: 0em; margin-bottom: 0em" src="https://bit.ly/3gLdBN6" alt="Duplicate Space" /></a></p>'
|
94 |
+
|
95 |
block = gr.Blocks().queue()
|
96 |
|
97 |
with block:
|
98 |
with gr.Row():
|
99 |
+
gr.Markdown(description)
|
100 |
only_show_rendered_image = gr.Number(value=1, visible=False)
|
101 |
|
102 |
with gr.Column():
|