Koi4595's picture
Update app.py
fdf42cb verified
raw
history blame
508 Bytes
import streamlit as st
import nbformat
from nbconvert import HTMLExporter
notebook = nbformat.read('https://huggingface.co/spaces/Koi4595/SI649_project_ningzr/blob/main/project2_commit.ipynb', as_version=4)
# 将 Notebook 转换为 HTML
html_exporter = HTMLExporter()
html_data, resources = html_exporter.from_notebook_node(notebook)
# 设置页面配置
st.set_page_config(layout="wide")
# 显示 HTML 内容
with st.container():
st.components.v1.html(html_data, height=800, width=1200, scrolling=True)