File size: 816 Bytes
cbfba95
5a7f72f
cbfba95
 
 
 
 
e071e99
 
5ed6381
 
 
 
 
e071e99
 
c69dcb9
4c67d79
c69dcb9
 
 
 
cbfba95
 
 
 
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
import os
import random
import streamlit as st
import streamlit.components.v1 as components

st.set_page_config(layout="wide")

# Message for users
st.markdown("""
**Notice**: If you encounter any issues opening the demo or using the chatbot, try reloading the page which would reschedule a new demo instance. 
Please report the issues [here](https://huggingface.co/spaces/mhan/Shot2Story/discussions/1).
We will respond ASAP. 


""")

# List of backend URLs
backends = ["backend1", "backend2", "backend3"]

# Randomly select a backend URL
backend = random.choice(backends)
backend_url = os.getenv(backend, "https://www.bytedance.com/en/")  # 如果环境变量不存在,则使用默认 URL

iframe_html = f'<iframe src="{backend_url}" width="100%" height="800"></iframe>'

components.html(iframe_html, height=800)