Spaces:
Sleeping
Sleeping
Subhash Vadaparthi commited on
Commit Β·
46e96d1
1
Parent(s): 50d1f05
refactor: flatten project structure to resolve 'openenv validate' failures and align with passing reference submissions
Browse filesFiles changed (9)
- app/agent.py β agent.pyRenamed
- app/__init__.pyDeleted-12
- app/main.pyDeleted-25
- app/env.py β env.pyRenamed+1-1
- inference.py+4-4
- app/models.py β models.pyRenamed
- server/app.py+5-5
- app/tasks.py β tasks.pyRenamed
- test_env.py+4-4
123456789101112"""Healthcare Scheduling OpenEnv environment package."""
from app.models import HealthcareAction, HealthcareObservation, HealthcareStatefrom app.env import HealthcareEnvironment, HealthcareEnv
__all__ = [ "HealthcareAction", "HealthcareObservation", "HealthcareState", "HealthcareEnvironment", "HealthcareEnv",]12345678910111213141516171819202122232425"""Main FastAPI application - backward-compatible entry point.
The primary server entry point is ``server.app``, which uses the OpenEnv``create_app()`` factory and registers all custom endpoints.This module re-exports the app for legacy ``python app/main.py`` usage."""
from __future__ import annotations
import osimport sysfrom pathlib import Path
# Ensure the project root is on sys.pathPROJECT_ROOT = Path(__file__).resolve().parent.parentif str(PROJECT_ROOT) not in sys.path: sys.path.insert(0, str(PROJECT_ROOT))
from server.app import app # re-export the canonical app
if __name__ == "__main__": import uvicorn uvicorn.run(app, host="0.0.0.0", port=7860)20 unmodified lines212223242425262720 unmodified lines SUPPORTS_CONCURRENT_SESSIONS = False
try: from app.models import HealthcareAction, HealthcareObservation, HealthcareState from models import HealthcareAction, HealthcareObservation, HealthcareStateexcept ImportError: from .models import HealthcareAction, HealthcareObservation, HealthcareState
33 unmodified lines3435363738393738394041423 unmodified lines464748494950515233 unmodified lines# ββ Import environment components ββββββββββββββββββββββββββββββββββββsys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from app.env import HealthcareEnvironmentfrom app.models import HealthcareActionfrom app.tasks import TaskGraderfrom env import HealthcareEnvironmentfrom models import HealthcareActionfrom tasks import TaskGrader
# ββ Environment variables (per submission guidelines) ββββββββββββββββAPI_BASE_URL = os.getenv("API_BASE_URL", "https://router.huggingface.co/v1")3 unmodified linesif HF_TOKEN is None: raise ValueError("HF_TOKEN environment variable is required")
BENCHMARK = "healthcare-scheduling"BENCHMARK = "healthcare_scheduling"MAX_STEPS = 20
# Initialize OpenAI client37 unmodified lines3839404142434441424344454647141 unmodified lines18919019119219219319419537 unmodified lines sys.path.insert(0, str(PROJECT_ROOT))
# ββ Import environment and models βββββββββββββββββββββββββββββββββββfrom app.env import HealthcareEnvironmentfrom app.models import HealthcareAction, HealthcareObservationfrom app.agent import BaselineAgentfrom app.tasks import TASKS, TaskGraderfrom env import HealthcareEnvironmentfrom models import HealthcareAction, HealthcareObservationfrom agent import BaselineAgentfrom tasks import TASKS, TaskGrader
# ββ Build the FastAPI app βββββββββββββββββββββββββββββββββββββββββββ_using_openenv = False141 unmodified lines import uvicorn
port = int(os.getenv("API_PORT", "7860")) uvicorn.run(app, host="0.0.0.0", port=port) uvicorn.run("server.app:app", host="0.0.0.0", port=port, reload=True)
if __name__ == "__main__":12 unmodified lines131415161718191617181920212212 unmodified lines
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from app.env import HealthcareEnvironmentfrom app.models import HealthcareActionfrom app.agent import BaselineAgentfrom app.tasks import TaskGraderfrom env import HealthcareEnvironmentfrom models import HealthcareActionfrom agent import BaselineAgentfrom tasks import TaskGrader
def test():app/agent.py β agent.pyRenamed
app/__init__.pyDeleted-12
app/main.pyDeleted-25
app/env.py β env.pyRenamed+1-1
inference.py+4-4
app/models.py β models.pyRenamed
server/app.py+5-5
app/tasks.py β tasks.pyRenamed
test_env.py+4-4