Spaces:
Running
Running
Commit Β·
c4ff02d
1
Parent(s): ea8eeac
Fix deployment entry point and merge requirements
Browse filesThis view is limited to 50 files because it contains too many changes. Β See raw diff
- app.py +19 -0
- {backend β matrix}/.env.example +0 -0
- {backend β matrix}/Dockerfile +0 -0
- {backend β matrix}/benchmark.py +1 -1
- {backend β matrix}/catboost_info/catboost_training.json +0 -0
- {backend β matrix}/catboost_info/learn/events.out.tfevents +0 -0
- {backend β matrix}/catboost_info/learn_error.tsv +0 -0
- {backend β matrix}/catboost_info/time_left.tsv +0 -0
- {backend β matrix}/code/analysis/__init__.py +0 -0
- {backend β matrix}/code/analysis/aggregate_results.py +0 -0
- {backend β matrix}/code/config/datasets.yaml +0 -0
- {backend β matrix}/code/config/experiments.yaml +0 -0
- {backend β matrix}/code/config/models.yaml +0 -0
- {backend β matrix}/code/docker/Dockerfile +0 -0
- {backend β matrix}/code/evaluation/__init__.py +0 -0
- {backend β matrix}/code/evaluation/compute_tracker.py +0 -0
- {backend β matrix}/code/evaluation/cross_validation.py +0 -0
- {backend β matrix}/code/evaluation/metrics.py +0 -0
- {backend β matrix}/code/evaluation/statistical_tests.py +0 -0
- {backend β matrix}/code/models/__init__.py +0 -0
- {backend β matrix}/code/models/autogluon_wrapper.py +0 -0
- {backend β matrix}/code/models/base_wrapper.py +0 -0
- {backend β matrix}/code/models/baseline_wrappers.py +0 -0
- {backend β matrix}/code/models/sap_rpt1_hf_wrapper.py +0 -0
- {backend β matrix}/code/models/sap_rpt1_wrapper.py +0 -0
- {backend β matrix}/code/models/tabicl_wrapper.py +0 -0
- {backend β matrix}/code/models/tabpfn_wrapper.py +0 -0
- {backend β matrix}/code/runners/__init__.py +0 -0
- {backend β matrix}/code/runners/run_baselines.py +0 -0
- {backend β matrix}/code/runners/run_batch.py +0 -0
- {backend β matrix}/code/runners/run_experiment.py +0 -0
- {backend β matrix}/code/sap_rpt1.egg-info/PKG-INFO +0 -0
- {backend β matrix}/code/sap_rpt1.egg-info/SOURCES.txt +0 -0
- {backend β matrix}/code/sap_rpt1.egg-info/dependency_links.txt +0 -0
- {backend β matrix}/code/sap_rpt1.egg-info/requires.txt +0 -0
- {backend β matrix}/code/sap_rpt1.egg-info/top_level.txt +0 -0
- {backend β matrix}/code/utils/__init__.py +0 -0
- {backend β matrix}/code/utils/logging_utils.py +0 -0
- {backend β matrix}/ensemble.py +0 -0
- {backend β matrix}/fix_dataset.py +0 -0
- main.py β matrix/main.py +2 -0
- {backend β matrix}/scripts/demo_benchmark.py +0 -0
- {backend β matrix}/scripts/download_datasets.py +0 -0
- {backend β matrix}/scripts/reproduce_all.sh +0 -0
- {backend β matrix}/scripts/test_sap_rpt1.py +0 -0
- {backend β matrix}/setup.py +0 -0
- {backend β matrix}/static/app.js +0 -0
- {backend β matrix}/static/arena.html +0 -0
- {backend β matrix}/static/landing.html +0 -0
- {backend β matrix}/static/style.css +0 -0
app.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import sys
|
| 2 |
+
import os
|
| 3 |
+
from pathlib import Path
|
| 4 |
+
|
| 5 |
+
# Add backend to sys.path so we can import modules correctly
|
| 6 |
+
# We add both backend/ and backend/code to the path
|
| 7 |
+
backend_path = Path(__file__).parent / "backend"
|
| 8 |
+
sys.path.append(str(backend_path))
|
| 9 |
+
sys.path.append(str(backend_path / "code"))
|
| 10 |
+
|
| 11 |
+
# Import the FastAPI app from main.py in the backend folder
|
| 12 |
+
from main import app
|
| 13 |
+
|
| 14 |
+
# For Hugging Face Spaces, the file must be named app.py or main.py
|
| 15 |
+
# and the app instance must be called 'app'.
|
| 16 |
+
if __name__ == "__main__":
|
| 17 |
+
import uvicorn
|
| 18 |
+
port = int(os.environ.get("PORT", 7860))
|
| 19 |
+
uvicorn.run(app, host="0.0.0.0", port=port)
|
{backend β matrix}/.env.example
RENAMED
|
File without changes
|
{backend β matrix}/Dockerfile
RENAMED
|
File without changes
|
{backend β matrix}/benchmark.py
RENAMED
|
@@ -17,7 +17,7 @@ from sklearn.neighbors import KNeighborsClassifier, KNeighborsRegressor
|
|
| 17 |
warnings.filterwarnings("ignore")
|
| 18 |
|
| 19 |
# Allow importing model wrappers from the code directory
|
| 20 |
-
sys.path.insert(0, str(Path(__file__).parent
|
| 21 |
|
| 22 |
N_FOLDS = int(os.getenv("N_FOLDS", "5"))
|
| 23 |
RAND = int(os.getenv("RANDOM_STATE", "42"))
|
|
|
|
| 17 |
warnings.filterwarnings("ignore")
|
| 18 |
|
| 19 |
# Allow importing model wrappers from the code directory
|
| 20 |
+
sys.path.insert(0, str(Path(__file__).parent / "code"))
|
| 21 |
|
| 22 |
N_FOLDS = int(os.getenv("N_FOLDS", "5"))
|
| 23 |
RAND = int(os.getenv("RANDOM_STATE", "42"))
|
{backend β matrix}/catboost_info/catboost_training.json
RENAMED
|
File without changes
|
{backend β matrix}/catboost_info/learn/events.out.tfevents
RENAMED
|
File without changes
|
{backend β matrix}/catboost_info/learn_error.tsv
RENAMED
|
File without changes
|
{backend β matrix}/catboost_info/time_left.tsv
RENAMED
|
File without changes
|
{backend β matrix}/code/analysis/__init__.py
RENAMED
|
File without changes
|
{backend β matrix}/code/analysis/aggregate_results.py
RENAMED
|
File without changes
|
{backend β matrix}/code/config/datasets.yaml
RENAMED
|
File without changes
|
{backend β matrix}/code/config/experiments.yaml
RENAMED
|
File without changes
|
{backend β matrix}/code/config/models.yaml
RENAMED
|
File without changes
|
{backend β matrix}/code/docker/Dockerfile
RENAMED
|
File without changes
|
{backend β matrix}/code/evaluation/__init__.py
RENAMED
|
File without changes
|
{backend β matrix}/code/evaluation/compute_tracker.py
RENAMED
|
File without changes
|
{backend β matrix}/code/evaluation/cross_validation.py
RENAMED
|
File without changes
|
{backend β matrix}/code/evaluation/metrics.py
RENAMED
|
File without changes
|
{backend β matrix}/code/evaluation/statistical_tests.py
RENAMED
|
File without changes
|
{backend β matrix}/code/models/__init__.py
RENAMED
|
File without changes
|
{backend β matrix}/code/models/autogluon_wrapper.py
RENAMED
|
File without changes
|
{backend β matrix}/code/models/base_wrapper.py
RENAMED
|
File without changes
|
{backend β matrix}/code/models/baseline_wrappers.py
RENAMED
|
File without changes
|
{backend β matrix}/code/models/sap_rpt1_hf_wrapper.py
RENAMED
|
File without changes
|
{backend β matrix}/code/models/sap_rpt1_wrapper.py
RENAMED
|
File without changes
|
{backend β matrix}/code/models/tabicl_wrapper.py
RENAMED
|
File without changes
|
{backend β matrix}/code/models/tabpfn_wrapper.py
RENAMED
|
File without changes
|
{backend β matrix}/code/runners/__init__.py
RENAMED
|
File without changes
|
{backend β matrix}/code/runners/run_baselines.py
RENAMED
|
File without changes
|
{backend β matrix}/code/runners/run_batch.py
RENAMED
|
File without changes
|
{backend β matrix}/code/runners/run_experiment.py
RENAMED
|
File without changes
|
{backend β matrix}/code/sap_rpt1.egg-info/PKG-INFO
RENAMED
|
File without changes
|
{backend β matrix}/code/sap_rpt1.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
{backend β matrix}/code/sap_rpt1.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{backend β matrix}/code/sap_rpt1.egg-info/requires.txt
RENAMED
|
File without changes
|
{backend β matrix}/code/sap_rpt1.egg-info/top_level.txt
RENAMED
|
File without changes
|
{backend β matrix}/code/utils/__init__.py
RENAMED
|
File without changes
|
{backend β matrix}/code/utils/logging_utils.py
RENAMED
|
File without changes
|
{backend β matrix}/ensemble.py
RENAMED
|
File without changes
|
{backend β matrix}/fix_dataset.py
RENAMED
|
File without changes
|
main.py β matrix/main.py
RENAMED
|
@@ -7,7 +7,9 @@ from pathlib import Path
|
|
| 7 |
from dotenv import load_dotenv
|
| 8 |
|
| 9 |
# Load .env before anything else so HF_TOKEN is available to benchmark.py
|
|
|
|
| 10 |
load_dotenv(Path(__file__).parent / ".env")
|
|
|
|
| 11 |
|
| 12 |
import pandas as pd
|
| 13 |
from fastapi import FastAPI, File, UploadFile, Form, HTTPException
|
|
|
|
| 7 |
from dotenv import load_dotenv
|
| 8 |
|
| 9 |
# Load .env before anything else so HF_TOKEN is available to benchmark.py
|
| 10 |
+
# Load .env from current or parent directory
|
| 11 |
load_dotenv(Path(__file__).parent / ".env")
|
| 12 |
+
load_dotenv(Path(__file__).parent.parent / ".env")
|
| 13 |
|
| 14 |
import pandas as pd
|
| 15 |
from fastapi import FastAPI, File, UploadFile, Form, HTTPException
|
{backend β matrix}/scripts/demo_benchmark.py
RENAMED
|
File without changes
|
{backend β matrix}/scripts/download_datasets.py
RENAMED
|
File without changes
|
{backend β matrix}/scripts/reproduce_all.sh
RENAMED
|
File without changes
|
{backend β matrix}/scripts/test_sap_rpt1.py
RENAMED
|
File without changes
|
{backend β matrix}/setup.py
RENAMED
|
File without changes
|
{backend β matrix}/static/app.js
RENAMED
|
File without changes
|
{backend β matrix}/static/arena.html
RENAMED
|
File without changes
|
{backend β matrix}/static/landing.html
RENAMED
|
File without changes
|
{backend β matrix}/static/style.css
RENAMED
|
File without changes
|