dontalk / header_patch.py
michael135's picture
Update header_patch.py
6043a56
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>
""")