Spaces:
Running
Running
File size: 811 Bytes
fbcece0 7fc1b17 33603d0 0b7be03 33603d0 d5befcd a0d4a74 7c76b20 |
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 32 33 |
import os
import streamlit as st
import streamlit.components.v1 as components
st.set_page_config(layout="wide")
backend_url = os.getenv("backend", "https://internvl.opengvlab.com/") # 如果环境变量不存在,则使用默认 URL
print(f"backend_url: {backend_url}")
iframe_html = """
<!DOCTYPE html>
<html>
<head>
<title>InternVL</title>
<style>
iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: none;
}
</style>
</head>
<body>
<iframe src="{{backend_url}}"></iframe>
</body>
</html>
"""
iframe_html = f'<iframe src="{backend_url}" width="100%" height="800"></iframe>'
#iframe_html = iframe_html.replace("{{backend_url}}", backend_url)
# components.html(iframe_html, height=1200)
components.html(iframe_html, height=800) |