Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,9 +1,17 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import subprocess
|
| 3 |
import sys
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
# Define the function to run the entire script
|
| 6 |
def run_entsoe_script():
|
|
|
|
|
|
|
|
|
|
| 7 |
# Run the script as a subprocess
|
| 8 |
result = subprocess.run([sys.executable, 'daily_energy_pipeline.py'], capture_output=True, text=True)
|
| 9 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import subprocess
|
| 3 |
import sys
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
# Function to install requirements
|
| 7 |
+
def install_requirements():
|
| 8 |
+
subprocess.run([sys.executable, "-m", "pip", "install", "-r", "requirements.txt"])
|
| 9 |
|
| 10 |
# Define the function to run the entire script
|
| 11 |
def run_entsoe_script():
|
| 12 |
+
# Ensure dependencies are installed first
|
| 13 |
+
install_requirements()
|
| 14 |
+
|
| 15 |
# Run the script as a subprocess
|
| 16 |
result = subprocess.run([sys.executable, 'daily_energy_pipeline.py'], capture_output=True, text=True)
|
| 17 |
|