PierreJousselin commited on
Commit
61352c4
·
verified ·
1 Parent(s): d121e16

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
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