hysts HF staff commited on
Commit
284e394
β€’
1 Parent(s): fc67167
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -13,9 +13,6 @@ from model import Model
13
 
14
  DESCRIPTION = "# [UniDiffuser](https://github.com/thu-ml/unidiffuser)"
15
 
16
- SPACE_ID = os.getenv("SPACE_ID")
17
- if SPACE_ID is not None:
18
- 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>'
19
  if not torch.cuda.is_available():
20
  DESCRIPTION += "\n<p>Running on CPU πŸ₯Ά</p>"
21
 
@@ -116,6 +113,11 @@ def create_demo(mode_name: str) -> gr.Blocks:
116
 
117
  with gr.Blocks(css="style.css") as demo:
118
  gr.Markdown(DESCRIPTION)
 
 
 
 
 
119
  with gr.Tabs():
120
  with gr.TabItem("text2image"):
121
  create_demo("t2i")
 
13
 
14
  DESCRIPTION = "# [UniDiffuser](https://github.com/thu-ml/unidiffuser)"
15
 
 
 
 
16
  if not torch.cuda.is_available():
17
  DESCRIPTION += "\n<p>Running on CPU πŸ₯Ά</p>"
18
 
 
113
 
114
  with gr.Blocks(css="style.css") as demo:
115
  gr.Markdown(DESCRIPTION)
116
+ gr.DuplicateButton(
117
+ value="Duplicate Space for private use",
118
+ elem_id="duplicate-button",
119
+ visible=os.getenv("SHOW_DUPLICATE_BUTTON") == "1",
120
+ )
121
  with gr.Tabs():
122
  with gr.TabItem("text2image"):
123
  create_demo("t2i")