File size: 749 Bytes
cdd65a4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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()