czczup commited on
Commit
30288c0
1 Parent(s): a115b97

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -31
app.py CHANGED
@@ -1,37 +1,25 @@
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", "https://internvl.opengvlab.com/") # 如果环境变量不存在,则使用默认 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
- <div style="text-align:center"> <h1><strong><font style=color:rgba(2200,10,10,1)>This space is currently under maintenance 😊😊</font></strong></h1></div>
27
- <div style="text-align:center"><h2>We warmly welcome you to visit <a href="https://github.com/OpenGVLab/InternVL?tab=readme-ov-file#-internvl-family-closing-the-gap-to-commercial-multimodal-models-with-open-source-suites--a-pioneering-open-source-alternative-to-gpt-4o" target="_blank">Chat Demo</a> of InternVL2 if you’re interested 🎉🎉</br></h2></div>
28
- <div style="text-align:center">
29
- [<a href="https://internvl.github.io/blog/2024-07-02-InternVL-2.0/" target="_blank">📜 InternVL2 Blog</a>] |
30
- [<a href="https://github.com/OpenGVLab/InternVL?tab=readme-ov-file#quick-start-with-huggingface" target="_blank">🚀 Quick Start</a>] |
31
- [<a href="https://github.com/OpenGVLab/InternVL/blob/main/document/How_to_use_InternVL_API.md" target="_blank">🌐 API</a>]
32
- </div>
33
- </body>
34
- </html>
35
- """
36
- iframe_html = iframe_html.replace("{{backend_url}}", backend_url)
37
- components.html("https://internvl.opengvlab.com/", height=1200)
 
 
1
  import streamlit as st
 
2
 
3
  st.set_page_config(layout="wide")
4
 
5
+ # Add custom CSS to make the iframe full screen
6
+ st.markdown(
7
+ """
8
+ <style>
 
 
 
 
9
  iframe {
10
+ position: absolute;
11
+ width: 100%;
12
+ height: 100%;
13
+ border: none;
14
+ }
15
+ .main > div {
16
+ padding: 0;
17
+ height: 100vh;
18
  }
19
+ </style>
20
+ """,
21
+ unsafe_allow_html=True,
22
+ )
23
+
24
+ # Embed the external webpage
25
+ st.components.v1.iframe("https://internvl.opengvlab.com/")