import gradio as gr # 已有的 Hugging Face Space 链接 CALCULATOR_URL = "https://huggingface.co/spaces/EricCRX/Upfront_Embodied_Carbon_Calculator" PREDICTOR_URL = "https://huggingface.co/spaces/yl0628/co2-emission-proj1" # 未来可替换为你的预测模型链接 with gr.Blocks(title="Unified Carbon Tools") as demo: gr.Markdown("# 🌍 Unified Carbon Tools") gr.Markdown("A central interface linking to multiple sustainability tools.") with gr.Tab("Calculator"): gr.Markdown("### 🔢 Upfront Embodied Carbon Calculator") gr.Markdown( f"[👉 Click here to open the Calculator]({CALCULATOR_URL})" ) gr.Markdown( "This calculator estimates **A1–A5 upfront embodied carbon** " "for building materials and construction processes. It provides modular outputs (A1–A5) " "and total tCO₂e results for comparative design analysis." ) with gr.Tab("Predictor"): gr.Markdown("### 📈 CO₂ Emission Predictor") gr.Markdown( f"[👉 Click here to open the Predictor]({PREDICTOR_URL})" ) gr.Markdown( "This section will link to a **time-series ML model** that forecasts future CO₂ emissions " "based on historical data and model-inference pipelines." ) demo.launch()