encounter1997 commited on
Commit
80831ec
β€’
1 Parent(s): cde5f09
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -18,6 +18,9 @@ TITLE = '# [vid2vid-zero](https://github.com/baaivision/vid2vid-zero)'
18
  ORIGINAL_SPACE_ID = 'BAAI/vid2vid-zero'
19
  SPACE_ID = os.getenv('SPACE_ID', ORIGINAL_SPACE_ID)
20
  GPU_DATA = getoutput('nvidia-smi')
 
 
 
21
 
22
  if os.getenv('SYSTEM') == 'spaces' and SPACE_ID != ORIGINAL_SPACE_ID:
23
  SETTINGS = f'<a href="https://huggingface.co/spaces/{SPACE_ID}/settings">Settings</a>'
@@ -52,8 +55,11 @@ pipe = None
52
  runner = Runner(HF_TOKEN)
53
 
54
  with gr.Blocks(css='gradio_demo/style.css') as demo:
 
55
  if not torch.cuda.is_available():
56
  show_warning(CUDA_NOT_AVAILABLE_WARNING)
 
 
57
 
58
  gr.Markdown(TITLE)
59
  with gr.Tabs():
 
18
  ORIGINAL_SPACE_ID = 'BAAI/vid2vid-zero'
19
  SPACE_ID = os.getenv('SPACE_ID', ORIGINAL_SPACE_ID)
20
  GPU_DATA = getoutput('nvidia-smi')
21
+ SHARED_UI_WARNING = f'''## Attention - Running doesn't work in this shared UI. You can duplicate and use it with a paid private T4 GPU.
22
+ <center><a class="duplicate-button" style="display:inline-block" target="_blank" href="https://huggingface.co/spaces/{SPACE_ID}?duplicate=true"><img style="margin-top:0;margin-bottom:0" 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></center>
23
+ '''
24
 
25
  if os.getenv('SYSTEM') == 'spaces' and SPACE_ID != ORIGINAL_SPACE_ID:
26
  SETTINGS = f'<a href="https://huggingface.co/spaces/{SPACE_ID}/settings">Settings</a>'
 
55
  runner = Runner(HF_TOKEN)
56
 
57
  with gr.Blocks(css='gradio_demo/style.css') as demo:
58
+ gr.HTML('''<center><a href="https://huggingface.co/spaces/BAAI/vid2vid-zero?duplicate=true"><img src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>Duplicate the Space and run securely with your machine''')
59
  if not torch.cuda.is_available():
60
  show_warning(CUDA_NOT_AVAILABLE_WARNING)
61
+ # elif SPACE_ID == ORIGINAL_SPACE_ID:
62
+ # show_warning(SHARED_UI_WARNING)
63
 
64
  gr.Markdown(TITLE)
65
  with gr.Tabs():