Spaces:
Running
Running
init commit
Browse files
README.md
CHANGED
|
@@ -3,8 +3,8 @@ title: ScaleCUA Demo
|
|
| 3 |
emoji: 📚
|
| 4 |
colorFrom: pink
|
| 5 |
colorTo: indigo
|
| 6 |
-
sdk:
|
| 7 |
-
sdk_version:
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
---
|
|
|
|
| 3 |
emoji: 📚
|
| 4 |
colorFrom: pink
|
| 5 |
colorTo: indigo
|
| 6 |
+
sdk: streamlit
|
| 7 |
+
sdk_version: 1.28.2
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
---
|
app.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import streamlit as st
|
| 3 |
+
import streamlit.components.v1 as components
|
| 4 |
+
|
| 5 |
+
st.set_page_config(layout="wide")
|
| 6 |
+
|
| 7 |
+
backend_url = os.getenv("backend") # 如果环境变量不存在,则使用默认 URL
|
| 8 |
+
|
| 9 |
+
iframe_html = """
|
| 10 |
+
<!DOCTYPE html>
|
| 11 |
+
<html>
|
| 12 |
+
<head>
|
| 13 |
+
<title>InternVL</title>
|
| 14 |
+
<style>
|
| 15 |
+
iframe {
|
| 16 |
+
position: absolute;
|
| 17 |
+
top: 0;
|
| 18 |
+
left: 0;
|
| 19 |
+
width: 100%;
|
| 20 |
+
height: 100%;
|
| 21 |
+
border: none;
|
| 22 |
+
}
|
| 23 |
+
</style>
|
| 24 |
+
</head>
|
| 25 |
+
<body>
|
| 26 |
+
<iframe src="{{backend_url}}"></iframe>
|
| 27 |
+
</body>
|
| 28 |
+
</html>
|
| 29 |
+
"""
|
| 30 |
+
iframe_html = iframe_html.replace("{{backend_url}}", backend_url)
|
| 31 |
+
components.html(iframe_html, height=1200)
|