Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,13 @@
|
|
1 |
import streamlit as st
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
-
|
4 |
-
st.
|
|
|
|
1 |
import streamlit as st
|
2 |
+
import nbformat
|
3 |
+
from nbconvert import HTMLExporter
|
4 |
+
notebook = nbformat.read('https://huggingface.co/spaces/Koi4595/SI649_project_ningzr/blob/main/project2_commit.ipynb', as_version=4)
|
5 |
+
# 将 Notebook 转换为 HTML
|
6 |
+
html_exporter = HTMLExporter()
|
7 |
+
html_data, resources = html_exporter.from_notebook_node(notebook)
|
8 |
+
# 设置页面配置
|
9 |
+
st.set_page_config(layout="wide")
|
10 |
|
11 |
+
# 显示 HTML 内容
|
12 |
+
with st.container():
|
13 |
+
st.components.v1.html(html_data, height=800, width=1200, scrolling=True)
|