Demo / app.py
PCTseng's picture
Update app.py
4e04ea5 verified
raw
history blame
734 Bytes
import os
import gradio as gr
#os.environ["HF_TOKEN"] = os.getenv('demo_gradioapp')
js_dark_theme = """
function refresh() {
const url = new URL(window.location);
if (url.searchParams.get('__theme') !== 'dark') {
url.searchParams.set('__theme', 'dark');
window.location.href = url.href;
}
}
"""
# For ithentication issue, always share https://pctseng-demo.hf.space
#demo = gr.load("PCTseng/EFP_Demo", src="spaces", hf_token = os.getenv('demo_gradioapp'), js=js_dark_theme).render()
with gr.Blocks(js=js_dark_theme) as app:
gr.load("PCTseng/EFP_Demo", src="spaces", hf_token = os.getenv('demo_gradioapp')).render()
app.queue().launch(auth=('demo',os.getenv('password')), share=True, ssr_mode=False)