Zaesar commited on
Commit
fd4339d
·
1 Parent(s): 0483f57

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py CHANGED
@@ -19,6 +19,17 @@ def parse_args() -> argparse.Namespace:
19
  action='store_false')
20
  return parser.parse_args()
21
 
 
 
 
 
 
 
 
 
 
 
 
22
  DESCRIPTION = '''
23
  <div align=center>
24
  <h1 style="font-weight: 900; margin-bottom: 7px;">
 
19
  action='store_false')
20
  return parser.parse_args()
21
 
22
+ is_shared_ui = True if "AIFILMS/StyleGANEX" in os.environ['SPACE_ID'] else False
23
+
24
+ if(is_shared_ui):
25
+ with gr.Box():
26
+ top_description = gr.HTML(f'''
27
+ <div class="gr-prose" style="max-width: 80%">
28
+ <h2 style="margin-top: 0">Attention - This Space doesn't work in this shared UI</h2>
29
+ <p>For it to work, you can access the <a href="https://huggingface.co/spaces/PKUWilliamYang/StyleGANEX">original</a> or duplicate this Space and run it on your own profile using a GPU.&nbsp;&nbsp;<a class="duplicate-button" style="display:inline-block" target="_blank" href="https://huggingface.co/spaces/{os.environ['SPACE_ID']}?duplicate=true"><img src="https://img.shields.io/badge/-Duplicate%20Space-blue?labelColor=white&style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAP5JREFUOE+lk7FqAkEURY+ltunEgFXS2sZGIbXfEPdLlnxJyDdYB62sbbUKpLbVNhyYFzbrrA74YJlh9r079973psed0cvUD4A+4HoCjsA85X0Dfn/RBLBgBDxnQPfAEJgBY+A9gALA4tcbamSzS4xq4FOQAJgCDwV2CPKV8tZAJcAjMMkUe1vX+U+SMhfAJEHasQIWmXNN3abzDwHUrgcRGmYcgKe0bxrblHEB4E/pndMazNpSZGcsZdBlYJcEL9Afo75molJyM2FxmPgmgPqlWNLGfwZGG6UiyEvLzHYDmoPkDDiNm9JR9uboiONcBXrpY1qmgs21x1QwyZcpvxt9NS09PlsPAAAAAElFTkSuQmCC&logoWidth=14" alt="Duplicate Space"></a></p>
30
+ </div>
31
+ ''')
32
+
33
  DESCRIPTION = '''
34
  <div align=center>
35
  <h1 style="font-weight: 900; margin-bottom: 7px;">