Pingul commited on
Commit
fa3abe2
·
verified ·
1 Parent(s): ed08817

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -115,7 +115,10 @@ def predict(
115
  def load_csv_dataset(filename: str) -> pd.DataFrame:
116
  """Carga un CSV de NASA con manejo de comentarios y errores"""
117
  try:
118
- filepath = os.path.join("NASA_datasets", filename)
 
 
 
119
  df = pd.read_csv(filepath, comment='#')
120
  return df
121
  except Exception as e:
 
115
  def load_csv_dataset(filename: str) -> pd.DataFrame:
116
  """Carga un CSV de NASA con manejo de comentarios y errores"""
117
  try:
118
+ # Obtiene el directorio absoluto donde está este archivo
119
+ base_dir = os.path.dirname(os.path.abspath(__file__))
120
+ dataset_dir = os.path.join(base_dir, "NASA_datasets")
121
+ filepath = os.path.join(dataset_dir, filename)
122
  df = pd.read_csv(filepath, comment='#')
123
  return df
124
  except Exception as e: