File size: 1,849 Bytes
c5935ae
 
 
 
 
 
6a9dffd
6043a56
c5935ae
 
 
 
6a9dffd
6043a56
c5935ae
 
 
 
 
 
5a889e0
 
6a9dffd
c5935ae
 
 
5a889e0
6043a56
6a9dffd
c5935ae
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
        with gr.Box(visible=os.environ.get("SPACE_ID")):
            is_shared_ui = str(os.environ.get("IS_SHARED_UI", "") or "").strip().lower() not in ("", "0", "false", "none", "no")
            if is_shared_ui:
                import torch
                if not torch.cuda.is_available():
                    gr.HTML(f"""
                    <div class="gr-prose" style="max-width: 80%; font-size: 20px; line-height: 20px; font-family: monospace;">
                      <p><a href="https://jtlai0921.wixsite.com/mysite" style="target=" _blank"="">▲ 我的網站</a></p>
                    </div>
                    """)
                else:
                    gr.HTML(f"""
                    <div class="gr-prose" style="max-width: 80%; font-size: 20px; line-height: 20px; font-family: monospace;">
                     <p>▲ 我的網站<a href="https://jtlai0921.wixsite.com/mysite" style="target=" _blank"="">▲ 我的網站</a></p>
                    </div>
                    """)
            elif os.environ.get("SPACE_ID"):
                import torch
                if not torch.cuda.is_available():
                    gr.HTML(f"""
                    <div class="gr-prose" style="max-width: 80%; font-size: 20px; line-height: 20px; font-family: monospace;">
                        <p>▲ 我的網站<a href="https://jtlai0921.wixsite.com/mysite" style="target=" _blank"=""></a></p>
                        </div>
                    """)
                else:
                    gr.HTML(f"""
                    <div class="gr-prose" style="max-width: 80%; font-size: 20px; line-height: 20px; font-family: monospace;">
                        <p>▲ 我的網站<a href="https://jtlai0921.wixsite.com/mysite" style="target=" _blank"="">▲ 我的網站</a></p>
                        </div>
                    """)