Koi4595 commited on
Commit
fdf42cb
1 Parent(s): ab1affe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -1,4 +1,13 @@
1
  import streamlit as st
 
 
 
 
 
 
 
 
2
 
3
- x = st.slider('Select a value')
4
- st.write(x, 'squared is', x * x)
 
 
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)