Mango_proejct / app.py
PierreJousselin's picture
Create app.py
cdd65a4 verified
raw
history blame
749 Bytes
import gradio as gr
import subprocess
import sys
# Define the function to run the entire script
def run_entsoe_script():
# Run the script as a subprocess
result = subprocess.run([sys.executable, 'daily_energy_pipeline.py'], capture_output=True, text=True)
# Return the script's output or any errors
return result.stdout if result.returncode == 0 else result.stderr
# Define Gradio interface (No inputs since we're running the entire script)
interface = gr.Interface(
fn=run_entsoe_script,
inputs=[], # No inputs needed
outputs="text", # Output the script's result as text
title="Energy Load Prediction",
description="Run the energy load prediction pipeline."
)
# Launch the interface
interface.launch()